mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-25 00:04:15 +00:00
Add readonly member to DescriptorDesc
This commit is contained in:
parent
3ade419e1d
commit
0aedde53f1
@ -117,6 +117,7 @@ pub fn write_descriptor_sets(doc: &parse::Spirv) -> String {
|
||||
ty: {desc_ty},
|
||||
array_count: 1,
|
||||
stages: ShaderStages::all(), // TODO:
|
||||
readonly: false, // TODO:
|
||||
}}", binding = d.binding, desc_ty = d.desc_ty)
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
@ -266,6 +266,9 @@ pub struct DescriptorDesc {
|
||||
|
||||
/// Which shader stages are going to access this descriptor.
|
||||
pub stages: ShaderStages,
|
||||
|
||||
/// True if the attachment is only ever read by the shader. False if it is also written.
|
||||
pub readonly: bool,
|
||||
}
|
||||
|
||||
impl DescriptorDesc {
|
||||
@ -276,7 +279,8 @@ impl DescriptorDesc {
|
||||
#[inline]
|
||||
pub fn is_superset_of(&self, other: &DescriptorDesc) -> bool {
|
||||
self.binding == other.binding && self.ty == other.ty &&
|
||||
self.array_count >= other.array_count && self.stages.is_superset_of(&other.stages)
|
||||
self.array_count >= other.array_count && self.stages.is_superset_of(&other.stages) &&
|
||||
(!self.readonly || other.readonly)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -188,6 +188,7 @@ macro_rules! pipeline_layout {
|
||||
ty: <$ty as DescriptorMarker>::descriptor_type(),
|
||||
array_count: 1, // TODO:
|
||||
stages: ShaderStages::all(), // TODO:
|
||||
readonly: false, // TODO:
|
||||
});
|
||||
|
||||
binding += 1;
|
||||
|
Loading…
Reference in New Issue
Block a user