From 92c7bb9d20c0d33cf579f36093c90d49af7394ca Mon Sep 17 00:00:00 2001 From: wwylele Date: Wed, 7 Mar 2018 14:27:44 +0200 Subject: [PATCH] pica/gl_shader: optimize ternary operator --- src/video_core/renderer_opengl/gl_shader_gen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index 552de0aeed..9e9d307aec 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -688,7 +688,7 @@ static void WriteLighting(std::string& out, const PicaShaderConfig& config) { // If enabled, clamp specular component if lighting result is zero if (lighting.clamp_highlights) { - out += "clamp_highlights = dot_product == 0.0 ? 0.0 : 1.0;\n"; + out += "clamp_highlights = sign(dot_product);\n"; } // If enabled, compute spot light attenuation value