From 6ab25b2d01b44149baf4551158398f9357610a60 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 4 Sep 2025 11:39:32 +0100 Subject: [PATCH] Ensure names are added at the end of name section in SPIR-V * The iterator ++ will skip past nops but this could overrun into subsequent sections if they contain only nops (ie. are empty) --- renderdoc/driver/shaders/spirv/spirv_editor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/renderdoc/driver/shaders/spirv/spirv_editor.cpp b/renderdoc/driver/shaders/spirv/spirv_editor.cpp index 988b7fe00..b24b15309 100644 --- a/renderdoc/driver/shaders/spirv/spirv_editor.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_editor.cpp @@ -272,6 +272,9 @@ void Editor::SetName(Id id, const rdcstr &name) break; } + if(End(Section::DebugNames) < it) + it = End(Section::DebugNames); + InsertOperation(op, it.offs()); }