From 2933521a08f483d3de80f455326e6f7eb5d3cbae Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 4 Jun 2018 11:58:29 -0500 Subject: [PATCH] GPU: Use the bf bit in FSET to determine whether to write 0xFFFFFFFF or 1.0f. --- src/video_core/engines/shader_bytecode.h | 2 +- src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index da64430e9..77c8399f1 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h @@ -245,9 +245,9 @@ union Instruction { BitField<44, 1, u64> abs_b; BitField<45, 2, PredOperation> op; BitField<48, 4, PredCondition> cond; + BitField<52, 1, u64> bf; BitField<53, 1, u64> neg_b; BitField<54, 1, u64> abs_a; - BitField<52, 1, u64> bf; BitField<55, 1, u64> ftz; BitField<56, 1, u64> neg_imm; } fset; diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index ffb89e4f4..39cb022fe 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -1066,7 +1066,12 @@ private: std::string predicate = "(((" + op_a + ") " + comparator + " (" + op_b + ")) " + combiner + " (" + second_pred + "))"; - regs.SetRegisterToFloat(instr.gpr0, 0, predicate + " ? 1.0 : 0.0", 1, 1); + if (instr.fset.bf) { + regs.SetRegisterToFloat(instr.gpr0, 0, predicate + " ? 1.0 : 0.0", 1, 1); + } else { + regs.SetRegisterToInteger(instr.gpr0, false, 0, predicate + " ? 0xFFFFFFFF : 0", 1, + 1); + } break; } default: {