[Mesa-dev] [PATCH v2 1/3] nir/split_var_copies: handle IMAGE and SAMPLER for bindless vars

Karol Herbst kherbst at redhat.com
Tue Apr 10 15:05:22 UTC 2018


v2: fix assertion for bindless to non bindless assignments

Signed-off-by: Karol Herbst <kherbst at redhat.com>
---
 src/compiler/nir/nir_split_var_copies.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_split_var_copies.c b/src/compiler/nir/nir_split_var_copies.c
index bc3ceedbdb8..e592754d770 100644
--- a/src/compiler/nir/nir_split_var_copies.c
+++ b/src/compiler/nir/nir_split_var_copies.c
@@ -222,8 +222,9 @@ split_var_copies_block(nir_block *block, struct split_var_copies_state *state)
       nir_deref_var *src_head = intrinsic->variables[1];
       nir_deref *dest_tail = nir_deref_tail(&dest_head->deref);
       nir_deref *src_tail = nir_deref_tail(&src_head->deref);
+      enum glsl_base_type base_type = glsl_get_base_type(src_tail->type);
 
-      switch (glsl_get_base_type(src_tail->type)) {
+      switch (base_type) {
       case GLSL_TYPE_ARRAY:
       case GLSL_TYPE_STRUCT:
          split_var_copy_instr(intrinsic, dest_head, src_head,
@@ -241,6 +242,11 @@ split_var_copies_block(nir_block *block, struct split_var_copies_state *state)
             ralloc_steal(state->dead_ctx, instr);
          }
          break;
+      /* for bindless those are uint64 */
+      case GLSL_TYPE_IMAGE:
+      case GLSL_TYPE_SAMPLER:
+         assert(src_head->var->data.bindless ||
+                glsl_get_base_type(src_head->var->type) == base_type);
       case GLSL_TYPE_INT:
       case GLSL_TYPE_UINT:
       case GLSL_TYPE_INT16:
-- 
2.14.3



More information about the mesa-dev mailing list