gfx-backend-empty 0.5.2

Empty backend for gfx-rs
Documentation
use hal::pso;
use log::debug;

/// Dummy descriptor pool.
#[derive(Debug)]
pub struct DescriptorPool;

impl pso::DescriptorPool<crate::Backend> for DescriptorPool {
    unsafe fn allocate_set(
        &mut self,
        _layout: &DescriptorSetLayout,
    ) -> Result<DescriptorSet, pso::AllocationError> {
        Ok(DescriptorSet {
            name: String::new(),
        })
    }

    unsafe fn free_sets<I>(&mut self, descriptor_sets: I)
    where
        I: IntoIterator<Item = DescriptorSet>,
    {
        for _ in descriptor_sets {
            // Let the descriptor set drop
        }
    }

    unsafe fn reset(&mut self) {
        debug!("Resetting descriptor pool");
    }
}

#[derive(Debug)]
pub struct DescriptorSetLayout {
    /// User-defined name for this descriptor set layout
    pub(crate) name: String,
}

#[derive(Debug)]
pub struct DescriptorSet {
    /// User-defined name for this descriptor set
    pub(crate) name: String,
}