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 <fabianbie...@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

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to