From 21190fbd56ec2f12dc5a1bf1d9fc32d507e8f0a3 Mon Sep 17 00:00:00 2001 From: Christian König Date: Thu, 7 Mar 2013 15:02:31 +0100 Subject: tgsi: use separate structure for indirect address v2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/gallium/include/pipe/p_shader_tokens.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/gallium/include/pipe/p_shader_tokens.h') 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 { -- cgit v1.2.3