From 2034cf87c547f4d99bc5beb5cdce7944c82d0109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 18 Mar 2024 12:15:41 -0400 Subject: [PATCH] nir/lower_io: add nir_io_semantics::interp_explicit_strict This preserves the misnamed "per_vertex" flag in lowered IO. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir.h | 3 ++- src/compiler/nir/nir_lower_io.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 52d51b0f7f0..c82b9a7d7b9 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -1950,7 +1950,8 @@ typedef struct nir_io_semantics { unsigned no_varying : 1; /* whether this output isn't consumed by the next stage */ unsigned no_sysval_output : 1; /* whether this system value output has no effect due to current pipeline states */ - unsigned _pad : 2; + unsigned interp_explicit_strict : 1; /* preserve original vertex order */ + unsigned _pad : 1; } nir_io_semantics; /* Transform feedback info for 2 outputs. nir_intrinsic_store_output contains diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index 4cabad15bf7..e16900792a1 100644 --- a/src/compiler/nir/nir_lower_io.c +++ b/src/compiler/nir/nir_lower_io.c @@ -340,6 +340,11 @@ emit_load(struct lower_io_state *state, var->data.precision == GLSL_PRECISION_MEDIUM || var->data.precision == GLSL_PRECISION_LOW; semantics.high_dvec2 = high_dvec2; + /* "per_vertex" is misnamed. It means "explicit interpolation with + * the original vertex order", which is a stricter version of + * INTERP_MODE_EXPLICIT. + */ + semantics.interp_explicit_strict = var->data.per_vertex; nir_intrinsic_set_io_semantics(load, semantics); }