diff options
author | Christian König <[email protected]> | 2013-03-07 15:02:31 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2013-03-19 13:38:32 +0100 |
commit | 21190fbd56ec2f12dc5a1bf1d9fc32d507e8f0a3 (patch) | |
tree | 9e871eed177a4ac7143946efbe69b2f5ec48ffe3 /src/gallium/auxiliary/tgsi/tgsi_text.c | |
parent | 16caeff2a5cc1237d30de9487b48b1cd775d9ae1 (diff) |
tgsi: use separate structure for indirect address v2
To further improve the optimization of source and destination
indirect addressing we need the ability to store a reference
to the declaration of the addressed operands.
Since most of the fields in tgsi_src_register doesn't apply for
an indirect addressing operand replace it with a separate
tgsi_ind_register structure and so make room for extra information.
v2: rename Declaration to ArrayID, put the ArrayID into () instead of []
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 | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c index 8a2a760ef59..6b97bee8b0f 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_text.c +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c @@ -441,6 +441,7 @@ struct parsed_bracket { uint ind_file; int ind_index; uint ind_comp; + uint ind_array; }; @@ -508,6 +509,20 @@ parse_register_bracket( 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; } @@ -711,10 +726,8 @@ parse_dst_operand( 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; } @@ -797,10 +810,8 @@ parse_src_operand( 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. |