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.
This commit is contained in:
Ken Hu
2017-11-30 02:02:04 +09:00
committed by Baldur Karlsson
parent 239184e953
commit b7a67f9731
+6 -2
View File
@@ -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)