From 20f7a6f11aef492d5ca13e8ba9525eb2961d483c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 12 Nov 2010 12:04:09 -0800 Subject: mesa: Add a builtin uniform for the ATI_envmap_bumpmap rotation matrix. For fixed function fragment processing in GLSL IR, we want to be able to reference this state value. gl_* not explicitly permitted is reserved, so using this variable name internally shouldn't be any issue. --- src/glsl/builtin_variables.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/glsl/builtin_variables.h') diff --git a/src/glsl/builtin_variables.h b/src/glsl/builtin_variables.h index a34c67e3481..dfc93f39db9 100644 --- a/src/glsl/builtin_variables.h +++ b/src/glsl/builtin_variables.h @@ -101,5 +101,9 @@ static const builtin_variable builtin_110_deprecated_uniforms[] = { { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrixInverseTranspose" }, { ir_var_uniform, -1, "float", "gl_NormalScale" }, { ir_var_uniform, -1, "gl_LightModelParameters", "gl_LightModel"}, + + /* Mesa-internal ATI_envmap_bumpmap state. */ + { ir_var_uniform, -1, "vec2", "gl_MESABumpRotMatrix0"}, + { ir_var_uniform, -1, "vec2", "gl_MESABumpRotMatrix1"}, }; -- cgit v1.2.3 From 29e013e58be93aa6ed760393cf77ef34ca1d57c0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 23 Nov 2010 15:55:59 -0800 Subject: mesa: Add gl_MESAFogParamsOptimized for our special pre-computed fog params. It would be nice if we handled optimized uniform math like this in some generic way, since people often end up doing uniform expressions in shaders, but for now keep this hard-coded like it was in the texenvprogram code. --- src/glsl/builtin_variables.h | 1 + src/mesa/main/uniforms.c | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'src/glsl/builtin_variables.h') diff --git a/src/glsl/builtin_variables.h b/src/glsl/builtin_variables.h index dfc93f39db9..9b4f5d9e3ec 100644 --- a/src/glsl/builtin_variables.h +++ b/src/glsl/builtin_variables.h @@ -105,5 +105,6 @@ static const builtin_variable builtin_110_deprecated_uniforms[] = { /* Mesa-internal ATI_envmap_bumpmap state. */ { ir_var_uniform, -1, "vec2", "gl_MESABumpRotMatrix0"}, { ir_var_uniform, -1, "vec2", "gl_MESABumpRotMatrix1"}, + { ir_var_uniform, -1, "vec4", "gl_MESAFogParamsOptimized"}, }; diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c index c31c07517f0..1d74efafdf7 100644 --- a/src/mesa/main/uniforms.c +++ b/src/mesa/main/uniforms.c @@ -217,6 +217,10 @@ static struct gl_builtin_uniform_element gl_MESABumpRotMatrix1_elements[] = { {NULL, {STATE_INTERNAL, STATE_ROT_MATRIX_1}, SWIZZLE_XYZW}, }; +static struct gl_builtin_uniform_element gl_MESAFogParamsOptimized_elements[] = { + {NULL, {STATE_INTERNAL, STATE_FOG_PARAMS_OPTIMIZED}, SWIZZLE_XYZW}, +}; + #define MATRIX(name, statevar, modifier) \ static struct gl_builtin_uniform_element name ## _elements[] = { \ { NULL, { statevar, 0, 0, 0, modifier}, SWIZZLE_XYZW }, \ @@ -322,6 +326,7 @@ const struct gl_builtin_uniform_desc _mesa_builtin_uniform_desc[] = { STATEVAR(gl_MESABumpRotMatrix0), STATEVAR(gl_MESABumpRotMatrix1), + STATEVAR(gl_MESAFogParamsOptimized), {NULL, NULL, 0} }; -- cgit v1.2.3