nir: Set UBO alignments in lower_uniforms_to_ubo

Fixes: fb64954d9d "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>
This commit is contained in:
Jason Ekstrand 2020-03-26 23:56:57 -05:00 committed by Marge Bot
parent 4a909068ad
commit f5b14d983e
1 changed files with 2 additions and 0 deletions

View 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);