diff options
author | Connor Abbott <[email protected]> | 2019-06-04 11:40:14 +0200 |
---|---|---|
committer | Connor Abbott <[email protected]> | 2019-06-19 14:08:27 +0200 |
commit | 6f20643b471a851c936fc8b569cf05dcd6e6e7fe (patch) | |
tree | a0d4fcc881aa853a6d9473155608de5d17ff94a1 /src/compiler/nir/nir_lower_var_copies.c | |
parent | 3bf8981c511527403de8b585d7a61af178d6bdd0 (diff) |
nir: Allow qualifiers on copy_deref and image instructions
In the next commit, we'll properly handle access qualifiers on struct
members by propagating them to load/store instructions, but these
instructions had no way to specify the qualifier.
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_lower_var_copies.c')
-rw-r--r-- | src/compiler/nir/nir_lower_var_copies.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/compiler/nir/nir_lower_var_copies.c b/src/compiler/nir/nir_lower_var_copies.c index 0ba398698f0..e6ade733eba 100644 --- a/src/compiler/nir/nir_lower_var_copies.c +++ b/src/compiler/nir/nir_lower_var_copies.c @@ -56,7 +56,9 @@ emit_deref_copy_load_store(nir_builder *b, nir_deref_instr *dst_deref, nir_deref_instr **dst_deref_arr, nir_deref_instr *src_deref, - nir_deref_instr **src_deref_arr) + nir_deref_instr **src_deref_arr, + enum gl_access_qualifier dst_access, + enum gl_access_qualifier src_access) { if (dst_deref_arr || src_deref_arr) { assert(dst_deref_arr && src_deref_arr); @@ -79,14 +81,16 @@ emit_deref_copy_load_store(nir_builder *b, nir_build_deref_array_imm(b, dst_deref, i), dst_deref_arr + 1, nir_build_deref_array_imm(b, src_deref, i), - src_deref_arr + 1); + src_deref_arr + 1, dst_access, src_access); } } else { assert(glsl_get_bare_type(dst_deref->type) == glsl_get_bare_type(src_deref->type)); assert(glsl_type_is_vector_or_scalar(dst_deref->type)); - nir_store_deref(b, dst_deref, nir_load_deref(b, src_deref), ~0); + nir_store_deref_with_access(b, dst_deref, + nir_load_deref_with_access(b, src_deref, src_access), + ~0, src_access); } } @@ -106,7 +110,9 @@ nir_lower_deref_copy_instr(nir_builder *b, nir_intrinsic_instr *copy) b->cursor = nir_before_instr(©->instr); emit_deref_copy_load_store(b, dst_path.path[0], &dst_path.path[1], - src_path.path[0], &src_path.path[1]); + src_path.path[0], &src_path.path[1], + nir_intrinsic_dst_access(copy), + nir_intrinsic_src_access(copy)); nir_deref_path_finish(&dst_path); nir_deref_path_finish(&src_path); |