Labels are always label targets.
authormichal <michal@michal-laptop.(none)>
Tue, 7 Aug 2007 09:14:50 +0000 (10:14 +0100)
committermichal <michal@michal-laptop.(none)>
Tue, 7 Aug 2007 09:15:21 +0000 (10:15 +0100)
Translate label for GLSL IF, ELSE.

src/mesa/pipe/tgsi/core/tgsi_build.c
src/mesa/pipe/tgsi/core/tgsi_build.h
src/mesa/pipe/tgsi/core/tgsi_dump.c
src/mesa/pipe/tgsi/core/tgsi_exec.c
src/mesa/pipe/tgsi/core/tgsi_token.h
src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c

index 2a482a78dc3a2f9b27a0e366ccbdeee31a154f34..bbf4a89a5e3850363335c8b6a273050351c29710 100644 (file)
@@ -528,7 +528,6 @@ tgsi_build_full_instruction(
 
       *instruction_ext_label = tgsi_build_instruction_ext_label(
          full_inst->InstructionExtLabel.Label,
-         full_inst->InstructionExtLabel.Target,
          prev_token,
          instruction,
          header );
@@ -835,7 +834,6 @@ tgsi_default_instruction_ext_label( void )
 
    instruction_ext_label.Type = TGSI_INSTRUCTION_EXT_TYPE_LABEL;
    instruction_ext_label.Label = 0;
-   instruction_ext_label.Target = 0;
    instruction_ext_label.Padding = 0;
    instruction_ext_label.Extended = 0;
 
@@ -855,7 +853,6 @@ tgsi_compare_instruction_ext_label(
 struct tgsi_instruction_ext_label
 tgsi_build_instruction_ext_label(
    GLuint label,
-   GLuint target,
    struct tgsi_token  *prev_token,
    struct tgsi_instruction *instruction,
    struct tgsi_header *header )
@@ -864,7 +861,6 @@ tgsi_build_instruction_ext_label(
 
    instruction_ext_label = tgsi_default_instruction_ext_label();
    instruction_ext_label.Label = label;
-   instruction_ext_label.Target = target;
 
    prev_token->Extended = 1;
    instruction_grow( instruction, header );
index db259565193502856d256f4d2455be057e9b8065..35c1a2506d2eef51e36f8e0455965d8a566be856 100644 (file)
@@ -160,7 +160,6 @@ tgsi_compare_instruction_ext_label(
 struct tgsi_instruction_ext_label
 tgsi_build_instruction_ext_label(
    GLuint label,
-   GLuint target,
    struct tgsi_token *prev_token,
    struct tgsi_instruction *instruction,
    struct tgsi_header *header );
index bdffc59d393419a14e3f42ffc103fd8f9d90130b..882771da2e45f074f485696f475588059a04e874 100644 (file)
@@ -618,10 +618,6 @@ tgsi_dump(
                   TXT( "\nLabel   : " );
                   UID( inst->InstructionExtLabel.Label );
                }
-               if( deflt || fi.InstructionExtLabel.Target != inst->InstructionExtLabel.Target ) {
-                  TXT( "\nTarget  : " );
-                  UID( inst->InstructionExtLabel.Target );
-               }
                if( ignored ) {
                   TXT( "\nPadding : " );
                   UIX( inst->InstructionExtLabel.Padding );
index 7cf48021de2930498dd56e949f42dfbb085dd2e5..37ca7c1b2ab5867b80e369b0ffa9959558272dd4 100644 (file)
@@ -134,8 +134,7 @@ tgsi_exec_prepare(
          mach->ImmLimit += (parse.FullToken.FullImmediate.Immediate.Size - 1) / 4;
          break;
       case TGSI_TOKEN_TYPE_INSTRUCTION:
-         if( parse.FullToken.FullInstruction.InstructionExtLabel.Label &&
-             parse.FullToken.FullInstruction.InstructionExtLabel.Target ) {
+         if( parse.FullToken.FullInstruction.InstructionExtLabel.Label ) {
             assert( labels->count < 128 );
             labels->labels[labels->count][0] = parse.FullToken.FullInstruction.InstructionExtLabel.Label;
             labels->labels[labels->count][1] = pointer;
index 632d67881819c9ca45e51d252856fe448cf2bea8..fd59ea1e2ededceee59173e2d4649e06c657b531 100644 (file)
@@ -855,8 +855,7 @@ struct tgsi_instruction_ext_label
 {
    GLuint Type     : 4;    /* TGSI_INSTRUCTION_EXT_TYPE_LABEL */
    GLuint Label    : 24;   /* UINT */
-   GLuint Target   : 1;    /* BOOL */
-   GLuint Padding  : 2;
+   GLuint Padding  : 3;
    GLuint Extended : 1;    /* BOOL */
 };
 
index 8ce3931f5e41c41cf01dce54edf61c1b3e5a990d..47fd5791e11ff59c292dc73cd6fa96d2a50e4097 100644 (file)
@@ -293,6 +293,7 @@ compile_instruction(
       break;\r
    case OPCODE_ELSE:\r
       fullinst->Instruction.Opcode = TGSI_OPCODE_ELSE;\r
+      fullinst->InstructionExtLabel.Label = inst->BranchTarget;\r
       break;\r
    case OPCODE_ENDIF:\r
       fullinst->Instruction.Opcode = TGSI_OPCODE_ENDIF;\r
@@ -317,6 +318,7 @@ compile_instruction(
       break;\r
    case OPCODE_IF:\r
       fullinst->Instruction.Opcode = TGSI_OPCODE_IF;\r
+      fullinst->InstructionExtLabel.Label = inst->BranchTarget;\r
       break;\r
    case OPCODE_INT:\r
       fullinst->Instruction.Opcode = TGSI_OPCODE_INT;\r