Add support for builtin deprecated fs varyings.
authorEric Anholt <eric@anholt.net>
Sat, 27 Mar 2010 19:48:57 +0000 (12:48 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 29 Mar 2010 19:48:45 +0000 (12:48 -0700)
Fixes glsl-color.frag.

builtin_variables.h
ir_variable.cpp

index 5b18446a0da5e9c1db140e84931c0dc1c361ea2d..a742a1562d233f52b20d25d99316d5df82a598a7 100644 (file)
@@ -39,6 +39,12 @@ static const builtin_variable builtin_core_fs_variables[] = {
    { ir_var_out, "float", "gl_FragDepth" },
 };
 
+static const builtin_variable builtin_110_deprecated_fs_variables[] = {
+   { ir_var_in,  "vec4",  "gl_Color" },
+   { ir_var_in,  "vec4",  "gl_SecondaryColor" },
+   { ir_var_in,  "vec4",  "gl_FogFragCoord" },
+};
+
 static const builtin_variable builtin_110_deprecated_vs_variables[] = {
    { ir_var_in,  "vec4",  "gl_Vertex" },
    { ir_var_in,  "vec4",  "gl_Normal" },
index 9344170613d7b986cc5b6e2f2444bc14816aa68d..df8e4c3ba829e8085c040fbae88260038dac3958 100644 (file)
@@ -136,6 +136,14 @@ generate_110_fs_variables(exec_list *instructions,
                           instructions, symtab);
    }
 
+   /* FINISHME: Add support for gl_TexCoord[] */
+   for (unsigned i = 0
+          ; i < Elements(builtin_110_deprecated_fs_variables)
+          ; i++) {
+      add_builtin_variable(& builtin_110_deprecated_fs_variables[i],
+                          instructions, symtab);
+   }
+
    /* FINISHME: Add support for gl_FragData[GL_MAX_DRAW_BUFFERS]. */
 }