zink: set UBO alignments in nir_intrinsic_load_uniform lowering

resolves this error
  error: nir_intrinsic_align_offset(instr) < nir_intrinsic_align_mul(instr) (../src/compiler/nir/nir_validate.c:582)
in ext_packed_depth_stencil-readdrawpixels piglit test

port of f5b14d983e

Fixes: fb64954d9d ("nir: Validate that memory load/store ops work on whole bytes")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4711>
This commit is contained in:
Mike Blumenkrantz 2020-04-23 14:21:05 -04:00 committed by Marge Bot
parent 155033bbb3
commit c683138689
1 changed files with 2 additions and 0 deletions

View File

@ -60,6 +60,8 @@ lower_instr(nir_intrinsic_instr *instr, nir_builder *b)
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);