diff options
Diffstat (limited to 'src/mesa/pipe/tgsi/exec/tgsi_exec.c')
-rw-r--r-- | src/mesa/pipe/tgsi/exec/tgsi_exec.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mesa/pipe/tgsi/exec/tgsi_exec.c b/src/mesa/pipe/tgsi/exec/tgsi_exec.c index ca397bde6a..27154d6883 100644 --- a/src/mesa/pipe/tgsi/exec/tgsi_exec.c +++ b/src/mesa/pipe/tgsi/exec/tgsi_exec.c @@ -2029,6 +2029,11 @@ exec_instruction( } break; + case TGSI_OPCODE_END: + /* halt execution */ + *pc = -1; + break; + case TGSI_OPCODE_ENDIF: /* pop CondMask */ assert(mach->CondStackTop > 0); @@ -2233,15 +2238,14 @@ tgsi_exec_machine_run( struct tgsi_exec_machine *mach ) { uint i; - int pc; + int pc = 0; for (i = 0; i < mach->NumDeclarations; i++) { exec_declaration( mach, mach->Declarations+i ); } - pc = 0; - - while (pc != 99 && pc < mach->NumInstructions) { + while (pc != -1) { + assert(pc < mach->NumInstructions); exec_instruction( mach, mach->Instructions + pc, &pc ); } } |