summaryrefslogtreecommitdiff
path: root/ir_variable.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-25 16:02:41 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-25 16:02:41 -0700
commitacb36240e5c628db8cbdd43912e6b24967d2b2f2 (patch)
treeee74fdde7059b0a45ddb4b6925f202f74b62c99d /ir_variable.cpp
parent68507eceead4e4cd6bb67ae219a333ab35f56bea (diff)
parentb3f743ab0badc0ca7cba16d7989ec7ba368f6b36 (diff)
Merge branch 'anholt'
Diffstat (limited to 'ir_variable.cpp')
-rw-r--r--ir_variable.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/ir_variable.cpp b/ir_variable.cpp
index 283842c54e..9344170613 100644
--- a/ir_variable.cpp
+++ b/ir_variable.cpp
@@ -127,6 +127,57 @@ initialize_vs_variables(exec_list *instructions,
}
}
+static void
+generate_110_fs_variables(exec_list *instructions,
+ glsl_symbol_table *symtab)
+{
+ for (unsigned i = 0; i < Elements(builtin_core_fs_variables); i++) {
+ add_builtin_variable(& builtin_core_fs_variables[i],
+ instructions, symtab);
+ }
+
+ /* FINISHME: Add support for gl_FragData[GL_MAX_DRAW_BUFFERS]. */
+}
+
+static void
+generate_120_fs_variables(exec_list *instructions,
+ glsl_symbol_table *symtab)
+{
+ /* GLSL version 1.20 did not add any built-in variables in the fragment
+ * shader.
+ */
+ generate_110_fs_variables(instructions, symtab);
+}
+
+static void
+generate_130_fs_variables(exec_list *instructions,
+ glsl_symbol_table *symtab)
+{
+ generate_120_fs_variables(instructions, symtab);
+
+ /* FINISHME: Add support fo gl_ClipDistance. The size of this array is
+ * FINISHME: implementation dependent based on the value of
+ * FINISHME: GL_MAX_CLIP_DISTANCES.
+ */
+}
+
+static void
+initialize_fs_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+
+ switch (state->language_version) {
+ case 110:
+ generate_110_fs_variables(instructions, state->symbols);
+ break;
+ case 120:
+ generate_120_fs_variables(instructions, state->symbols);
+ break;
+ case 130:
+ generate_130_fs_variables(instructions, state->symbols);
+ break;
+ }
+}
void
_mesa_glsl_initialize_variables(exec_list *instructions,
@@ -137,7 +188,9 @@ _mesa_glsl_initialize_variables(exec_list *instructions,
initialize_vs_variables(instructions, state);
break;
case geometry_shader:
+ break;
case fragment_shader:
+ initialize_fs_variables(instructions, state);
break;
}
}