diff --git a/vulkano/src/descriptor/descriptor_set/simple.rs b/vulkano/src/descriptor/descriptor_set/simple.rs index 72a36562..2a545cfe 100644 --- a/vulkano/src/descriptor/descriptor_set/simple.rs +++ b/vulkano/src/descriptor/descriptor_set/simple.rs @@ -137,10 +137,12 @@ impl SimpleDescriptorSetBuilder where L: PipelineLayoutRef { pub fn new(layout: L, set_id: usize) -> SimpleDescriptorSetBuilder { assert!(layout.desc().num_sets() > set_id); + let cap = layout.desc().num_bindings_in_set(set_id).unwrap_or(0); + SimpleDescriptorSetBuilder { layout: layout, set_id: set_id, - writes: Vec::with_capacity(layout.desc().num_bindings_in_set(set_id).unwrap_or(0)), + writes: Vec::with_capacity(cap), resources: (), } }