From 3710c6110d65d3a604f7b419cd764cf5b9b98600 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 10 Feb 2012 20:04:19 -0600 Subject: SH-2908 Rework indexed texture rendering to use a uvec4 instead of a float for texture indices in the data stream. Also rework gl_FragColor overrides to not collide with some odd driver implementations. --- indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl | 6 ++++-- .../newview/app_settings/shaders/class1/interface/customalphaF.glsl | 6 ++++-- indra/newview/app_settings/shaders/class1/interface/debugF.glsl | 6 ++++-- .../newview/app_settings/shaders/class1/interface/glowcombineF.glsl | 6 ++++-- .../app_settings/shaders/class1/interface/glowcombineFXAAF.glsl | 6 ++++-- indra/newview/app_settings/shaders/class1/interface/highlightF.glsl | 6 ++++-- indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl | 6 ++++-- .../app_settings/shaders/class1/interface/onetexturenocolorF.glsl | 6 ++++-- .../newview/app_settings/shaders/class1/interface/solidcolorF.glsl | 6 ++++-- .../app_settings/shaders/class1/interface/splattexturerectF.glsl | 6 ++++-- .../app_settings/shaders/class1/interface/twotextureaddF.glsl | 6 ++++-- indra/newview/app_settings/shaders/class1/interface/uiF.glsl | 6 ++++-- 12 files changed, 48 insertions(+), 24 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/interface') diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl index d2f5e1987a..e8b8513bd1 100644 --- a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D diffuseMap; @@ -42,5 +44,5 @@ void main() discard; } - gl_FragColor = col; + frag_color = col; } diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl index 4b481ba834..b990ce9f03 100644 --- a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D diffuseMap; @@ -38,5 +40,5 @@ void main() { vec4 color = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy); color.a *= custom_alpha; - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl index 6bcc97ba18..ad05f17a30 100644 --- a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl @@ -24,12 +24,14 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform vec4 color; void main() { - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl index f67703b839..7e4515db40 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif #extension GL_ARB_texture_rectangle : enable @@ -37,6 +39,6 @@ VARYING vec2 vary_texcoord1; void main() { - gl_FragColor = texture2D(glowMap, vary_texcoord0.xy) + + frag_color = texture2D(glowMap, vary_texcoord0.xy) + texture2DRect(screenMap, vary_texcoord1.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl index c66a6e5b48..5a5894523d 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect diffuseRect; @@ -38,5 +40,5 @@ void main() { vec3 col = texture2DRect(diffuseRect, vary_tc*screen_res).rgb; - gl_FragColor = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144))); + frag_color = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144))); } diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl index ecbc30f05f..d1d140d2a6 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform vec4 color; @@ -34,5 +36,5 @@ VARYING vec2 vary_texcoord0; void main() { - gl_FragColor = color*texture2D(diffuseMap, vary_texcoord0.xy); + frag_color = color*texture2D(diffuseMap, vary_texcoord0.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl index 85f819f4c2..a18a3cdb50 100644 --- a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl @@ -24,10 +24,12 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif void main() { - gl_FragColor = vec4(1,1,1,1); + frag_color = vec4(1,1,1,1); } diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl index fafeb5a7b4..bfaa4774d9 100644 --- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D tex0; @@ -33,5 +35,5 @@ VARYING vec2 vary_texcoord0; void main() { - gl_FragColor = texture2D(tex0, vary_texcoord0.xy); + frag_color = texture2D(tex0, vary_texcoord0.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl index f790122749..5d7edf33a9 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D tex0; @@ -36,5 +38,5 @@ void main() { float alpha = texture2D(tex0, vary_texcoord0.xy).a * vertex_color.a; - gl_FragColor = vec4(vertex_color.rgb, alpha); + frag_color = vec4(vertex_color.rgb, alpha); } diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl index a0bb255cfa..7a28ca847a 100644 --- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect screenMap; @@ -36,5 +38,5 @@ VARYING vec2 vary_texcoord0; void main() { - gl_FragColor = texture2DRect(screenMap, vary_texcoord0.xy) * vertex_color; + frag_color = texture2DRect(screenMap, vary_texcoord0.xy) * vertex_color; } diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl index cdb48163dd..73a5839028 100644 --- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D tex0; @@ -35,5 +37,5 @@ VARYING vec2 vary_texcoord1; void main() { - gl_FragColor = texture2D(tex0, vary_texcoord0.xy)+texture2D(tex1, vary_texcoord1.xy); + frag_color = texture2D(tex0, vary_texcoord0.xy)+texture2D(tex1, vary_texcoord1.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl index 36d6e06fc5..8fac2862b1 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D diffuseMap; @@ -34,5 +36,5 @@ VARYING vec4 vertex_color; void main() { - gl_FragColor = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy); + frag_color = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy); } -- cgit v1.2.3 From 60fa5c3d4e23967d1ecd1e5189685ca94223cfb4 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 13 Feb 2012 19:53:39 -0600 Subject: SH-2908 Fix for shaders failing to compile when using GLSL 1.20 or 1.10 profile. --- indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/debugF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl | 2 +- .../newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/highlightF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl | 2 +- .../app_settings/shaders/class1/interface/onetexturenocolorF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl | 2 +- .../app_settings/shaders/class1/interface/splattexturerectF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/uiF.glsl | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/interface') diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl index e8b8513bd1..f520f301d9 100644 --- a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl index b990ce9f03..a96d04cc39 100644 --- a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl index ad05f17a30..67c6baddbb 100644 --- a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform vec4 color; diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl index 7e4515db40..ed803de277 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl index 5a5894523d..59520bb99f 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect diffuseRect; diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl index d1d140d2a6..6cc9bbbea2 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform vec4 color; diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl index a18a3cdb50..db130e456c 100644 --- a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif void main() diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl index bfaa4774d9..415181126b 100644 --- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D tex0; diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl index 5d7edf33a9..67dc500493 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D tex0; diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl index 7a28ca847a..772bb374e8 100644 --- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect screenMap; diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl index 73a5839028..95679e93e7 100644 --- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D tex0; diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl index 8fac2862b1..299bfb72aa 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D diffuseMap; -- cgit v1.2.3