aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/linker.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-02-06 08:19:53 +0100
committermarha <marha@users.sourceforge.net>2012-02-06 08:19:53 +0100
commitada3d2c30b5a7a1a79e128b7326d50c3bab77a8a (patch)
tree30539a1a7c6b011c3a5d8028d7428a1ad2b07546 /mesalib/src/glsl/linker.cpp
parent58ff764d4111bfaa7360c57bc62dd620fbdce06f (diff)
downloadvcxsrv-ada3d2c30b5a7a1a79e128b7326d50c3bab77a8a.tar.gz
vcxsrv-ada3d2c30b5a7a1a79e128b7326d50c3bab77a8a.tar.bz2
vcxsrv-ada3d2c30b5a7a1a79e128b7326d50c3bab77a8a.zip
mesa git update 6 feb 2012
Diffstat (limited to 'mesalib/src/glsl/linker.cpp')
-rw-r--r--mesalib/src/glsl/linker.cpp38
1 files changed, 22 insertions, 16 deletions
diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp
index 509575192..82bddb003 100644
--- a/mesalib/src/glsl/linker.cpp
+++ b/mesalib/src/glsl/linker.cpp
@@ -856,6 +856,27 @@ get_main_function_signature(gl_shader *sh)
/**
+ * This class is only used in link_intrastage_shaders() below but declaring
+ * it inside that function leads to compiler warnings with some versions of
+ * gcc.
+ */
+class array_sizing_visitor : public ir_hierarchical_visitor {
+public:
+ virtual ir_visitor_status visit(ir_variable *var)
+ {
+ if (var->type->is_array() && (var->type->length == 0)) {
+ const glsl_type *type =
+ glsl_type::get_array_instance(var->type->fields.array,
+ var->max_array_access + 1);
+ assert(type != NULL);
+ var->type = type;
+ }
+ return visit_continue;
+ }
+};
+
+
+/**
* Combine a group of shaders for a single stage to generate a linked shader
*
* \note
@@ -1005,22 +1026,7 @@ link_intrastage_shaders(void *mem_ctx,
* max_array_access field.
*/
if (linked != NULL) {
- class array_sizing_visitor : public ir_hierarchical_visitor {
- public:
- virtual ir_visitor_status visit(ir_variable *var)
- {
- if (var->type->is_array() && (var->type->length == 0)) {
- const glsl_type *type =
- glsl_type::get_array_instance(var->type->fields.array,
- var->max_array_access + 1);
-
- assert(type != NULL);
- var->type = type;
- }
-
- return visit_continue;
- }
- } v;
+ array_sizing_visitor v;
v.run(linked->ir);
}