From b7a67f9731b32707b0149fdd0518851fdc027305 Mon Sep 17 00:00:00 2001 From: Ken Hu Date: Thu, 30 Nov 2017 02:02:04 +0900 Subject: [PATCH] Fix sampler slot extraction on gather4_po_c when debugging dxbc shader gather4_po_c has 6 operands and offset of sampler should be 4 instead of 3. --- renderdoc/driver/shaders/dxbc/dxbc_debug.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp index e21bcfad9..9dedf5b8d 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp @@ -4049,8 +4049,12 @@ State State::GetNext(GlobalState &global, State quad[4]) const UINT texSlot = (UINT)op.operands[2].indices[0].index; UINT sampSlot = 0; - if(op.operands.size() >= 4 && !op.operands[3].indices.empty()) - sampSlot = (UINT)op.operands[3].indices[0].index; + for(size_t i = 0; i < op.operands.size(); i++) + { + const ASMOperand &operand = op.operands[i]; + if(operand.type == OperandType::TYPE_SAMPLER) + sampSlot = (UINT)operand.indices[0].index; + } if(op.operation == OPCODE_SAMPLE || op.operation == OPCODE_SAMPLE_B || op.operation == OPCODE_SAMPLE_D)