aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2016-08-22 15:31:18 +1200
committerChris Forbes <chrisforbes@google.com>2016-08-23 13:12:40 +1200
commit8d20a9eda947c8b1fb8b3cf3a5277b0c8d960260 (patch)
treefc38ea7183d03ebea10264a31231c2280806e5c3 /layers/core_validation.cpp
parent9a2addb243bfcd18f23cb1c615906de77784ad98 (diff)
downloadusermoji-8d20a9eda947c8b1fb8b3cf3a5277b0c8d960260.tar.xz
layers: Correctly handle input attachment collection w/ arrays
Fixes the test added in the previous commit Signed-off-by: Chris Forbes <chrisforbes@google.com>
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index cf772cf3..80e05490 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -1565,16 +1565,16 @@ static void collect_interface_by_input_attachment_index(debug_report_data *repor
assert(def != src->end());
if (def.opcode() == spv::OpVariable && insn.word(3) == spv::StorageClassUniformConstant) {
- /* TODO: arrays of input attachments: the descriptor
- * side only consumes one binding, but each array
- * element will consume an additional attachment index */
- interface_var v;
- v.id = id;
- v.type_id = def.word(1);
- v.offset = 0;
- v.is_patch = false;
- v.is_block_member = false;
- out.emplace_back(attachment_index, v);
+ auto num_locations = get_locations_consumed_by_type(src, def.word(1), false);
+ for (unsigned int offset = 0; offset < num_locations; offset++) {
+ interface_var v;
+ v.id = id;
+ v.type_id = def.word(1);
+ v.offset = offset;
+ v.is_patch = false;
+ v.is_block_member = false;
+ out.emplace_back(attachment_index + offset, v);
+ }
}
}
}