summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-07-17 02:13:15 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:40 +0200
commit56c30dd9e0fec5275ed4d4b4c63bb35049dc000d (patch)
tree278af7edb1b9fe8c698934860f136e9cdbc55849 /src/shader_recompiler
parentglsl: Update TessellationControl gl_in (diff)
downloadyuzu-56c30dd9e0fec5275ed4d4b4c63bb35049dc000d.tar
yuzu-56c30dd9e0fec5275ed4d4b4c63bb35049dc000d.tar.gz
yuzu-56c30dd9e0fec5275ed4d4b4c63bb35049dc000d.tar.bz2
yuzu-56c30dd9e0fec5275ed4d4b4c63bb35049dc000d.tar.lz
yuzu-56c30dd9e0fec5275ed4d4b4c63bb35049dc000d.tar.xz
yuzu-56c30dd9e0fec5275ed4d4b4c63bb35049dc000d.tar.zst
yuzu-56c30dd9e0fec5275ed4d4b4c63bb35049dc000d.zip
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_floating_point.cpp10
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 {
namespace {
void Compare(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, std::string_view rhs,
std::string_view op, bool ordered) {
- ctx.AddU1("{}={}{}{}", inst, lhs, op, rhs, lhs, rhs);
- if (ordered) {
- ctx.Add("&&!isnan({})&&!isnan({});", lhs, rhs);
- } else {
- ctx.Add("||isnan({})||isnan({});", lhs, rhs);
- }
+ const auto nan_op{ordered ? "&&!" : "||"};
+ ctx.AddU1("{}={}{}{}"
+ "{}isnan({}){}isnan({});",
+ inst, lhs, op, rhs, nan_op, lhs, nan_op, rhs);
}
bool IsPrecise(const IR::Inst& inst) {