nir: Copy semantics to nir_intrinsic_load_fs_input_interp_deltas
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 24 Aug 2020 22:12:36 +0000 (15:12 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 25 Aug 2020 16:43:19 +0000 (16:43 +0000)
When using nir_lower_interpolation, we need to propagate the IO
semantics from the load_interpolated_input to the new
load_fs_input_interp_deltas intrinsics.  nir_lower_io assumes
they will be filled out.

This fixes assertions in most tests on iris since commit
01ab308edc78cda777bc66f2e8110fbd8c21aa18, where nir_lower_io
started reading this field.

Fixes: 01ab308edc7 ("nir: update IO semantics in nir_io_add_const_offset_to_base")
Fixes: 502abfce7f5 ("nir: save IO semantics in lowered IO intrinsics")
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6450>

src/compiler/nir/nir_intrinsics.py
src/compiler/nir/nir_lower_interpolation.c

index e9cc0da6472150e98f28b6675cea13f218b11320..a48b76bac107d0ebd099ed4384b075f1d7b339c7 100644 (file)
@@ -706,7 +706,7 @@ intrinsic("load_size_ir3", dest_comp=1, flags=[CAN_ELIMINATE, CAN_REORDER])
 #    float result = iid.x + iid.y * bary.y + iid.z * bary.x
 
 intrinsic("load_fs_input_interp_deltas", src_comp=[1], dest_comp=3,
-          indices=[BASE, COMPONENT], flags=[CAN_ELIMINATE, CAN_REORDER])
+          indices=[BASE, COMPONENT, IO_SEMANTICS], flags=[CAN_ELIMINATE, CAN_REORDER])
 
 # Load operations pull data from some piece of GPU memory.  All load
 # operations operate in terms of offsets into some piece of theoretical
index b4edfb9b0ccc75af36c26af611a7d980a20463da..d43cc7344fc4738ccb90ced32dcfec9389858da8 100644 (file)
@@ -111,6 +111,8 @@ nir_lower_interpolation_block(nir_block *block, nir_builder *b,
          nir_intrinsic_set_base(load_iid, nir_intrinsic_base(intr));
          nir_intrinsic_set_component(load_iid,
                                      nir_intrinsic_component(intr) + i);
+         nir_intrinsic_set_io_semantics(load_iid,
+                                        nir_intrinsic_io_semantics(intr));
          nir_builder_instr_insert(b, &load_iid->instr);
 
          nir_ssa_def *iid = &load_iid->dest.ssa;