From 08825a0bf8f84d255aad27bae5204f8cd0650d26 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 22 Mar 2021 17:34:41 +0000 Subject: [PATCH] Handle a couple of other instructions for type replacements in postvs --- renderdoc/driver/vulkan/vk_postvs.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/vulkan/vk_postvs.cpp b/renderdoc/driver/vulkan/vk_postvs.cpp index 91e01ce97..92bed08e2 100644 --- a/renderdoc/driver/vulkan/vk_postvs.cpp +++ b/renderdoc/driver/vulkan/vk_postvs.cpp @@ -407,6 +407,19 @@ static void ConvertToMeshOutputCompute(const ShaderReflection &refl, const SPIRV editor.PostModify(it); } } + else if(it.opcode() == rdcspv::Op::Undef) + { + rdcspv::OpUndef undef(it); + + auto replIt = typeReplacements.find(undef.resultType); + if(replIt != typeReplacements.end()) + { + editor.PreModify(it); + undef.resultType = replIt->second; + it = undef; + editor.PostModify(it); + } + } } for(rdcspv::Iter it = editor.Begin(rdcspv::Section::Functions); it; ++it) @@ -416,7 +429,8 @@ static void ConvertToMeshOutputCompute(const ShaderReflection &refl, const SPIRV it.opcode() == rdcspv::Op::Variable || it.opcode() == rdcspv::Op::AccessChain || it.opcode() == rdcspv::Op::InBoundsAccessChain || it.opcode() == rdcspv::Op::Bitcast || it.opcode() == rdcspv::Op::Undef || it.opcode() == rdcspv::Op::ExtInst || - it.opcode() == rdcspv::Op::FunctionCall || it.opcode() == rdcspv::Op::Phi) + it.opcode() == rdcspv::Op::FunctionCall || it.opcode() == rdcspv::Op::Phi || + it.opcode() == rdcspv::Op::Select) { editor.PreModify(it);