- } else
- ++ctx->cur;
- }
- eat_opt_white( &ctx->cur );
- if (*ctx->cur != '}') {
- FREE(decl.ImmediateData.u);
- report_error( ctx, "Immediate array data missing closing '}'" );
- return FALSE;
+ if (i == TGSI_RETURN_TYPE_COUNT) {
+ if (j == 0 || j > 2) {
+ report_error(ctx, "Expected type name");
+ return FALSE;
+ }
+ break;
+ } else {
+ cur2 = cur;
+ eat_opt_white( &cur2 );
+ if (*cur2 == ',') {
+ cur2++;
+ eat_opt_white( &cur2 );
+ cur = cur2;
+ continue;
+ } else
+ break;
+ }
+ }
+ if (j < 4) {
+ decl.SamplerView.ReturnTypeY =
+ decl.SamplerView.ReturnTypeZ =
+ decl.SamplerView.ReturnTypeW =
+ decl.SamplerView.ReturnTypeX;
+ }
+ ctx->cur = cur;
+ } else {
+ if (str_match_nocase_whole(&cur, "LOCAL")) {
+ decl.Declaration.Local = 1;
+ ctx->cur = cur;
+ }
+
+ cur = ctx->cur;
+ eat_opt_white( &cur );
+ if (*cur == ',') {
+ cur++;
+ eat_opt_white( &cur );
+
+ for (i = 0; i < TGSI_SEMANTIC_COUNT; i++) {
+ if (str_match_nocase_whole(&cur, tgsi_semantic_names[i])) {
+ uint index;
+
+ cur2 = cur;
+ eat_opt_white( &cur2 );
+ if (*cur2 == '[') {
+ cur2++;
+ eat_opt_white( &cur2 );
+ if (!parse_uint( &cur2, &index )) {
+ report_error( ctx, "Expected literal integer" );
+ return FALSE;
+ }
+ eat_opt_white( &cur2 );
+ if (*cur2 != ']') {
+ report_error( ctx, "Expected `]'" );
+ return FALSE;
+ }
+ cur2++;
+
+ decl.Semantic.Index = index;
+
+ cur = cur2;
+ }
+
+ decl.Declaration.Semantic = 1;
+ decl.Semantic.Name = i;
+
+ ctx->cur = cur;
+ break;
+ }
+ }
+ }