More fixes in limits_check (#773)

This commit is contained in:
tomaka 2017-08-25 11:48:13 +02:00 committed by GitHub
parent 2f9c9ff6b0
commit 1640220ebf
2 changed files with 13 additions and 7 deletions

View File

@ -124,11 +124,11 @@ pub fn write_descriptor_sets(doc: &parse::Spirv) -> String {
let num_bindings_in_set_body = {
(0 .. num_sets)
.map(|set| {
let num = 1 +
descriptors
let num =
descriptors
.iter()
.filter(|d| d.set == set)
.fold(0, |s, d| cmp::max(s, d.binding));
.fold(0, |s, d| cmp::max(s, 1 + d.binding));
format!("{set} => Some({num}),", set = set, num = num)
})
.collect::<Vec<_>>()

View File

@ -34,11 +34,17 @@ pub fn check_desc_against_limits<D>(device: &Device, desc: &D)
let mut num_input_attachments = Counter::default();
for set in 0 .. desc.num_sets() {
let num_bindings_in_set = desc.num_bindings_in_set(set)
.expect("Wrong implementation of PipelineLayoutDesc");
let num_bindings_in_set = match desc.num_bindings_in_set(set) {
None => continue,
Some(n) => n,
};
for binding in 0 .. num_bindings_in_set {
let descriptor = desc.descriptor(set, binding)
.expect("Wrong implementation of PipelineLayoutDesc");
let descriptor = match desc.descriptor(set, binding) {
None => continue,
Some(n) => n,
};
num_resources.increment(descriptor.array_count, &descriptor.stages);
match descriptor.ty.ty().expect("Not implemented yet") { // TODO: