summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-05-10 12:31:35 -0600
committerBrian Paul <[email protected]>2010-05-10 12:35:52 -0600
commitadbbaae7b925b212866bcba57e17db5824a16390 (patch)
tree0387b410434015a1b456250c3e085eb180d3546d
parenta1cc4c1924346192d95259fb38836c74c7dee2ef (diff)
st/mesa: additional assertions in dst_register()
-rw-r--r--src/mesa/state_tracker/st_mesa_to_tgsi.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 0991e99e76c..bda8267fac0 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -156,6 +156,16 @@ dst_register( struct st_translate *t,
case PROGRAM_OUTPUT:
if (index == VERT_RESULT_PSIZ)
t->prevInstWrotePsiz = GL_TRUE;
+
+ if (t->procType == TGSI_PROCESSOR_VERTEX)
+ assert(index < VERT_RESULT_MAX);
+ else if (t->procType == TGSI_PROCESSOR_FRAGMENT)
+ assert(index < FRAG_RESULT_MAX);
+ else
+ assert(0 && "geom shaders not handled in dst_register() yet");
+
+ assert(t->outputMapping[index] < Elements(t->outputs));
+
return t->outputs[t->outputMapping[index]];
case PROGRAM_ADDRESS: