diff options
Diffstat (limited to 'src/mesa/pipe/tgsi/exec')
-rwxr-xr-x | src/mesa/pipe/tgsi/exec/tgsi_dump.c | 5 | ||||
-rw-r--r-- | src/mesa/pipe/tgsi/exec/tgsi_exec.c | 12 | ||||
-rw-r--r-- | src/mesa/pipe/tgsi/exec/tgsi_token.h | 4 |
3 files changed, 15 insertions, 6 deletions
diff --git a/src/mesa/pipe/tgsi/exec/tgsi_dump.c b/src/mesa/pipe/tgsi/exec/tgsi_dump.c index 4cf3397162c..0b273cd6e56 100755 --- a/src/mesa/pipe/tgsi/exec/tgsi_dump.c +++ b/src/mesa/pipe/tgsi/exec/tgsi_dump.c @@ -363,7 +363,8 @@ static const char *TGSI_OPCODES[] = "OPCODE_CALLNZ", "OPCODE_IFC", "OPCODE_BREAKC", - "OPCODE_TXP" + "OPCODE_TXP", + "OPCODE_END" }; static const char *TGSI_OPCODES_SHORT[] = @@ -500,6 +501,8 @@ static const char *TGSI_OPCODES_SHORT[] = "CALLNZ", "IFC", "BREAKC", + "TXP", + "END" }; static const char *TGSI_SATS[] = diff --git a/src/mesa/pipe/tgsi/exec/tgsi_exec.c b/src/mesa/pipe/tgsi/exec/tgsi_exec.c index ca397bde6a4..27154d68839 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 ); } } diff --git a/src/mesa/pipe/tgsi/exec/tgsi_token.h b/src/mesa/pipe/tgsi/exec/tgsi_token.h index 1d99a50dde7..d2fa8138159 100644 --- a/src/mesa/pipe/tgsi/exec/tgsi_token.h +++ b/src/mesa/pipe/tgsi/exec/tgsi_token.h @@ -1100,7 +1100,9 @@ struct tgsi_immediate_float32 /* TGSI_OPCODE_MOVA */ /* TGSI_OPCODE_LOGP */ -#define TGSI_OPCODE_LAST 133 +#define TGSI_OPCODE_END 133 /* aka HALT */ + +#define TGSI_OPCODE_LAST 134 #define TGSI_SAT_NONE 0 /* do not saturate */ #define TGSI_SAT_ZERO_ONE 1 /* clamp to [0,1] */ |