[Mesa-dev] [PATCH 8/9] tgsi: use separate structure for indirect address v2

Roland Scheidegger sroland at vmware.com
Mon Mar 18 07:12:41 PDT 2013


Am 18.03.2013 14:36, schrieb Christian König:
> From: Christian König <christian.koenig at amd.com>
> 
> 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 <christian.koenig at amd.com>
> ---
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
> index cd140de..be99ae0 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h
> +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
> @@ -62,6 +62,7 @@ struct ureg_src
>     int      IndirectIndex    : 16; /* SINT */
>     int      DimensionIndex   : 16; /* SINT */
>     int      DimIndIndex      : 16; /* SINT */
> +   unsigned ArrayID          : 10; /* UINT */
>  };
>  
>  /* Very similar to a tgsi_dst_register, removing unsupported fields
> @@ -84,6 +85,7 @@ struct ureg_dst
>     int      Index           : 16; /* SINT */
>     int      IndirectIndex   : 16; /* SINT */
>     int      IndirectSwizzle : 2;  /* TGSI_SWIZZLE_ */
> +   unsigned ArrayID         : 10; /* UINT */
>  };
>  

Not sure I like the ordering of these fields...
In any case it would be difficult (but possible) to make ureg_dst fit
into a 64bit struct.
FWIW (but that's not your fault) IndirectSwizzle really ought to be a
unsigned too, looks to me like this misdeclaration really could cause
bugs somewhere.

Roland


More information about the mesa-dev mailing list