From d516805782ac279e934ebf03dedb58ad6fab50ae Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 19 Jul 2016 15:08:38 +1200 Subject: layers: Relax SC descriptor binding uniqueness to allow split variables This allows the separate sampler & image variables case from 13.1.4 to work correctly. Signed-off-by: Chris Forbes --- layers/core_validation.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index edfb6273..6f4d0c92 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -1534,7 +1534,7 @@ static void collect_interface_by_location(shader_module const *src, spirv_inst_i static void collect_interface_by_descriptor_slot(debug_report_data *report_data, shader_module const *src, std::unordered_set const &accessible_ids, - std::map &out) { + std::vector> &out) { std::unordered_map var_sets; std::unordered_map var_bindings; @@ -1563,23 +1563,13 @@ static void collect_interface_by_descriptor_slot(debug_report_data *report_data, unsigned set = value_or_default(var_sets, insn.word(2), 0); unsigned binding = value_or_default(var_bindings, insn.word(2), 0); - auto existing_it = out.find(std::make_pair(set, binding)); - if (existing_it != out.end()) { - /* conflict within spv image */ - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, - __LINE__, SHADER_CHECKER_INCONSISTENT_SPIRV, "SC", - "var %d (type %d) in %s interface in descriptor slot (%u,%u) conflicts with existing definition", - insn.word(2), insn.word(1), storage_class_name(insn.word(3)), existing_it->first.first, - existing_it->first.second); - } - interface_var v; v.id = insn.word(2); v.type_id = insn.word(1); v.offset = 0; v.is_patch = false; v.is_block_member = false; - out[std::make_pair(set, binding)] = v; + out.emplace_back(std::make_pair(set, binding), v); } } } @@ -2645,7 +2635,7 @@ static bool validate_pipeline_shader_stage(debug_report_data *report_data, mark_accessible_ids(module, entrypoint, accessible_ids); /* validate descriptor set layout against what the entrypoint actually uses */ - std::map descriptor_uses; + std::vector> descriptor_uses; collect_interface_by_descriptor_slot(report_data, module, accessible_ids, descriptor_uses); auto pipelineLayout = pipeline->pipeline_layout; -- cgit v1.2.3