Mesa (master): microsoft/compiler: Propagate access when lowering SSBO loads
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Apr 16 17:16:32 UTC 2021
Module: Mesa
Branch: master
Commit: aea6f8effc2e6c95c6ea40232748c1a1931c3756
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=aea6f8effc2e6c95c6ea40232748c1a1931c3756
Author: Jesse Natalie <jenatali at microsoft.com>
Date: Tue Apr 13 09:05:52 2021 -0700
microsoft/compiler: Propagate access when lowering SSBO loads
We'll want to preserve whether the load is accessing a read-only
SSBO or not.
Reviewed-by: Enrico Galli <enrico.galli at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10149>
---
src/microsoft/compiler/dxil_nir.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/microsoft/compiler/dxil_nir.c b/src/microsoft/compiler/dxil_nir.c
index 97ad6f1cf67..2e86eb05879 100644
--- a/src/microsoft/compiler/dxil_nir.c
+++ b/src/microsoft/compiler/dxil_nir.c
@@ -267,6 +267,7 @@ lower_load_ssbo(nir_builder *b, nir_intrinsic_instr *intr)
nir_ssa_def *buffer = intr->src[0].ssa;
nir_ssa_def *offset = nir_iand(b, intr->src[1].ssa, nir_imm_int(b, ~3));
+ enum gl_access_qualifier access = nir_intrinsic_access(intr);
unsigned bit_size = nir_dest_bit_size(intr->dest);
unsigned num_components = nir_dest_num_components(intr->dest);
unsigned num_bits = num_components * bit_size;
@@ -289,7 +290,8 @@ lower_load_ssbo(nir_builder *b, nir_intrinsic_instr *intr)
nir_load_ssbo(b, DIV_ROUND_UP(subload_num_bits, 32), 32,
buffer, nir_iadd(b, offset, nir_imm_int(b, i / 8)),
.align_mul = 4,
- .align_offset = 0);
+ .align_offset = 0,
+ .access = access);
/* If we have 2 bytes or less to load we need to adjust the u32 value so
* we can always extract the LSB.
More information about the mesa-commit
mailing list