diff options
| author | 2021-07-16 20:13:15 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:40 -0400 | |
| commit | 56c30dd9e0fec5275ed4d4b4c63bb35049dc000d (patch) | |
| tree | 278af7edb1b9fe8c698934860f136e9cdbc55849 | |
| parent | glsl: Update TessellationControl gl_in (diff) | |
| download | yuzu-56c30dd9e0fec5275ed4d4b4c63bb35049dc000d.tar.gz yuzu-56c30dd9e0fec5275ed4d4b4c63bb35049dc000d.tar.xz yuzu-56c30dd9e0fec5275ed4d4b4c63bb35049dc000d.zip | |
glsl: Simplify FCMP emission
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_glsl_floating_point.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_floating_point.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_floating_point.cpp index 2edcf592e..d423bfb1b 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_floating_point.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl_floating_point.cpp | |||
| @@ -13,12 +13,10 @@ namespace Shader::Backend::GLSL { | |||
| 13 | namespace { | 13 | namespace { |
| 14 | void Compare(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, std::string_view rhs, | 14 | void Compare(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, std::string_view rhs, |
| 15 | std::string_view op, bool ordered) { | 15 | std::string_view op, bool ordered) { |
| 16 | ctx.AddU1("{}={}{}{}", inst, lhs, op, rhs, lhs, rhs); | 16 | const auto nan_op{ordered ? "&&!" : "||"}; |
| 17 | if (ordered) { | 17 | ctx.AddU1("{}={}{}{}" |
| 18 | ctx.Add("&&!isnan({})&&!isnan({});", lhs, rhs); | 18 | "{}isnan({}){}isnan({});", |
| 19 | } else { | 19 | inst, lhs, op, rhs, nan_op, lhs, nan_op, rhs); |
| 20 | ctx.Add("||isnan({})||isnan({});", lhs, rhs); | ||
| 21 | } | ||
| 22 | } | 20 | } |
| 23 | 21 | ||
| 24 | bool IsPrecise(const IR::Inst& inst) { | 22 | bool IsPrecise(const IR::Inst& inst) { |