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/include/pipe | |
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/include/pipe')
-rw-r--r-- | src/gallium/include/pipe/p_shader_tokens.h | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h index eac75e69e5d..1ca46fd0206 100644 --- a/src/gallium/include/pipe/p_shader_tokens.h +++ b/src/gallium/include/pipe/p_shader_tokens.h @@ -563,7 +563,7 @@ struct tgsi_instruction_predicate * * Index specifies the element number of a register in the register file. * - * If Indirect is TRUE, Index should be offset by the X component of a source + * If Indirect is TRUE, Index should be offset by the X component of the indirect * register that follows. The register can be now fetched into local storage * for further processing. * @@ -589,14 +589,26 @@ struct tgsi_src_register }; /** - * If tgsi_src_register::Modifier is TRUE, tgsi_src_register_modifier follows. - * - * Then, if tgsi_src_register::Indirect is TRUE, another tgsi_src_register - * follows. + * If tgsi_src_register::Indirect is TRUE, tgsi_ind_register follows. + * + * File, Index and Swizzle are handled the same as in tgsi_src_register. + * + * If ArrayID is zero the whole register file might be is indirectly addressed, + * if not only the Declaration with this ArrayID is accessed by this operand. * - * Then, if tgsi_src_register::Dimension is TRUE, tgsi_dimension follows. */ +struct tgsi_ind_register +{ + unsigned File : 4; /* TGSI_FILE_ */ + int Index : 16; /* SINT */ + unsigned Swizzle : 2; /* TGSI_SWIZZLE_ */ + unsigned ArrayID : 10; /* UINT */ +}; + +/** + * If tgsi_src_register::Dimension is TRUE, tgsi_dimension follows. + */ struct tgsi_dimension { |