static void
dump_instruction_short(
struct text_dump *dump,
- struct tgsi_full_instruction *inst )
+ struct tgsi_full_instruction *inst,
+ GLuint instno )
{
GLuint i;
GLboolean first_reg = GL_TRUE;
CHR( '\n' );
+ UID( instno );
+ CHR( ':' );
ENM( inst->Instruction.Opcode, TGSI_OPCODES_SHORT );
switch( inst->Instruction.Saturate ) {
first_reg = GL_FALSE;
}
+
+ switch( inst->Instruction.Opcode ) {
+ case TGSI_OPCODE_IF:
+ case TGSI_OPCODE_ELSE:
+ TXT( " : " );
+ UID( inst->InstructionExtLabel.Label );
+ break;
+ }
}
static void
GLuint verbose = flags & TGSI_DUMP_VERBOSE;
GLuint ignored = !(flags & TGSI_DUMP_NO_IGNORED);
GLuint deflt = !(flags & TGSI_DUMP_NO_DEFAULT);
+ GLuint instno = 0;
{
#if 0
case TGSI_TOKEN_TYPE_INSTRUCTION:
dump_instruction_short(
dump,
- &parse.FullToken.FullInstruction );
+ &parse.FullToken.FullInstruction,
+ instno );
+ instno++;
break;
default:
const struct prog_instruction *inst,\r
struct tgsi_full_instruction *fullinst,\r
GLuint inputs_read,\r
+ GLuint preamble_size,\r
GLuint processor )\r
{\r
GLuint i;\r
break;\r
case OPCODE_ELSE:\r
fullinst->Instruction.Opcode = TGSI_OPCODE_ELSE;\r
- fullinst->InstructionExtLabel.Label = inst->BranchTarget;\r
+ fullinst->InstructionExtLabel.Label = inst->BranchTarget + preamble_size;\r
break;\r
case OPCODE_ENDIF:\r
fullinst->Instruction.Opcode = TGSI_OPCODE_ENDIF;\r
break;\r
case OPCODE_IF:\r
fullinst->Instruction.Opcode = TGSI_OPCODE_IF;\r
- fullinst->InstructionExtLabel.Label = inst->BranchTarget;\r
+ fullinst->InstructionExtLabel.Label = inst->BranchTarget + preamble_size;\r
break;\r
case OPCODE_INT:\r
fullinst->Instruction.Opcode = TGSI_OPCODE_INT;\r
struct tgsi_full_dst_register *fulldst;\r
struct tgsi_full_src_register *fullsrc;\r
GLuint inputs_read;\r
+ GLuint preamble_size = 0;\r
\r
*(struct tgsi_version *) &tokens[0] = tgsi_build_version();\r
\r
&tokens[ti],\r
header,\r
maxTokens - ti );\r
+ preamble_size++;\r
\r
for( i = 0; i < program->Base.NumInstructions; i++ ) {\r
if( compile_instruction(\r
&program->Base.Instructions[i],\r
&fullinst,\r
inputs_read,\r
+ preamble_size,\r
TGSI_PROCESSOR_FRAGMENT ) ) {\r
assert( i == program->Base.NumInstructions - 1 );\r
tgsi_dump(\r
&program->Base.Instructions[ii],\r
&fullinst,\r
inputs_read,\r
+ 0,\r
TGSI_PROCESSOR_VERTEX ) ) {\r
assert( ii == program->Base.NumInstructions - 1 );\r
tgsi_dump( tokens, TGSI_DUMP_NO_IGNORED | TGSI_DUMP_NO_DEFAULT );\r