mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2025-02-16 17:12:29 +00:00
Make sampled
parameter of texel buffers less confusing
This commit is contained in:
parent
a26fc00359
commit
cf9b4f76b8
@ -208,9 +208,9 @@ fn descriptor_infos(doc: &parse::Spirv, pointed_ty: u32, force_combined_image_sa
|
|||||||
} else if let &enums::Dim::DimBuffer = dim {
|
} else if let &enums::Dim::DimBuffer = dim {
|
||||||
// We are a texel buffer.
|
// We are a texel buffer.
|
||||||
let desc = format!("DescriptorDescTy::TexelBuffer {{
|
let desc = format!("DescriptorDescTy::TexelBuffer {{
|
||||||
sampled: {},
|
storage: {},
|
||||||
format: None, // TODO: specify format if known
|
format: None, // TODO: specify format if known
|
||||||
}}", sampled);
|
}}", !sampled);
|
||||||
|
|
||||||
Some((desc, true))
|
Some((desc, true))
|
||||||
|
|
||||||
|
@ -48,7 +48,13 @@ pub enum DescriptorDescTy {
|
|||||||
Sampler, // TODO: the sampler has some restrictions as well
|
Sampler, // TODO: the sampler has some restrictions as well
|
||||||
CombinedImageSampler(DescriptorImageDesc), // TODO: the sampler has some restrictions as well
|
CombinedImageSampler(DescriptorImageDesc), // TODO: the sampler has some restrictions as well
|
||||||
Image(DescriptorImageDesc),
|
Image(DescriptorImageDesc),
|
||||||
TexelBuffer { sampled: bool, format: Option<Format> },
|
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<Format>,
|
||||||
|
},
|
||||||
InputAttachment { multisampled: bool, array_layers: DescriptorImageDescArray },
|
InputAttachment { multisampled: bool, array_layers: DescriptorImageDescArray },
|
||||||
Buffer(DescriptorBufferDesc),
|
Buffer(DescriptorBufferDesc),
|
||||||
}
|
}
|
||||||
@ -75,9 +81,9 @@ impl DescriptorDescTy {
|
|||||||
(true, true) => DescriptorType::StorageBufferDynamic,
|
(true, true) => DescriptorType::StorageBufferDynamic,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
DescriptorDescTy::TexelBuffer { sampled, .. } => {
|
DescriptorDescTy::TexelBuffer { storage, .. } => {
|
||||||
if sampled { DescriptorType::UniformTexelBuffer }
|
if storage { DescriptorType::StorageTexelBuffer }
|
||||||
else { DescriptorType::StorageTexelBuffer }
|
else { DescriptorType::UniformTexelBuffer }
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -115,10 +121,10 @@ impl DescriptorDescTy {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
(DescriptorDescTy::TexelBuffer { sampled: me_sampled, format: me_format },
|
(DescriptorDescTy::TexelBuffer { storage: me_storage, format: me_format },
|
||||||
DescriptorDescTy::TexelBuffer { sampled: other_sampled, format: other_format }) =>
|
DescriptorDescTy::TexelBuffer { storage: other_storage, format: other_format }) =>
|
||||||
{
|
{
|
||||||
if me_sampled != other_sampled {
|
if me_storage != other_storage {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user