Skip to content

Commit ecdbfc9

Browse files
silvesthubaldurk
authored andcommitted
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.
1 parent c1c94d1 commit ecdbfc9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

renderdoc/driver/shaders/dxbc/dxbc_debug.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4037,8 +4037,12 @@ State State::GetNext(GlobalState &global, State quad[4]) const
40374037
UINT texSlot = (UINT)op.operands[2].indices[0].index;
40384038
UINT sampSlot = 0;
40394039

4040-
if(op.operands.size() >= 4 && !op.operands[3].indices.empty())
4041-
sampSlot = (UINT)op.operands[3].indices[0].index;
4040+
for(size_t i = 0; i < op.operands.size(); i++)
4041+
{
4042+
const ASMOperand &operand = op.operands[i];
4043+
if(operand.type == OperandType::TYPE_SAMPLER)
4044+
sampSlot = (UINT)operand.indices[0].index;
4045+
}
40424046

40434047
if(op.operation == OPCODE_SAMPLE || op.operation == OPCODE_SAMPLE_B ||
40444048
op.operation == OPCODE_SAMPLE_D)

0 commit comments

Comments
 (0)