Define descriptor set layouts for all pipeline stages

This commit is contained in:
Pierre Krieger 2016-03-12 09:01:40 +01:00
parent 69d6b9025f
commit 090a04f6cd
2 changed files with 14 additions and 1 deletions

View File

@ -134,7 +134,7 @@ pub fn write_descriptor_sets(doc: &parse::Spirv) -> String {
binding: {binding},
ty: {desc_ty},
array_count: 1,
stages: ::vulkano::descriptor_set::ShaderStages::all_graphics(), // TODO:
stages: ::vulkano::descriptor_set::ShaderStages::all(), // TODO:
}}", binding = d.binding, desc_ty = d.desc_ty)
})
.collect::<Vec<_>>();

View File

@ -174,6 +174,19 @@ pub struct ShaderStages {
}
impl ShaderStages {
/// Creates a `ShaderStages` struct will all stages set to `true`.
#[inline]
pub fn all() -> ShaderStages {
ShaderStages {
vertex: true,
tessellation_control: true,
tessellation_evaluation: true,
geometry: true,
fragment: true,
compute: true,
}
}
/// Creates a `ShaderStages` struct will all graphics stages set to `true`.
#[inline]
pub fn all_graphics() -> ShaderStages {