diff options
author | Christian König <[email protected]> | 2013-03-13 14:58:15 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2013-03-19 13:38:32 +0100 |
commit | 16caeff2a5cc1237d30de9487b48b1cd775d9ae1 (patch) | |
tree | d4e7d56d7ff611afaa754a6fb7958816c3a0674b /src/gallium/auxiliary/tgsi/tgsi_text.c | |
parent | d3e07bed90d6b94ac37a7f48417bf8962408fa47 (diff) |
tgsi: add ArrayID to declarations
Remember which declarations are declared as "arrays" and so
can be indirectly addressed. ArrayIDs start at 1, cause for
compatibility reasons zero is treaded as no array present.
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_text.c')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_text.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c index 7d580e6e3d8..8a2a760ef59 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_text.c +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c @@ -1114,6 +1114,28 @@ static boolean parse_declaration( struct translate_ctx *ctx ) 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; + 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; + } + decl.Declaration.Array = 1; + decl.Array.ArrayID = arrayid; + cur = cur2; + } + } + if (*cur == ',' && !is_vs_input) { uint i, j; |