From f5e1f9ccef249b2f897179150bdb18d564c25ddc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 13 Aug 2019 18:14:17 -0400 Subject: [PATCH] tgsi_to_nir: add assertions for max varying slots Nine uses GENERIC slots > 31. Trivial. --- src/gallium/auxiliary/nir/tgsi_to_nir.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c index cb03c56e406..1fc886991f2 100644 --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c @@ -136,6 +136,7 @@ tgsi_varying_semantic_to_slot(unsigned semantic, unsigned index) case TGSI_SEMANTIC_PSIZE: return VARYING_SLOT_PSIZ; case TGSI_SEMANTIC_GENERIC: + assert(index < 32); return VARYING_SLOT_VAR0 + index; case TGSI_SEMANTIC_FACE: return VARYING_SLOT_FACE; @@ -151,6 +152,7 @@ tgsi_varying_semantic_to_slot(unsigned semantic, unsigned index) case TGSI_SEMANTIC_CLIPVERTEX: return VARYING_SLOT_CLIP_VERTEX; case TGSI_SEMANTIC_TEXCOORD: + assert(index < 8); return VARYING_SLOT_TEX0 + index; case TGSI_SEMANTIC_PCOORD: return VARYING_SLOT_PNTC; -- 2.30.2