From ace8a7068e0afde499f6f0146daa6041f4b9d250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 10 Mar 2023 23:03:58 -0500 Subject: [PATCH] nir: fix 2 bugs in nir_create_passthrough_tcs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - VAR31 was ignored. - Only a half of the 16-bit slot was passed through, though I'm not sure if nir_lower_io handles vec8. The slots are only for GLES and I don't think a passthrough TCS is possible with GLES. Fixes: a8e84f50bc6c8 - nir: Add helper to create passthrough TCS shader Reviewed-by: Timur Kristóf Reviewed-by: Qiang Yu Part-of: --- src/compiler/nir/nir_passthrough_tcs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/compiler/nir/nir_passthrough_tcs.c b/src/compiler/nir/nir_passthrough_tcs.c index d0ddca21adc..0d2edbccd60 100644 --- a/src/compiler/nir/nir_passthrough_tcs.c +++ b/src/compiler/nir/nir_passthrough_tcs.c @@ -77,10 +77,9 @@ nir_create_passthrough_tcs_impl(const nir_shader_compiler_options *options, for (unsigned i = 0; i < num_locations; i++) { const struct glsl_type *type; unsigned semantic = locations[i]; - if (semantic < VARYING_SLOT_VAR31 && semantic != VARYING_SLOT_EDGE) + if ((semantic <= VARYING_SLOT_VAR31 && semantic != VARYING_SLOT_EDGE) || + semantic >= VARYING_SLOT_VAR0_16BIT) type = glsl_array_type(glsl_vec4_type(), 0, 0); - else if (semantic >= VARYING_SLOT_VAR0_16BIT) - type = glsl_array_type(glsl_vector_type(GLSL_TYPE_FLOAT16, 4), 0, 0); else continue;