From 287e69f76ed54c658b05f6efe3f57f14abaecb0c Mon Sep 17 00:00:00 2001 From: antonino Date: Fri, 5 May 2023 11:53:55 +0200 Subject: [PATCH] nir: don't create invalid inputs in `nir_create_passthrough_gs` The helper was creating input locations for some builtin bariables. This caused validation errors in zink because those builtins can't be used as input. Fixes: d0342e28b32 ("nir: Add helper to create passthrough GS shader") Part-of: (cherry picked from commit 83692bfe3013ace7a98ab59cdcbbae878b9c5758) --- .pick_status.json | 2 +- src/compiler/nir/nir_passthrough_gs.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 1a18056c0be..e440ff362dc 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3010,7 +3010,7 @@ "description": "nir: don't create invalid inputs in `nir_create_passthrough_gs`", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "d0342e28b32d7aa4b25cf045ac9933348ec053a9" }, diff --git a/src/compiler/nir/nir_passthrough_gs.c b/src/compiler/nir/nir_passthrough_gs.c index 1dc9a30de26..c1eb7df8602 100644 --- a/src/compiler/nir/nir_passthrough_gs.c +++ b/src/compiler/nir/nir_passthrough_gs.c @@ -188,6 +188,11 @@ nir_create_passthrough_gs(const nir_shader_compiler_options *options, nir_foreach_shader_out_variable(var, prev_stage) { assert(!var->data.patch); + /* input vars can't be created for those */ + if (var->data.location == VARYING_SLOT_LAYER || + var->data.location == VARYING_SLOT_VIEW_INDEX) + continue; + char name[100]; if (var->name) snprintf(name, sizeof(name), "in_%s", var->name);