Re-fix shader compilation errors

This commit is contained in:
Andros Baphomet
2013-11-03 13:12:27 -05:00
parent fe0a761ce6
commit 997fdebb9f
8 changed files with 21 additions and 17 deletions

View File

@@ -610,9 +610,10 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
text[count++] = strdup("#define ATTRIBUTE attribute\n");
text[count++] = strdup("#define VARYING varying\n");
text[count++] = strdup("#define VARYING_FLAT varying\n");
// Need to enable the GL_ARB_texture_rectangle extension here instead of in the shader files,
// Need to enable extensions here instead of in the shader files,
// before any non-preprocessor directives (per spec)
text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n");
text[count++] = strdup("#extension GL_ARB_shader_texture_lod : enable\n");
}
else if (minor_version <= 29)
{
@@ -623,9 +624,10 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
text[count++] = strdup("#define ATTRIBUTE attribute\n");
text[count++] = strdup("#define VARYING varying\n");
text[count++] = strdup("#define VARYING_FLAT varying\n");
// Need to enable the GL_ARB_texture_rectangle extension here instead of in the shader files,
// Need to enable extensions here instead of in the shader files,
// before any non-preprocessor directives (per spec)
text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n");
text[count++] = strdup("#extension GL_ARB_shader_texture_lod : enable\n");
}
}
else
@@ -634,10 +636,11 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
{
//set version to 1.30
text[count++] = strdup("#version 130\n");
// Need to enable the GL_ARB_texture_rectangle extension here instead of in the shader files,
// Need to enable extensions here instead of in the shader files,
// before any non-preprocessor directives (per spec)
text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n");
text[count++] = strdup("#extension GL_ARB_shader_texture_lod : enable\n");
//some implementations of GLSL 1.30 require integer precision be explicitly declared
text[count++] = strdup("precision mediump int;\n");
@@ -646,9 +649,10 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
else
{ //set version to 400
text[count++] = strdup("#version 400\n");
// Need to enable the GL_ARB_texture_rectangle extension here instead of in the shader files,
// Need to enable extensions here instead of in the shader files,
// before any non-preprocessor directives (per spec)
text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n");
text[count++] = strdup("#extension GL_ARB_shader_texture_lod : enable\n");
}

View File

@@ -23,8 +23,8 @@
* $/LicenseInfo$
*/
#extension GL_ARB_texture_rectangle : enable
#extension GL_ARB_shader_texture_lod : enable
//#extension GL_ARB_texture_rectangle : enable
//#extension GL_ARB_shader_texture_lod : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;

View File

@@ -31,8 +31,8 @@ out vec4 frag_color;
//class 1 -- no shadows
#extension GL_ARB_texture_rectangle : enable
#extension GL_ARB_shader_texture_lod : enable
//#extension GL_ARB_texture_rectangle : enable
//#extension GL_ARB_shader_texture_lod : enable
uniform sampler2DRect diffuseRect;
uniform sampler2DRect specularRect;

View File

@@ -23,7 +23,7 @@
* $/LicenseInfo$
*/
#extension GL_ARB_texture_rectangle : enable
//#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;

View File

@@ -23,8 +23,8 @@
* $/LicenseInfo$
*/
#extension GL_ARB_texture_rectangle : enable
#extension GL_ARB_shader_texture_lod : enable
//#extension GL_ARB_texture_rectangle : enable
//#extension GL_ARB_shader_texture_lod : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;

View File

@@ -23,7 +23,7 @@
* $/LicenseInfo$
*/
#extension GL_ARB_texture_rectangle : enable
//#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;

View File

@@ -23,8 +23,8 @@
* $/LicenseInfo$
*/
#extension GL_ARB_texture_rectangle : enable
#extension GL_ARB_shader_texture_lod : enable
//#extension GL_ARB_texture_rectangle : enable
//#extension GL_ARB_shader_texture_lod : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;

View File

@@ -23,8 +23,8 @@
* $/LicenseInfo$
*/
#extension GL_ARB_texture_rectangle : enable
#extension GL_ARB_shader_texture_lod : enable
//#extension GL_ARB_texture_rectangle : enable
//#extension GL_ARB_shader_texture_lod : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;