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

Author: Jason Ekstrand <[email protected]>
Date:   Thu Mar 26 23:56:57 2020 -0500

nir: Set UBO alignments in lower_uniforms_to_ubo

Fixes: fb64954d9dd "nir: Validate that memory load/store ops work on..."
Reviewed-by: Kenneth Graunke <[email protected]>
Tested-by: Marge Bot 
<https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4378>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4378>

---

 src/compiler/nir/nir_lower_uniforms_to_ubo.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/compiler/nir/nir_lower_uniforms_to_ubo.c 
b/src/compiler/nir/nir_lower_uniforms_to_ubo.c
index 7def01aad7e..565410cf0cc 100644
--- a/src/compiler/nir/nir_lower_uniforms_to_ubo.c
+++ b/src/compiler/nir/nir_lower_uniforms_to_ubo.c
@@ -65,6 +65,8 @@ lower_instr(nir_intrinsic_instr *instr, nir_builder *b, int 
multiplier)
       load->num_components = instr->num_components;
       load->src[0] = nir_src_for_ssa(ubo_idx);
       load->src[1] = nir_src_for_ssa(ubo_offset);
+      assert(instr->dest.ssa.bit_size >= 8);
+      nir_intrinsic_set_align(load, instr->dest.ssa.bit_size / 8, 0);
       nir_ssa_dest_init(&load->instr, &load->dest,
                         load->num_components, instr->dest.ssa.bit_size,
                         instr->dest.ssa.name);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to