summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-08-13 18:14:17 -0400
committerMarek Olšák <[email protected]>2019-08-13 18:15:53 -0400
commitf5e1f9ccef249b2f897179150bdb18d564c25ddc (patch)
tree6f44a0d0965d9a49bc612d09758315024c5d7320 /src/gallium
parentfad962eddc218cf95276e6b4d335e2dce3009aec (diff)
tgsi_to_nir: add assertions for max varying slots
Nine uses GENERIC slots > 31. Trivial.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/nir/tgsi_to_nir.c2
1 files changed, 2 insertions, 0 deletions
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;