[Mesa-stable] [PATCH 04/13] mesa: Group gl_system_value values by the stage where they exist

Roland Scheidegger sroland at vmware.com
Sat Jun 21 08:19:20 PDT 2014


Am 21.06.2014 03:00, schrieb Ian Romanick:
> From: Ian Romanick <ian.d.romanick at intel.com>
> 
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> Cc: Ilia Mirkin <imirkin at alum.mit.edu>
> Cc: Marek Olšák <marek.olsak at amd.com>
> Cc: Roland Scheidegger <sroland at vmware.com>
> Cc: "10.2" <mesa-stable at lists.freedesktop.org>
> ---
>  src/mesa/main/mtypes.h                     | 32 +++++++++++++++++++++++-------
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 12 +++++++++--
>  2 files changed, 35 insertions(+), 9 deletions(-)
> 
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 8b7ee30..3899e7f 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -2035,13 +2035,31 @@ typedef enum
>   */
>  typedef enum
>  {
> -   SYSTEM_VALUE_FRONT_FACE,     /**< Fragment shader only (not done yet) */
> -   SYSTEM_VALUE_VERTEX_ID,      /**< Vertex shader only */
> -   SYSTEM_VALUE_INSTANCE_ID,    /**< Vertex shader only */
> -   SYSTEM_VALUE_SAMPLE_ID,      /**< Fragment shader only */
> -   SYSTEM_VALUE_SAMPLE_POS,     /**< Fragment shader only */
> -   SYSTEM_VALUE_SAMPLE_MASK_IN, /**< Fragment shader only */
> -   SYSTEM_VALUE_INVOCATION_ID,  /**< Geometry shader only */
> +   /**
> +    * \name Vertex shader system values
> +    */
> +   /*@{*/
> +   SYSTEM_VALUE_VERTEX_ID,
> +   SYSTEM_VALUE_INSTANCE_ID,
> +   /*@}*/
> +
> +   /**
> +    * \name Geometry shader system values
> +    */
> +   /*@{*/
> +   SYSTEM_VALUE_INVOCATION_ID,
> +   /*@}*/
> +
> +   /**
> +    * \name Fragment shader system values
> +    */
> +   /*@{*/
> +   SYSTEM_VALUE_FRONT_FACE,     /**< (not done yet) */
> +   SYSTEM_VALUE_SAMPLE_ID,
> +   SYSTEM_VALUE_SAMPLE_POS,
> +   SYSTEM_VALUE_SAMPLE_MASK_IN,
> +   /*@}*/
> +
>     SYSTEM_VALUE_MAX             /**< Number of values */
>  } gl_system_value;
>  
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index fbfbea6..fa95493 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -4236,13 +4236,21 @@ struct st_translate {
>  
>  /** Map Mesa's SYSTEM_VALUE_x to TGSI_SEMANTIC_x */
>  const unsigned _mesa_sysval_to_semantic[SYSTEM_VALUE_MAX] = {
> -   TGSI_SEMANTIC_FACE,
> +   /* Vertex shader
> +    */
>     TGSI_SEMANTIC_VERTEXID,
>     TGSI_SEMANTIC_INSTANCEID,
> +
> +   /* Geometry shader
> +    */
> +   TGSI_SEMANTIC_INVOCATIONID,
> +
> +   /* Fragment shader
> +    */
> +   TGSI_SEMANTIC_FACE,
>     TGSI_SEMANTIC_SAMPLEID,
>     TGSI_SEMANTIC_SAMPLEPOS,
>     TGSI_SEMANTIC_SAMPLEMASK,
> -   TGSI_SEMANTIC_INVOCATIONID,
>  };
>  
>  /**
> 

Looks good to me (though it does mean you have to add new values in the
middle in the future if you group them by stage).
1-4 are
Reviewed-by: Roland Scheidegger <sroland at vmware.com>


More information about the mesa-stable mailing list