nir: Set UBO alignments in lower_uniforms_to_ubo
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 27 Mar 2020 04:56:57 +0000 (23:56 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 30 Mar 2020 19:18:17 +0000 (19:18 +0000)
Fixes: fb64954d9dd "nir: Validate that memory load/store ops work on..."
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
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

index 7def01aad7eb331862b64a4695586f0a612f9a62..565410cf0cc0cef79bc9237b8aed993a8d78207a 100644 (file)
@@ -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);