summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-10-02 16:24:40 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-10-02 16:24:40 -0600
commitc9dceb17c0bf255252f58a4c947522b958fe015c (patch)
tree41135c07e24cddccc3d26a2c678e6cd22a96134d /src
parent4d155a32d2c44af4d85715fcc982ad4bc18d38fa (diff)
Push mask stacks upon CAL, pop upon RET.
Still need to handle conditional RET statements...
Diffstat (limited to 'src')
-rw-r--r--src/mesa/pipe/tgsi/exec/tgsi_exec.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mesa/pipe/tgsi/exec/tgsi_exec.c b/src/mesa/pipe/tgsi/exec/tgsi_exec.c
index 60abecaef1..edd46100c5 100644
--- a/src/mesa/pipe/tgsi/exec/tgsi_exec.c
+++ b/src/mesa/pipe/tgsi/exec/tgsi_exec.c
@@ -1980,6 +1980,16 @@ exec_instruction(
case TGSI_OPCODE_CAL:
/* skip the call if no execution channels are enabled */
if (mach->ExecMask) {
+ /* do the call */
+
+ /* push Cond, Loop, Cont stacks */
+ assert(mach->CondStackTop < TGSI_EXEC_MAX_COND_NESTING);
+ mach->CondStack[mach->CondStackTop++] = mach->CondMask;
+ assert(mach->LoopStackTop < TGSI_EXEC_MAX_LOOP_NESTING);
+ mach->LoopStack[mach->LoopStackTop++] = mach->LoopMask;
+ assert(mach->ContStackTop < TGSI_EXEC_MAX_LOOP_NESTING);
+ mach->ContStack[mach->ContStackTop++] = mach->ContMask;
+
/* note that PC was already incremented above */
mach->CallStack[mach->CallStackTop++] = *pc;
*pc = inst->InstructionExtLabel.Label;
@@ -1987,6 +1997,15 @@ exec_instruction(
break;
case TGSI_OPCODE_RET:
+ /* XXX examine ExecMask to determine if we should _really_ return */
+ /* pop Cond, Loop, Cont stacks */
+ assert(mach->CondStackTop > 0);
+ mach->CondMask = mach->CondStack[--mach->CondStackTop];
+ assert(mach->LoopStackTop > 0);
+ mach->LoopMask = mach->LoopStack[--mach->LoopStackTop];
+ assert(mach->ContStackTop > 0);
+ mach->ContMask = mach->ContStack[--mach->ContStackTop];
+
assert(mach->CallStackTop >= 0);
if (mach->CallStackTop == 0) {
/* XXX error? */