Mesa (main): gallium/nir/tgsi: initialize file_max for inputs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 19 13:33:26 UTC 2021


Module: Mesa
Branch: main
Commit: 63529782d33b4c23282cebd7aef57bd70ff4e3fc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=63529782d33b4c23282cebd7aef57bd70ff4e3fc

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Tue Aug 17 19:42:21 2021 +0200

gallium/nir/tgsi: initialize file_max for inputs

When this was rewritten to support Vulkan, we stopped initializing
file_max to -1 in the case of no inputs. This causes the draw module
to go down a needlessly pessimistic case, printing an error while we're
at it.

Fixes: 42b5cfdbd26 ("gallivm/nir: fix vulkan vertex inputs")
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12440>

---

 src/gallium/auxiliary/nir/nir_to_tgsi_info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi_info.c b/src/gallium/auxiliary/nir/nir_to_tgsi_info.c
index 79af7e5548a..3bb5f1f8bae 100644
--- a/src/gallium/auxiliary/nir/nir_to_tgsi_info.c
+++ b/src/gallium/auxiliary/nir/nir_to_tgsi_info.c
@@ -579,7 +579,7 @@ void nir_tgsi_scan_shader(const struct nir_shader *nir,
          info->indirect_files |= 1 << TGSI_FILE_INPUT;
       info->file_max[TGSI_FILE_INPUT] = info->num_inputs - 1;
    } else {
-      int max = -1;
+      int max = info->file_max[TGSI_FILE_INPUT] = -1;
       nir_foreach_shader_in_variable(var, nir) {
          int slots = glsl_count_attribute_slots(var->type, false);
          int tmax = var->data.driver_location + slots - 1;



More information about the mesa-commit mailing list