Merge pull request #133 from attackgoat/master

Added StorageImage as a new descriptor for the pipeline_layout macro.
This commit is contained in:
tomaka 2016-06-12 20:06:53 +02:00 committed by GitHub
commit f32a43330a

View File

@ -130,6 +130,7 @@ macro_rules! pipeline_layout {
use $crate::descriptor::pipeline_layout::custom_pipeline_macro::SampledImage;
use $crate::descriptor::pipeline_layout::custom_pipeline_macro::DescriptorMarker;
use $crate::descriptor::pipeline_layout::custom_pipeline_macro::StorageBuffer;
use $crate::descriptor::pipeline_layout::custom_pipeline_macro::StorageImage;
use $crate::descriptor::pipeline_layout::custom_pipeline_macro::UniformBuffer;
use $crate::descriptor::pipeline_layout::custom_pipeline_macro::InputAttachment;
use $crate::descriptor::pipeline_layout::custom_pipeline_macro::ValidParameter;
@ -342,6 +343,30 @@ unsafe impl<'a, I> ValidParameter<SampledImage> for &'a Arc<I>
}
}
pub struct StorageImage;
unsafe impl DescriptorMarker for StorageImage {
#[inline]
fn descriptor_type() -> DescriptorDescTy {
DescriptorDescTy::Image(DescriptorImageDesc {
sampled: false,
// FIXME: correct values
dimensions: DescriptorImageDescDimensions::TwoDimensional,
multisampled: false,
array_layers: DescriptorImageDescArray::NonArrayed,
format: None,
})
}
}
unsafe impl<'a, I> ValidParameter<StorageImage> for &'a Arc<I>
where I: ImageView + 'static
{
#[inline]
fn write(&self, binding: u32) -> DescriptorWrite {
DescriptorWrite::storage_image(binding, self)
}
}
pub struct InputAttachment;
unsafe impl DescriptorMarker for InputAttachment {
#[inline]