From a27af70c1b3fded1ed2987d31215da3802fbdbda Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Mon, 18 Apr 2022 13:53:21 +1000 Subject: [PATCH] nir: fix setting varying from uniform as flat Here we just make sure we match the interpolation type on both sides of the shader interface. Drivers like d3d12 are expecting this. Fixes: 9401990e6f7a ("nir/linker: set varying from uniform as flat") Reviewed-by: Qiang Yu Part-of: (cherry picked from commit 4b4bb46af41c5e6c773ad3f9c0d34c7272e0149f) --- .pick_status.json | 2 +- src/compiler/nir/nir_linking_helpers.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 8316c41aa4d..729774d5587 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1291,7 +1291,7 @@ "description": "nir: fix setting varying from uniform as flat", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "9401990e6f7a4b024b3a62055339f71477b508d0" }, diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c index 6a574ec29be..187098cafe9 100644 --- a/src/compiler/nir/nir_linking_helpers.c +++ b/src/compiler/nir/nir_linking_helpers.c @@ -1391,8 +1391,10 @@ nir_link_opt_varyings(nir_shader *producer, nir_shader *consumer) /* The varying is loaded from same uniform, so no need to do any * interpolation. Mark it as flat explicitly. */ - if (in_var && in_var->data.interpolation <= INTERP_MODE_NOPERSPECTIVE) + if (in_var && in_var->data.interpolation <= INTERP_MODE_NOPERSPECTIVE) { in_var->data.interpolation = INTERP_MODE_FLAT; + out_var->data.interpolation = INTERP_MODE_FLAT; + } } }