spirv: don't discard access set by vtn_pointer_dereference
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 26 Jul 2019 19:47:09 +0000 (22:47 +0300)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 30 Jul 2019 17:43:59 +0000 (17:43 +0000)
We can have a access flag already set here so just augment the
existing ones.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 0fb61dfdeb ("spirv: propagate access qualifiers through ssa & pointer")
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/compiler/spirv/vtn_variables.c

index c73cbd37cecf1dfb2c6de6146f89d2b8a52bbc40..d4e3cac5db31c20dbbab7c4bcdd8e28296205f0b 100644 (file)
@@ -2510,7 +2510,7 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode,
          struct vtn_pointer *ptr =
             vtn_pointer_dereference(b, base_val->pointer, chain);
          ptr->ptr_type = ptr_type;
-         ptr->access = access;
+         ptr->access |= access;
          vtn_push_value_pointer(b, w[2], ptr);
       }
       break;