GLuint i, k;
struct tgsi_parse_context parse;
+#if 0
+ tgsi_dump(tokens, 0);
+#endif
+
mach->Tokens = tokens;
mach->Samplers = samplers;
dst->i[3] = src0->i[3] >> src1->i[3];
}
+static void
+micro_trunc(
+ union tgsi_exec_channel *dst,
+ const union tgsi_exec_channel *src0 )
+{
+ dst->f[0] = (float) (int) src0->u[0];
+ dst->f[1] = (float) (int) src0->u[1];
+ dst->f[2] = (float) (int) src0->u[2];
+ dst->f[3] = (float) (int) src0->u[3];
+}
+
static void
micro_ushr(
union tgsi_exec_channel *dst,
assert (0);
break;
- case TGSI_OPCODE_BRK:
- /* turn off loop channels for each enabled exec channel */
- mach->LoopMask &= ~mach->ExecMask;
- /* Todo: if mach->LoopMask == 0, jump to end of loop */
- UPDATE_EXEC_MASK(mach);
- break;
-
case TGSI_OPCODE_IF:
/* push CondMask */
assert(mach->CondStackTop < TGSI_EXEC_MAX_COND_NESTING);
/* Todo: If CondMask==0, jump to ELSE */
break;
- case TGSI_OPCODE_LOOP:
- /* push LoopMask */
- assert(mach->LoopStackTop < TGSI_EXEC_MAX_LOOP_NESTING);
- mach->LoopStack[mach->LoopStackTop++] = mach->LoopMask;
- break;
-
- case TGSI_OPCODE_REP:
- assert (0);
- break;
-
case TGSI_OPCODE_ELSE:
/* invert CondMask wrt previous mask */
{
}
break;
- case TGSI_OPCODE_END:
- /* halt execution */
- *pc = -1;
- break;
-
case TGSI_OPCODE_ENDIF:
/* pop CondMask */
assert(mach->CondStackTop > 0);
UPDATE_EXEC_MASK(mach);
break;
+ case TGSI_OPCODE_END:
+ /* halt execution */
+ *pc = -1;
+ break;
+
+ case TGSI_OPCODE_REP:
+ assert (0);
+ break;
+
case TGSI_OPCODE_ENDREP:
assert (0);
break;
break;
case TGSI_OPCODE_TRUNC:
- /* TGSI_OPCODE_INT */
- assert (0);
+ FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
+ FETCH( &r[0], 0, chan_index );
+ micro_trunc( &r[0], &r[0] );
+ STORE( &r[0], 0, chan_index );
+ }
break;
case TGSI_OPCODE_SHL:
assert (0);
break;
- case TGSI_OPCODE_CONT:
- assert (0);
- break;
-
case TGSI_OPCODE_EMIT:
mach->Temps[TEMP_OUTPUT_I].xyzw[TEMP_OUTPUT_C].u[0] += 16;
mach->Primitives[mach->Temps[TEMP_PRIMITIVE_I].xyzw[TEMP_PRIMITIVE_C].u[0]]++;
mach->Primitives[mach->Temps[TEMP_PRIMITIVE_I].xyzw[TEMP_PRIMITIVE_C].u[0]] = 0;
break;
+ case TGSI_OPCODE_LOOP:
+ /* fall-through (for now) */
case TGSI_OPCODE_BGNLOOP2:
/* push LoopMask */
assert(mach->LoopStackTop < TGSI_EXEC_MAX_LOOP_NESTING);
mach->LoopStack[mach->LoopStackTop++] = mach->LoopMask;
break;
- case TGSI_OPCODE_BGNSUB:
- /* no-op */
- break;
-
case TGSI_OPCODE_ENDLOOP:
/* fall-through (for now at least) */
case TGSI_OPCODE_ENDLOOP2:
}
break;
+ case TGSI_OPCODE_BRK:
+ /* turn off loop channels for each enabled exec channel */
+ mach->LoopMask &= ~mach->ExecMask;
+ /* Todo: if mach->LoopMask == 0, jump to end of loop */
+ UPDATE_EXEC_MASK(mach);
+ break;
+
+ case TGSI_OPCODE_CONT:
+ assert (0);
+ break;
+
+
+ case TGSI_OPCODE_BGNSUB:
+ /* no-op */
+ break;
+
case TGSI_OPCODE_ENDSUB:
assert( 0 );
break;