glsl2: Add support for gl_PointCoord in 1.20.
authorEric Anholt <eric@anholt.net>
Thu, 8 Jul 2010 02:45:22 +0000 (19:45 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 8 Jul 2010 02:45:22 +0000 (19:45 -0700)
Fixes glsl-fs-pointcoord on swrast (remains broken on 965, like master)

src/glsl/builtin_variables.h
src/glsl/ir_variable.cpp

index 77f2fe55023c1973e3cd7ba640b1491ed58945fd..9551e1accf9ca4820bad745ee908a64d0f9bb109 100644 (file)
@@ -70,6 +70,10 @@ static const builtin_variable builtin_110_deprecated_vs_variables[] = {
    { ir_var_out, VERT_RESULT_FOGC,   "float", "gl_FogFragCoord" },
 };
 
+static const builtin_variable builtin_120_fs_variables[] = {
+   { ir_var_in,  FRAG_ATTRIB_PNTC,   "vec2",   "gl_PointCoord" },
+};
+
 static const builtin_variable builtin_130_vs_variables[] = {
    { ir_var_in,  -1,                 "int",   "gl_VertexID" },
 };
index 9daad803e9606e7ec219a5d68c56b42eb1e511c9..a0b66b777028f76408f695a6de3230811953b511 100644 (file)
@@ -311,6 +311,13 @@ generate_120_fs_variables(exec_list *instructions,
                          struct _mesa_glsl_parse_state *state)
 {
    generate_110_fs_variables(instructions, state);
+
+   for (unsigned i = 0
+          ; i < Elements(builtin_120_fs_variables)
+          ; i++) {
+      add_builtin_variable(& builtin_120_fs_variables[i],
+                          instructions, state->symbols);
+   }
 }
 
 static void