Fix incorrect source operands being used in sample operations

This commit is contained in:
baldurk
2016-09-16 18:36:21 +02:00
parent 2911fb18a2
commit 6ee3644f65
+5 -2
View File
@@ -3950,7 +3950,7 @@ State State::GetNext(GlobalState &global, State quad[4]) const
else if(op.operation == OPCODE_SAMPLE_L)
{
// lod selection
StringFormat::snprintf(buf, 255, "%f", srcOpers[1].value.f.x);
StringFormat::snprintf(buf, 255, "%f", srcOpers[3].value.f.x);
sampleProgram = texture + " : register(t0);\n" + sampler + " : register(s0);\n\n";
sampleProgram += funcRet + " main() : SV_Target0\n{\nreturn ";
@@ -4051,7 +4051,10 @@ State State::GetNext(GlobalState &global, State quad[4]) const
else if(op.operation == OPCODE_GATHER4_C || op.operation == OPCODE_GATHER4_PO_C)
{
// comparison value
StringFormat::snprintf(buf, 255, ", %f", srcOpers[3].value.f.x);
if(op.operation == OPCODE_GATHER4_C)
StringFormat::snprintf(buf, 255, ", %f", srcOpers[3].value.f.x);
else if(op.operation == OPCODE_GATHER4_PO_C)
StringFormat::snprintf(buf, 255, ", %f", srcOpers[4].value.f.x);
sampleProgram = texture + " : register(t0);\n" + sampler + " : register(s0);\n\n";
sampleProgram += funcRet + " main() : SV_Target0\n{\nreturn ";