From 57239207a50a1a1e64cf49b33e0b7ade36876865 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 16 Feb 2023 12:53:38 +0000 Subject: [PATCH] Argument values come before function constant values * We start counting value IDs for value-less first instructions (like calls) starting just from the constants, not including arguments --- renderdoc/driver/shaders/dxil/dxil_bytecode_editor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/renderdoc/driver/shaders/dxil/dxil_bytecode_editor.cpp b/renderdoc/driver/shaders/dxil/dxil_bytecode_editor.cpp index 2ec56c73d..bf1037d49 100644 --- a/renderdoc/driver/shaders/dxil/dxil_bytecode_editor.cpp +++ b/renderdoc/driver/shaders/dxil/dxil_bytecode_editor.cpp @@ -928,8 +928,7 @@ bytebuf ProgramEditor::EncodeProgram() bool needMetaAttach = !f->attachedMeta.empty(); - uint32_t lastValidInstId = - uint32_t(accum.firstFuncConst + accum.numFuncConsts + f->args.size()) - 1; + uint32_t lastValidInstId = uint32_t(accum.firstFuncConst + accum.numFuncConsts) - 1; for(const Instruction *inst : f->instructions) {