Module: Mesa
Branch: master
Commit: e6ba457c9991490d2762d217d32b08f337e3dfbc
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e6ba457c9991490d2762d217d32b08f337e3dfbc

Author: Jason Ekstrand <ja...@jlekstrand.net>
Date:   Thu Dec  7 23:42:14 2017 -0800

spirv/cfg: Be a bit more precise about function parameters

Pointers with no storage type are converted to inout variables but SSA
values and pointers with a storage type (which turns into a uint or
uvec2) are just input variables.

---

 src/compiler/spirv/vtn_cfg.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c
index 8ddd0f4a40..182251358c 100644
--- a/src/compiler/spirv/vtn_cfg.c
+++ b/src/compiler/spirv/vtn_cfg.c
@@ -55,12 +55,11 @@ vtn_cfg_handle_prepass_instruction(struct vtn_builder *b, 
SpvOp opcode,
          if (func_type->params[i]->base_type == vtn_base_type_pointer &&
              func_type->params[i]->type == NULL) {
             func->params[i].type = func_type->params[i]->deref->type;
+            func->params[i].param_type = nir_parameter_inout;
          } else {
             func->params[i].type = func_type->params[i]->type;
+            func->params[i].param_type = nir_parameter_in;
          }
-
-         /* TODO: We could do something smarter here. */
-         func->params[i].param_type = nir_parameter_inout;
       }
 
       func->return_type = func_type->return_type->type;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to