summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index d071abd84..960ebf1a1 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1845,6 +1845,15 @@ private:
1845 static_assert(!unordered || type == Type::Float); 1845 static_assert(!unordered || type == Type::Float);
1846 1846
1847 const Expression expr = GenerateBinaryInfix(operation, op, Type::Bool, type, type); 1847 const Expression expr = GenerateBinaryInfix(operation, op, Type::Bool, type, type);
1848
1849 if constexpr (op.compare("!=") == 0 && type == Type::Float && !unordered) {
1850 // GLSL's operator!=(float, float) doesn't seem be ordered. This happens on both AMD's
1851 // and Nvidia's proprietary stacks. Manually force an ordered comparison.
1852 return {fmt::format("({} && !isnan({}) && !isnan({}))", expr.AsBool(),
1853 VisitOperand(operation, 0).AsFloat(),
1854 VisitOperand(operation, 1).AsFloat()),
1855 Type::Bool};
1856 }
1848 if constexpr (!unordered) { 1857 if constexpr (!unordered) {
1849 return expr; 1858 return expr;
1850 } 1859 }