[Mesa-dev] [PATCH 1/4] tgsi: Add support to ureg for TGSI_FILE_TEMPORARAY_ARRAY

Brian Paul brianp at vmware.com
Wed Nov 7 16:48:28 PST 2012


On 11/05/2012 01:14 PM, Tom Stellard wrote:
> From: Tom Stellard<thomas.stellard at amd.com>
>
> ---
>   src/gallium/auxiliary/tgsi/tgsi_ureg.c | 12 ++++++++++++
>   src/gallium/auxiliary/tgsi/tgsi_ureg.h |  3 +++
>   2 files changed, 15 insertions(+)
>
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
> index 3c2a923..154f4f5 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
> +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
> @@ -154,6 +154,7 @@ struct ureg_program
>      struct util_bitmask *free_temps;
>      struct util_bitmask *local_temps;
>      unsigned nr_temps;
> +   unsigned nr_array_temps;
>
>      struct const_decl const_decls;
>      struct const_decl const_decls2D[PIPE_MAX_CONSTANT_BUFFERS];
> @@ -568,6 +569,13 @@ struct ureg_dst ureg_DECL_local_temporary( struct ureg_program *ureg )
>      return alloc_temporary(ureg, TRUE);
>   }
>
> +struct ureg_dst ureg_DECL_temporary_array( struct ureg_program *ureg,
> +                                           unsigned index)
> +{
> +   ureg->nr_array_temps = MAX2(index + 1, ureg->nr_array_temps);
> +   return ureg_dst_register( TGSI_FILE_TEMPORARY_ARRAY, index );
> +}
> +
>   void ureg_release_temporary( struct ureg_program *ureg,
>                                struct ureg_dst tmp )
>   {
> @@ -1548,6 +1556,10 @@ static void emit_decls( struct ureg_program *ureg )
>         }
>      }
>
> +   for (i = 0; i<  ureg->nr_array_temps; i++) {
> +            emit_decl( ureg, TGSI_FILE_TEMPORARY_ARRAY, i, false);
> +   }

The indention looks too deep there.



> +
>      if (ureg->nr_addrs) {
>         emit_decl_range( ureg,
>                          TGSI_FILE_ADDRESS,
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
> index e6131f2..b54c369 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h
> +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
> @@ -280,6 +280,9 @@ ureg_DECL_temporary( struct ureg_program * );
>   struct ureg_dst
>   ureg_DECL_local_temporary( struct ureg_program * );
>
> +struct ureg_dst
> +ureg_DECL_temporary_array( struct ureg_program *, unsigned );
> +
>   void
>   ureg_release_temporary( struct ureg_program *ureg,
>                           struct ureg_dst tmp );


Q: is the size of the TGSI_FILE_TEMPORARY_ARRAY register file the same 
as the regular temporary register file?

Reviewed-by: Brian Paul <brianp at vmware.com>

-Brian


More information about the mesa-dev mailing list