summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorantonino <antonino.maniscalco@collabora.com>2023-05-05 11:53:55 +0200
committerEric Engestrom <eric@engestrom.ch>2023-05-25 14:06:11 +0100
commit287e69f76ed54c658b05f6efe3f57f14abaecb0c (patch)
tree6b59f514a31158324a9a834f804d298523553000 /src/compiler
parent41ba7bb42e59a848985fd2802ea98ae248586aae (diff)
downloadmesa-287e69f76ed54c658b05f6efe3f57f14abaecb0c.tar.gz
mesa-287e69f76ed54c658b05f6efe3f57f14abaecb0c.tar.bz2
mesa-287e69f76ed54c658b05f6efe3f57f14abaecb0c.zip
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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22871> (cherry picked from commit 83692bfe3013ace7a98ab59cdcbbae878b9c5758)
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_passthrough_gs.c5
1 files changed, 5 insertions, 0 deletions
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);