From a7e9a6028016f24827df36e26b36bc2d424dea32 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 3 Jun 2024 13:10:08 +0100 Subject: [PATCH] When patching mesh shaders only consider globals for its entry point * For shaders with multiple entry points we can't process outputs for other entry points that may not be arrayed. --- renderdoc/driver/vulkan/vk_postvs.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/renderdoc/driver/vulkan/vk_postvs.cpp b/renderdoc/driver/vulkan/vk_postvs.cpp index dde43b433..8705b8f29 100644 --- a/renderdoc/driver/vulkan/vk_postvs.cpp +++ b/renderdoc/driver/vulkan/vk_postvs.cpp @@ -2222,11 +2222,15 @@ static void AddMeshShaderOutputStores(const ShaderReflection &refl, } rdcspv::Id entryID; + rdcarray entryInterface; for(const rdcspv::EntryPoint &entry : editor.GetEntries()) { if(entry.name == entryName && entry.executionModel == rdcspv::ExecutionModel::MeshEXT) + { entryID = entry.id; + entryInterface = entry.usedIds; + } } RDCASSERT(entryID); @@ -2308,6 +2312,10 @@ static void AddMeshShaderOutputStores(const ShaderReflection &refl, if(var.storage != rdcspv::StorageClass::Output) continue; + // skip variables that aren't for us + if(!entryInterface.contains(var.id)) + continue; + const rdcspv::Decorations &d = editor.GetDecorations(var.id); // global variables are all pointers const rdcspv::DataType &pointerType = editor.GetDataType(editor.GetIDType(var.id));