ENM( imm->Immediate.DataType, TGSI_IMMS_SHORT );
TXT( " { " );
-#if 0
for( i = 0; i < imm->Immediate.Size - 1; i++ ) {
-#else
- for( i = 0; i < imm->Immediate.Size; i++ ) {
-#endif
switch( imm->Immediate.DataType ) {
case TGSI_IMM_FLOAT32:
FLT( imm->u.ImmediateFloat32[i].Float );
break;
case TGSI_TOKEN_TYPE_IMMEDIATE:
-#if 0
- assert( (parse.FullToken.FullImmediate.Immediate.Size - 1) % 4 == 0 );
- assert( mach->ImmLimit + (parse.FullToken.FullImmediate.Immediate.Size - 1) / 4 <= 256 );
+ {
+ uint size = parse.FullToken.FullImmediate.Immediate.Size - 1;
+ assert( size % 4 == 0 );
+ assert( mach->ImmLimit + size / 4 <= 256 );
- for( i = 0; i < parse.FullToken.FullImmediate.Immediate.Size - 1; i++ ) {
- mach->Imms[mach->ImmLimit + i / 4][i % 4] = parse.FullToken.FullImmediate.u.ImmediateFloat32[i].Float;
- }
- mach->ImmLimit += (parse.FullToken.FullImmediate.Immediate.Size - 1) / 4;
-#else
- /* Add this immediate value (vector of 1,2,3,4 floats) to immediates array */
- assert( parse.FullToken.FullImmediate.Immediate.Size <= 4 );
- assert( mach->ImmLimit < TGSI_EXEC_NUM_IMMEDIATES );
-
- for( i = 0; i < parse.FullToken.FullImmediate.Immediate.Size; i++ ) {
- mach->Imms[mach->ImmLimit][i] = parse.FullToken.FullImmediate.u.ImmediateFloat32[i].Float;
+ for( i = 0; i < size; i++ ) {
+ mach->Imms[mach->ImmLimit + i / 4][i % 4] = parse.FullToken.FullImmediate.u.ImmediateFloat32[i].Float;
+ }
+ mach->ImmLimit += size / 4;
}
- mach->ImmLimit++;
-#endif
break;
case TGSI_TOKEN_TYPE_INSTRUCTION:
{\r
struct tgsi_full_immediate imm;\r
imm.Immediate.Type = TGSI_TOKEN_TYPE_IMMEDIATE;\r
- imm.Immediate.Size = size;\r
+ imm.Immediate.Size = 1 + size; /* one for the token itself */\r
imm.Immediate.DataType = TGSI_IMM_FLOAT32;\r
imm.u.ImmediateFloat32 = (struct tgsi_immediate_float32 *) value;\r
return imm;\r