[Mesa-dev] [PATCH 06/17] glsl: Add barriers preventing variable in UBO to be linked like classic uniform

Vincent Lejeune vljn at ovi.com
Sun Dec 25 10:17:05 PST 2011


---
 src/glsl/link_uniforms.cpp      |    2 +-
 src/glsl/linker.cpp             |    3 ++-
 src/mesa/program/ir_to_mesa.cpp |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index c7de480..bacf2e9 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -308,7 +308,7 @@ link_assign_uniform_locations(struct gl_shader_program *prog)
       foreach_list(node, prog->_LinkedShaders[i]->ir) {
 	 ir_variable *const var = ((ir_instruction *) node)->as_variable();
 
-	 if ((var == NULL) || (var->mode != ir_var_uniform))
+       if ((var == NULL) || (var->mode != ir_var_uniform) || var->is_ubo_variable)
 	    continue;
 
 	 /* FINISHME: Update code to process built-in uniforms!
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 3527088..036e4b9 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -1048,7 +1048,8 @@ update_array_sizes(struct gl_shader_program *prog)
 
 	 if ((var == NULL) || (var->mode != ir_var_uniform &&
 			       var->mode != ir_var_in &&
-			       var->mode != ir_var_out) ||
+                         var->mode != ir_var_out &&
+                         !var->is_ubo_variable) ||
 	     !var->type->is_array())
 	    continue;
 
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 5a68fc5..79dfe46 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2617,7 +2617,7 @@ _mesa_generate_parameters_list_for_uniforms(struct gl_shader_program
       ir_variable *var = ((ir_instruction *) node)->as_variable();
 
       if ((var == NULL) || (var->mode != ir_var_uniform)
-	  || (strncmp(var->name, "gl_", 3) == 0))
+        || (strncmp(var->name, "gl_", 3) == 0) || var->is_ubo_variable)
 	 continue;
 
       add.process(var);
-- 
1.7.7



More information about the mesa-dev mailing list