[Mesa-dev] [PATCH 4/5] glsl: Don't copy array of sampler parameters when inlining functions.

Fabian Bieler fabianbieler at fastmail.fm
Mon Jun 3 13:23:27 PDT 2013


Remove The parameter from the list of parameters and replace the derefs in the
function body with the deref of the argument.

This is the way scalar sampler variables are handled already.

Signed-off-by: Fabian Bieler <fabianbieler at fastmail.fm>
---
 src/glsl/opt_function_inlining.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/glsl/opt_function_inlining.cpp b/src/glsl/opt_function_inlining.cpp
index 0733d51..25a8ff8 100644
--- a/src/glsl/opt_function_inlining.cpp
+++ b/src/glsl/opt_function_inlining.cpp
@@ -123,7 +123,7 @@ ir_call::generate_inline(ir_instruction *next_ir)
       ir_rvalue *param = (ir_rvalue *) param_iter.get();
 
       /* Generate a new variable for the parameter. */
-      if (sig_param->type->base_type == GLSL_TYPE_SAMPLER) {
+      if (sig_param->type->get_scalar_type()->is_sampler()) {
 	 /* For samplers, we want the inlined sampler references
 	  * referencing the passed in sampler variable, since that
 	  * will have the location information, which an assignment of
@@ -178,7 +178,7 @@ ir_call::generate_inline(ir_instruction *next_ir)
       ir_instruction *const param = (ir_instruction *) param_iter.get();
       ir_variable *sig_param = (ir_variable *) sig_param_iter.get();
 
-      if (sig_param->type->base_type == GLSL_TYPE_SAMPLER) {
+      if (sig_param->type->get_scalar_type()->is_sampler()) {
 	 ir_dereference *deref = param->as_dereference();
 
 	 assert(deref);
-- 
1.8.1.2



More information about the mesa-dev mailing list