From 615bb9ecadac2822b1701c6aa827f16d41f16a7d Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 12 Apr 2019 16:51:22 +0100 Subject: [PATCH] Remove all elements in the signature array that match not just the first * For gl_ClipDistance etc there could be many entries with the same builtin --- renderdoc/driver/shaders/spirv/spirv_disassemble.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp b/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp index 04d5bbd71..965dad80a 100644 --- a/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp @@ -4338,8 +4338,9 @@ void SPVModule::MakeReflection(GraphicsAPI sourceAPI, ShaderStage stage, const s { ShaderBuiltin attr = BuiltInToSystemAttribute(stage, checkBuiltin); - // find this builtin in the array, and remove - for(size_t s = 0; s < sigarray->size(); s++) + // find this builtin in the array, and remove. There might be multiple entries for + // arrays like gl_ClipDistance + for(size_t s = 0; s < sigarray->size();) { if((*sigarray)[s].systemValue == attr) { @@ -4348,7 +4349,10 @@ void SPVModule::MakeReflection(GraphicsAPI sourceAPI, ShaderStage stage, const s patchData.inputs.erase(patchData.inputs.begin() + s); else patchData.outputs.erase(patchData.outputs.begin() + s); - break; + } + else + { + s++; } } }