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_util.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_util.c')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_util.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_util.c b/src/gallium/auxiliary/tgsi/tgsi_util.c index 8a5a8eab5aa..dfd32d7be44 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_util.c +++ b/src/gallium/auxiliary/tgsi/tgsi_util.c @@ -320,3 +320,21 @@ tgsi_util_get_inst_usage_mask(const struct tgsi_full_instruction *inst, return usage_mask; } + +/** + * Convert a tgsi_ind_register into a tgsi_src_register + */ +struct tgsi_src_register +tgsi_util_get_src_from_ind(const struct tgsi_ind_register *reg) +{ + struct tgsi_src_register src = {}; + + src.File = reg->File; + src.Index = reg->Index; + src.SwizzleX = reg->Swizzle; + src.SwizzleY = reg->Swizzle; + src.SwizzleZ = reg->Swizzle; + src.SwizzleW = reg->Swizzle; + + return src; +} |