Add definitions for 1.10 built-in uniforms for ff state.
authorEric Anholt <eric@anholt.net>
Sun, 28 Mar 2010 08:46:48 +0000 (01:46 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 29 Mar 2010 19:48:45 +0000 (12:48 -0700)
builtin_variables.h
ir_variable.cpp

index a742a1562d233f52b20d25d99316d5df82a598a7..902ff22e8aea59ab8746590bdce07e2f9131a177 100644 (file)
@@ -70,3 +70,21 @@ static const builtin_variable builtin_110_deprecated_vs_variables[] = {
 static const builtin_variable builtin_130_vs_variables[] = {
    { ir_var_in,  "int",   "gl_VertexID" },
 };
+
+static const builtin_variable builtin_110_deprecated_uniforms[] = {
+   { ir_var_uniform, "mat4", "gl_ModelViewMatrix" },
+   { ir_var_uniform, "mat4", "gl_ProjectionMatrix" },
+   { ir_var_uniform, "mat4", "gl_ModelViewProjectionMatrix" },
+   { ir_var_uniform, "mat3", "gl_NormalMatrix" },
+   { ir_var_uniform, "mat4", "gl_ModelViewMatrixInverse" },
+   { ir_var_uniform, "mat4", "gl_ProjectionMatrixInverse" },
+   { ir_var_uniform, "mat4", "gl_ModelViewProjectionMatrixInverse" },
+   { ir_var_uniform, "mat4", "gl_ModelViewMatrixTranspose" },
+   { ir_var_uniform, "mat4", "gl_ProjectionMatrixTranspose" },
+   { ir_var_uniform, "mat4", "gl_ModelViewProjectionMatrixTranspose" },
+   { ir_var_uniform, "mat4", "gl_ModelViewMatrixInverseTranspose" },
+   { ir_var_uniform, "mat4", "gl_ProjectionMatrixInverseTranspose" },
+   { ir_var_uniform, "mat4", "gl_ModelViewProjectionMatrixInverseTranspose" },
+   { ir_var_uniform, "float", "gl_NormalScale" },
+};
+
index df8e4c3ba829e8085c040fbae88260038dac3958..1b4b742ac4c875b3546d29d6762e09f657812a82 100644 (file)
@@ -56,6 +56,37 @@ add_builtin_variable(const builtin_variable *proto, exec_list *instructions,
    symtab->add_variable(var->name, var);
 }
 
+static void
+generate_110_uniforms(exec_list *instructions,
+                     glsl_symbol_table *symtab)
+{
+   for (unsigned i = 0
+          ; i < Elements(builtin_110_deprecated_uniforms)
+          ; i++) {
+      add_builtin_variable(& builtin_110_deprecated_uniforms[i],
+                          instructions, symtab);
+   }
+
+   /* FINISHME: Add support for gl_TextureMatrix[].  The size of this array is
+    * FINISHME: implementation dependent based on the value of
+    * FINISHME: GL_MAX_TEXTURE_COORDS.
+    */
+
+   /* FINISHME: Add support for gl_DepthRangeParameters */
+   /* FINISHME: Add support for gl_ClipPlane[] */
+   /* FINISHME: Add support for gl_PointParameters */
+
+   /* FINISHME: Add support for gl_MaterialParameters
+    * FINISHME: (glFrontMaterial, glBackMaterial)
+    */
+
+   /* FINISHME: Add support for gl_LightSource[] */
+   /* FINISHME: Add support for gl_LightModel */
+   /* FINISHME: Add support for gl_FrontLightProduct[], gl_BackLightProduct[] */
+   /* FINISHME: Add support for gl_TextureEnvColor[] */
+   /* FINISHME: Add support for gl_ObjectPlane*[], gl_EyePlane*[] */
+   /* FINISHME: Add support for gl_Fog */
+}
 
 static void
 generate_110_vs_variables(exec_list *instructions,
@@ -72,6 +103,7 @@ generate_110_vs_variables(exec_list *instructions,
       add_builtin_variable(& builtin_110_deprecated_vs_variables[i],
                           instructions, symtab);
    }
+   generate_110_uniforms(instructions, symtab);
 
    /* FINISHME: Add support fo gl_TexCoord.  The size of this array is
     * FINISHME: implementation dependent based on the value of
@@ -143,6 +175,7 @@ generate_110_fs_variables(exec_list *instructions,
       add_builtin_variable(& builtin_110_deprecated_fs_variables[i],
                           instructions, symtab);
    }
+   generate_110_uniforms(instructions, symtab);
 
    /* FINISHME: Add support for gl_FragData[GL_MAX_DRAW_BUFFERS]. */
 }