mesa: Add a builtin uniform for the ATI_envmap_bumpmap rotation matrix.
authorEric Anholt <eric@anholt.net>
Fri, 12 Nov 2010 20:04:09 +0000 (12:04 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 11 Mar 2011 20:55:14 +0000 (12:55 -0800)
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
src/mesa/main/uniforms.c

index a34c67e3481cf1fadaec060d3796568f6adeeb2a..dfc93f39db98311c1809b7b99c4e3820533c7891 100644 (file)
@@ -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"},
 };
 
index eb289722d1ac36d2aae34d2ecf93b675a01efa98..c31c07517f0e36316ffcc27db2b6bf898d7b901a 100644 (file)
@@ -209,6 +209,14 @@ static struct gl_builtin_uniform_element gl_NormalScale_elements[] = {
    {NULL, {STATE_NORMAL_SCALE}, SWIZZLE_XXXX},
 };
 
+static struct gl_builtin_uniform_element gl_MESABumpRotMatrix0_elements[] = {
+   {NULL, {STATE_INTERNAL, STATE_ROT_MATRIX_0}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_MESABumpRotMatrix1_elements[] = {
+   {NULL, {STATE_INTERNAL, STATE_ROT_MATRIX_1}, SWIZZLE_XYZW},
+};
+
 #define MATRIX(name, statevar, modifier)                               \
    static struct gl_builtin_uniform_element name ## _elements[] = {    \
       { NULL, { statevar, 0, 0, 0, modifier}, SWIZZLE_XYZW },          \
@@ -312,6 +320,9 @@ const struct gl_builtin_uniform_desc _mesa_builtin_uniform_desc[] = {
    STATEVAR(gl_NormalMatrix),
    STATEVAR(gl_NormalScale),
 
+   STATEVAR(gl_MESABumpRotMatrix0),
+   STATEVAR(gl_MESABumpRotMatrix1),
+
    {NULL, NULL, 0}
 };