etnaviv: fix nir validation problem
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Thu, 30 Jul 2020 19:25:12 +0000 (21:25 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 3 Aug 2020 20:05:20 +0000 (20:05 +0000)
Fixes the following validation problem:
  error: nir_intrinsic_align_offset(instr) < nir_intrinsic_align_mul(instr)

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Tested-by: Lukas F. Hartmann <lukas@mntmn.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6127>

src/gallium/drivers/etnaviv/etnaviv_nir.c

index 13aa73b083930a377f5176ce3535df7d7b718365..210677b3adf972b9565adb3a970d8419acdb712a 100644 (file)
@@ -88,6 +88,7 @@ etna_lower_io(nir_shader *shader, struct etna_shader_variant *v)
                   nir_intrinsic_instr *load_ubo =
                      nir_intrinsic_instr_create(b.shader, nir_intrinsic_load_ubo);
                   load_ubo->num_components = intr->num_components;
+                  nir_intrinsic_set_align(load_ubo, intr->dest.ssa.bit_size / 8, 0);
                   nir_ssa_dest_init(&load_ubo->instr, &load_ubo->dest,
                                     load_ubo->num_components, 32, NULL);