Merge pull request #6287 from hrydgard/desktop-shader-precision

Disable precision qualifiers on desktop GL
This commit is contained in:
Henrik Rydgård 2014-06-10 23:12:28 +02:00
commit 2a3496b65c
2 changed files with 9 additions and 3 deletions

View File

@ -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");
}
}

View File

@ -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