Minor optimization: no-op CAL when ExecMask==0x0.
authorBrian <brian.paul@tungstengraphics.com>
Tue, 2 Oct 2007 20:25:43 +0000 (14:25 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Tue, 2 Oct 2007 20:25:43 +0000 (14:25 -0600)
src/mesa/pipe/tgsi/exec/tgsi_exec.c

index e428b250f007cb8d72f226be7ef9569ab2136646..5a50bd5aed6dc1e380bd536fba1a86f64c745b4f 100644 (file)
@@ -1911,9 +1911,12 @@ exec_instruction(
       break;
 
    case TGSI_OPCODE_CAL:
-      /* note that PC was already incremented above */
-      mach->CallStack[mach->CallStackTop++] = *pc;
-      *pc = inst->InstructionExtLabel.Label;
+      /* skip the call if no execution channels are enabled */
+      if (mach->ExecMask) {
+         /* note that PC was already incremented above */
+         mach->CallStack[mach->CallStackTop++] = *pc;
+         *pc = inst->InstructionExtLabel.Label;
+      }
       break;
 
    case TGSI_OPCODE_RET: