declaration.Dimension = 0;
declaration.Semantic = 0;
declaration.Invariant = 0;
+ declaration.Local = 0;
return declaration;
}
unsigned dimension,
unsigned semantic,
unsigned invariant,
+ unsigned local,
struct tgsi_header *header )
{
struct tgsi_declaration declaration;
declaration.Dimension = dimension;
declaration.Semantic = semantic;
declaration.Invariant = invariant;
+ declaration.Local = local;
header_bodysize_grow( header );
full_decl->Declaration.Dimension,
full_decl->Declaration.Semantic,
full_decl->Declaration.Invariant,
+ full_decl->Declaration.Local,
header );
if (maxsize <= size)
ctx,
decl->Declaration.UsageMask );
+ if (decl->Declaration.Local)
+ TXT( ", LOCAL" );
+
if (decl->Declaration.Semantic) {
TXT( ", " );
ENM( decl->Semantic.Name, tgsi_semantic_names );
}
ctx->cur = cur;
} else {
- for (i = 0; i < TGSI_SEMANTIC_COUNT; i++) {
- if (str_match_no_case( &cur, tgsi_semantic_names[i] )) {
- const char *cur2 = cur;
- uint index;
+ if (str_match_no_case(&cur, "LOCAL") &&
+ !is_digit_alpha_underscore(cur)) {
+ decl.Declaration.Local = 1;
+ ctx->cur = cur;
+ }
- if (is_digit_alpha_underscore( cur ))
- continue;
- eat_opt_white( &cur2 );
- if (*cur2 == '[') {
- cur2++;
- eat_opt_white( &cur2 );
- if (!parse_uint( &cur2, &index )) {
- report_error( ctx, "Expected literal integer" );
- return FALSE;
- }
+ 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_no_case( &cur, tgsi_semantic_names[i] )) {
+ uint index;
+
+ if (is_digit_alpha_underscore( cur ))
+ continue;
+ cur2 = cur;
eat_opt_white( &cur2 );
- if (*cur2 != ']') {
- report_error( ctx, "Expected `]'" );
- return FALSE;
- }
- 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;
+ decl.Semantic.Index = index;
- cur = cur2;
- }
+ cur = cur2;
+ }
- decl.Declaration.Semantic = 1;
- decl.Semantic.Name = i;
+ decl.Declaration.Semantic = 1;
+ decl.Semantic.Name = i;
- ctx->cur = cur;
- break;
+ ctx->cur = cur;
+ break;
+ }
}
}
}
UsageMask field specifies which of the register components can be accessed
and is one of TGSI_WRITEMASK.
+The Local flag specifies that a given value isn't intended for
+subroutine parameter passing and, as a result, the implementation
+isn't required to give any guarantees of it being preserved across
+subroutine boundaries. As it's merely a compiler hint, the
+implementation is free to ignore it.
+
If Dimension flag is set to 1, a Declaration Dimension token follows.
If Semantic flag is set to 1, a Declaration Semantic token follows.
unsigned Semantic : 1; /**< BOOL, any semantic info? */
unsigned Interpolate : 1; /**< any interpolation info? */
unsigned Invariant : 1; /**< invariant optimization? */
- unsigned Padding : 8;
+ unsigned Local : 1; /**< optimize as subroutine local variable? */
+ unsigned Padding : 7;
};
struct tgsi_declaration_range