for (i = 0; i < TGSI_FILE_COUNT; i++) {
const char *cur = *pcur;
- if (str_match_nocase_whole( &cur, tgsi_file_names[i] )) {
+ if (str_match_nocase_whole( &cur, tgsi_file_name(i) )) {
*pcur = cur;
*file = i;
return TRUE;
uint ind_file;
int ind_index;
uint ind_comp;
+ uint ind_array;
};
return FALSE;
}
ctx->cur++;
+ if (*ctx->cur == '(') {
+ ctx->cur++;
+ eat_opt_white( &ctx->cur );
+ if (!parse_uint( &ctx->cur, &brackets->ind_array )) {
+ report_error( ctx, "Expected literal unsigned integer" );
+ return FALSE;
+ }
+ eat_opt_white( &ctx->cur );
+ if (*ctx->cur != ')') {
+ report_error( ctx, "Expected `)'" );
+ return FALSE;
+ }
+ ctx->cur++;
+ }
return TRUE;
}
dst->Register.Indirect = 1;
dst->Indirect.File = bracket[0].ind_file;
dst->Indirect.Index = bracket[0].ind_index;
- dst->Indirect.SwizzleX = bracket[0].ind_comp;
- dst->Indirect.SwizzleY = bracket[0].ind_comp;
- dst->Indirect.SwizzleZ = bracket[0].ind_comp;
- dst->Indirect.SwizzleW = bracket[0].ind_comp;
+ dst->Indirect.Swizzle = bracket[0].ind_comp;
+ dst->Indirect.ArrayID = bracket[0].ind_array;
}
return TRUE;
}
src->Register.Indirect = 1;
src->Indirect.File = bracket[0].ind_file;
src->Indirect.Index = bracket[0].ind_index;
- src->Indirect.SwizzleX = bracket[0].ind_comp;
- src->Indirect.SwizzleY = bracket[0].ind_comp;
- src->Indirect.SwizzleZ = bracket[0].ind_comp;
- src->Indirect.SwizzleW = bracket[0].ind_comp;
+ src->Indirect.Swizzle = bracket[0].ind_comp;
+ src->Indirect.ArrayID = bracket[0].ind_array;
}
/* Parse optional swizzle.
cur = ctx->cur;
eat_opt_white( &cur );
+ if (*cur == ',') {
+ cur2 = cur;
+ cur2++;
+ eat_opt_white( &cur2 );
+ if (str_match_nocase_whole( &cur2, "ARRAY" )) {
+ int arrayid;
+ if (*cur2 != '(') {
+ report_error( ctx, "Expected `('" );
+ return FALSE;
+ }
+ cur2++;
+ eat_opt_white( &cur2 );
+ if (!parse_int( &cur2, &arrayid )) {
+ report_error( ctx, "Expected `,'" );
+ return FALSE;
+ }
+ eat_opt_white( &cur2 );
+ if (*cur2 != ')') {
+ report_error( ctx, "Expected `)'" );
+ return FALSE;
+ }
+ cur2++;
+ decl.Declaration.Array = 1;
+ decl.Array.ArrayID = arrayid;
+ ctx->cur = cur = cur2;
+ }
+ }
+
if (*cur == ',' && !is_vs_input) {
uint i, j;
struct tgsi_token *tokens,
uint num_tokens )
{
- struct translate_ctx ctx;
+ struct translate_ctx ctx = {0};
ctx.text = text;
ctx.cur = text;