mesa: Add gl_MESAFogParamsOptimized for our special pre-computed fog params.
authorEric Anholt <eric@anholt.net>
Tue, 23 Nov 2010 23:55:59 +0000 (15:55 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 11 Mar 2011 20:55:14 +0000 (12:55 -0800)
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
src/mesa/main/uniforms.c

index dfc93f39db98311c1809b7b99c4e3820533c7891..9b4f5d9e3ec0f8e86b0d3b51aa12c63504c31444 100644 (file)
@@ -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"},
 };
 
index c31c07517f0e36316ffcc27db2b6bf898d7b901a..1d74efafdf7d9183b15d8f210c7a94f144662a6f 100644 (file)
@@ -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}
 };