From 34b5a1c2f34253a85e1cda2bbdc3a6134485553b Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 10 Jun 2014 22:41:53 +0200 Subject: [PATCH] Disable precision qualifiers on desktop GL --- GPU/GLES/FragmentShaderGenerator.cpp | 9 ++++++--- GPU/GLES/VertexShaderGenerator.cpp | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/GPU/GLES/FragmentShaderGenerator.cpp b/GPU/GLES/FragmentShaderGenerator.cpp index a2b4e2604..8ebd5db08 100644 --- a/GPU/GLES/FragmentShaderGenerator.cpp +++ b/GPU/GLES/FragmentShaderGenerator.cpp @@ -466,6 +466,9 @@ void GenerateFragmentShader(char *buffer) { texture = "texture"; glslES30 = true; WRITE(p, "#version 330\n"); + WRITE(p, "#define lowp\n"); + WRITE(p, "#define mediump\n"); + WRITE(p, "#define highp\n"); } else if (gl_extensions.VersionGEThan(3, 0, 0)) { fragColor0 = "fragColor0"; WRITE(p, "#version 130\n"); @@ -511,7 +514,7 @@ void GenerateFragmentShader(char *buffer) { if (doTexture) WRITE(p, "uniform sampler2D tex;\n"); - if (ShouldUseShaderBlending() && !gstate.isModeClear()) { + if (!gstate.isModeClear() && ShouldUseShaderBlending()) { if (!gl_extensions.NV_shader_framebuffer_fetch) { WRITE(p, "uniform sampler2D fbotex;\n"); } @@ -523,9 +526,9 @@ void GenerateFragmentShader(char *buffer) { } } if (gstate_c.needShaderTexClamp && doTexture) { - WRITE(p, "uniform vec4 u_texclamp;"); + WRITE(p, "uniform vec4 u_texclamp;\n"); if (textureAtOffset) { - WRITE(p, "uniform vec2 u_texclampoff;"); + WRITE(p, "uniform vec2 u_texclampoff;\n"); } } diff --git a/GPU/GLES/VertexShaderGenerator.cpp b/GPU/GLES/VertexShaderGenerator.cpp index 768e6b17a..0cce57188 100644 --- a/GPU/GLES/VertexShaderGenerator.cpp +++ b/GPU/GLES/VertexShaderGenerator.cpp @@ -186,6 +186,9 @@ void GenerateVertexShader(int prim, u32 vertType, char *buffer, bool useHWTransf if (gl_extensions.VersionGEThan(3, 3, 0)) { glslES30 = true; WRITE(p, "#version 330\n"); + WRITE(p, "#define lowp\n"); + WRITE(p, "#define mediump\n"); + WRITE(p, "#define highp\n"); } else if (gl_extensions.VersionGEThan(3, 0, 0)) { WRITE(p, "#version 130\n"); // Remove lowp/mediump in non-mobile non-glsl 3 implementations