diff --git a/vulkano-shaders/src/descriptor_sets.rs b/vulkano-shaders/src/descriptor_sets.rs index 6ce228c4..64dd3bd8 100644 --- a/vulkano-shaders/src/descriptor_sets.rs +++ b/vulkano-shaders/src/descriptor_sets.rs @@ -208,9 +208,9 @@ fn descriptor_infos(doc: &parse::Spirv, pointed_ty: u32, force_combined_image_sa } else if let &enums::Dim::DimBuffer = dim { // We are a texel buffer. let desc = format!("DescriptorDescTy::TexelBuffer {{ - sampled: {}, + storage: {}, format: None, // TODO: specify format if known - }}", sampled); + }}", !sampled); Some((desc, true)) diff --git a/vulkano/src/descriptor/descriptor.rs b/vulkano/src/descriptor/descriptor.rs index ae4c416e..d12a28aa 100644 --- a/vulkano/src/descriptor/descriptor.rs +++ b/vulkano/src/descriptor/descriptor.rs @@ -48,7 +48,13 @@ pub enum DescriptorDescTy { Sampler, // TODO: the sampler has some restrictions as well CombinedImageSampler(DescriptorImageDesc), // TODO: the sampler has some restrictions as well Image(DescriptorImageDesc), - TexelBuffer { sampled: bool, format: Option }, + TexelBuffer { + /// If `true`, this describes a storage texel buffer. + storage: bool, + /// The format of the content, or `None` if the format is unknown. Depending on the + /// context, it may be invalid to have a `None` value here. + format: Option, + }, InputAttachment { multisampled: bool, array_layers: DescriptorImageDescArray }, Buffer(DescriptorBufferDesc), } @@ -75,9 +81,9 @@ impl DescriptorDescTy { (true, true) => DescriptorType::StorageBufferDynamic, } }, - DescriptorDescTy::TexelBuffer { sampled, .. } => { - if sampled { DescriptorType::UniformTexelBuffer } - else { DescriptorType::StorageTexelBuffer } + DescriptorDescTy::TexelBuffer { storage, .. } => { + if storage { DescriptorType::StorageTexelBuffer } + else { DescriptorType::UniformTexelBuffer } }, }) } @@ -115,10 +121,10 @@ impl DescriptorDescTy { } }, - (DescriptorDescTy::TexelBuffer { sampled: me_sampled, format: me_format }, - DescriptorDescTy::TexelBuffer { sampled: other_sampled, format: other_format }) => + (DescriptorDescTy::TexelBuffer { storage: me_storage, format: me_format }, + DescriptorDescTy::TexelBuffer { storage: other_storage, format: other_format }) => { - if me_sampled != other_sampled { + if me_storage != other_storage { return false; }