Re-fix shader compilation errors
This commit is contained in:
@@ -610,9 +610,10 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
|
|||||||
text[count++] = strdup("#define ATTRIBUTE attribute\n");
|
text[count++] = strdup("#define ATTRIBUTE attribute\n");
|
||||||
text[count++] = strdup("#define VARYING varying\n");
|
text[count++] = strdup("#define VARYING varying\n");
|
||||||
text[count++] = strdup("#define VARYING_FLAT 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)
|
// before any non-preprocessor directives (per spec)
|
||||||
text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n");
|
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)
|
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 ATTRIBUTE attribute\n");
|
||||||
text[count++] = strdup("#define VARYING varying\n");
|
text[count++] = strdup("#define VARYING varying\n");
|
||||||
text[count++] = strdup("#define VARYING_FLAT 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)
|
// before any non-preprocessor directives (per spec)
|
||||||
text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n");
|
text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n");
|
||||||
|
text[count++] = strdup("#extension GL_ARB_shader_texture_lod : enable\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -634,10 +636,11 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
|
|||||||
{
|
{
|
||||||
//set version to 1.30
|
//set version to 1.30
|
||||||
text[count++] = strdup("#version 130\n");
|
text[count++] = strdup("#version 130\n");
|
||||||
|
// Need to enable extensions here instead of in the shader files,
|
||||||
// Need to enable the GL_ARB_texture_rectangle extension here instead of in the shader files,
|
|
||||||
// before any non-preprocessor directives (per spec)
|
// before any non-preprocessor directives (per spec)
|
||||||
text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n");
|
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
|
//some implementations of GLSL 1.30 require integer precision be explicitly declared
|
||||||
text[count++] = strdup("precision mediump int;\n");
|
text[count++] = strdup("precision mediump int;\n");
|
||||||
@@ -646,9 +649,10 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
|
|||||||
else
|
else
|
||||||
{ //set version to 400
|
{ //set version to 400
|
||||||
text[count++] = strdup("#version 400\n");
|
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)
|
// before any non-preprocessor directives (per spec)
|
||||||
text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n");
|
text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n");
|
||||||
|
text[count++] = strdup("#extension GL_ARB_shader_texture_lod : enable\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,8 @@
|
|||||||
* $/LicenseInfo$
|
* $/LicenseInfo$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#extension GL_ARB_texture_rectangle : enable
|
//#extension GL_ARB_texture_rectangle : enable
|
||||||
#extension GL_ARB_shader_texture_lod : enable
|
//#extension GL_ARB_shader_texture_lod : enable
|
||||||
|
|
||||||
#ifdef DEFINE_GL_FRAGCOLOR
|
#ifdef DEFINE_GL_FRAGCOLOR
|
||||||
out vec4 frag_color;
|
out vec4 frag_color;
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ out vec4 frag_color;
|
|||||||
|
|
||||||
//class 1 -- no shadows
|
//class 1 -- no shadows
|
||||||
|
|
||||||
#extension GL_ARB_texture_rectangle : enable
|
//#extension GL_ARB_texture_rectangle : enable
|
||||||
#extension GL_ARB_shader_texture_lod : enable
|
//#extension GL_ARB_shader_texture_lod : enable
|
||||||
|
|
||||||
uniform sampler2DRect diffuseRect;
|
uniform sampler2DRect diffuseRect;
|
||||||
uniform sampler2DRect specularRect;
|
uniform sampler2DRect specularRect;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
* $/LicenseInfo$
|
* $/LicenseInfo$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#extension GL_ARB_texture_rectangle : enable
|
//#extension GL_ARB_texture_rectangle : enable
|
||||||
|
|
||||||
#ifdef DEFINE_GL_FRAGCOLOR
|
#ifdef DEFINE_GL_FRAGCOLOR
|
||||||
out vec4 frag_color;
|
out vec4 frag_color;
|
||||||
|
|||||||
@@ -23,8 +23,8 @@
|
|||||||
* $/LicenseInfo$
|
* $/LicenseInfo$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#extension GL_ARB_texture_rectangle : enable
|
//#extension GL_ARB_texture_rectangle : enable
|
||||||
#extension GL_ARB_shader_texture_lod : enable
|
//#extension GL_ARB_shader_texture_lod : enable
|
||||||
|
|
||||||
#ifdef DEFINE_GL_FRAGCOLOR
|
#ifdef DEFINE_GL_FRAGCOLOR
|
||||||
out vec4 frag_color;
|
out vec4 frag_color;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
* $/LicenseInfo$
|
* $/LicenseInfo$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#extension GL_ARB_texture_rectangle : enable
|
//#extension GL_ARB_texture_rectangle : enable
|
||||||
|
|
||||||
#ifdef DEFINE_GL_FRAGCOLOR
|
#ifdef DEFINE_GL_FRAGCOLOR
|
||||||
out vec4 frag_color;
|
out vec4 frag_color;
|
||||||
|
|||||||
@@ -23,8 +23,8 @@
|
|||||||
* $/LicenseInfo$
|
* $/LicenseInfo$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#extension GL_ARB_texture_rectangle : enable
|
//#extension GL_ARB_texture_rectangle : enable
|
||||||
#extension GL_ARB_shader_texture_lod : enable
|
//#extension GL_ARB_shader_texture_lod : enable
|
||||||
|
|
||||||
#ifdef DEFINE_GL_FRAGCOLOR
|
#ifdef DEFINE_GL_FRAGCOLOR
|
||||||
out vec4 frag_color;
|
out vec4 frag_color;
|
||||||
|
|||||||
@@ -23,8 +23,8 @@
|
|||||||
* $/LicenseInfo$
|
* $/LicenseInfo$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#extension GL_ARB_texture_rectangle : enable
|
//#extension GL_ARB_texture_rectangle : enable
|
||||||
#extension GL_ARB_shader_texture_lod : enable
|
//#extension GL_ARB_shader_texture_lod : enable
|
||||||
|
|
||||||
#ifdef DEFINE_GL_FRAGCOLOR
|
#ifdef DEFINE_GL_FRAGCOLOR
|
||||||
out vec4 frag_color;
|
out vec4 frag_color;
|
||||||
|
|||||||
Reference in New Issue
Block a user