From 2fcfcca842a6c3ca77f38791da88b185839f064a Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 24 Aug 2020 15:12:36 -0700 Subject: [PATCH] nir: Copy semantics to nir_intrinsic_load_fs_input_interp_deltas 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 Part-of: --- src/compiler/nir/nir_intrinsics.py | 2 +- src/compiler/nir/nir_lower_interpolation.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index e9cc0da6472..a48b76bac10 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -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 diff --git a/src/compiler/nir/nir_lower_interpolation.c b/src/compiler/nir/nir_lower_interpolation.c index b4edfb9b0cc..d43cc7344fc 100644 --- a/src/compiler/nir/nir_lower_interpolation.c +++ b/src/compiler/nir/nir_lower_interpolation.c @@ -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; -- 2.30.2