nir: copy intrinsic type when lowering load input/uniform and store output
authorJonathan Marek <jonathan@marek.ca>
Sun, 2 Jun 2019 19:16:06 +0000 (15:16 -0400)
committerJonathan Marek <jonathan@marek.ca>
Mon, 3 Jun 2019 12:46:14 +0000 (12:46 +0000)
Fixes: c1275052 "nir: add type information to load uniform/input and store output intrinsics"
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Tested-by: Erico Nunes <nunes.erico@gmail.com>
Tested-by: Andreas Baierl <ichgeh@imkreisrum.de>
src/compiler/nir/nir_lower_io_to_scalar.c
src/gallium/drivers/lima/ir/lima_nir_lower_uniform_to_scalar.c

index 559d80b214afc75371606076d4ee5bf260933d35..1277a8a7373403ae7b885670ea0205a79f2c3bd9 100644 (file)
@@ -49,6 +49,7 @@ lower_load_input_to_scalar(nir_builder *b, nir_intrinsic_instr *intr)
 
       nir_intrinsic_set_base(chan_intr, nir_intrinsic_base(intr));
       nir_intrinsic_set_component(chan_intr, nir_intrinsic_component(intr) + i);
+      nir_intrinsic_set_type(chan_intr, nir_intrinsic_type(intr));
       /* offset */
       nir_src_copy(&chan_intr->src[0], &intr->src[0], chan_intr);
 
@@ -81,6 +82,7 @@ lower_store_output_to_scalar(nir_builder *b, nir_intrinsic_instr *intr)
       nir_intrinsic_set_base(chan_intr, nir_intrinsic_base(intr));
       nir_intrinsic_set_write_mask(chan_intr, 0x1);
       nir_intrinsic_set_component(chan_intr, nir_intrinsic_component(intr) + i);
+      nir_intrinsic_set_type(chan_intr, nir_intrinsic_type(intr));
 
       /* value */
       chan_intr->src[0] = nir_src_for_ssa(nir_channel(b, value, i));
index 2bea90cef78aa04ab2a989e1022c63b551ce9eb4..3b1103702777755e66d934ca11eef3b403480fb8 100644 (file)
@@ -41,6 +41,7 @@ lower_load_uniform_to_scalar(nir_builder *b, nir_intrinsic_instr *intr)
 
       nir_intrinsic_set_base(chan_intr, nir_intrinsic_base(intr) * 4 + i);
       nir_intrinsic_set_range(chan_intr, nir_intrinsic_range(intr) * 4);
+      nir_intrinsic_set_type(chan_intr, nir_intrinsic_type(intr));
 
       chan_intr->src[0] =
          nir_src_for_ssa(nir_fmul_imm(b, intr->src[0].ssa, 4));