[Mesa-dev] [PATCH 1/2] gallium: add TGSI_SEMANTIC_VERTEXID

Brian Paul brianp at vmware.com
Fri Nov 11 14:59:32 PST 2011


On 11/11/2011 03:18 PM, Christoph Bumiller wrote:
> ---
>   src/gallium/auxiliary/tgsi/tgsi_dump.c     |    1 +
>   src/gallium/auxiliary/tgsi/tgsi_scan.c     |    3 +++
>   src/gallium/auxiliary/tgsi/tgsi_scan.h     |    1 +
>   src/gallium/auxiliary/tgsi/tgsi_text.c     |    1 +
>   src/gallium/include/pipe/p_shader_tokens.h |    5 +++--
>   5 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c
> index 64927ed..91bc124 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_dump.c
> +++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c
> @@ -128,6 +128,7 @@ static const char *semantic_names[] =
>      "EDGEFLAG",
>      "PRIM_ID",
>      "INSTANCEID",
> +   "VERTEXID",
>      "STENCIL"
>   };
>
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
> index 60de80d..3ed8dad 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
> +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
> @@ -181,6 +181,9 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
>
>                     if (fulldecl->Semantic.Name == TGSI_SEMANTIC_INSTANCEID) {
>                        info->uses_instanceid = TRUE;
> +                  } else
> +                  if (fulldecl->Semantic.Name == TGSI_SEMANTIC_VERTEXID) {

The else if formatting there should be touched up.


> +                     info->uses_vertexid = TRUE;
>                     }
>                  }
>                  else if (file == TGSI_FILE_OUTPUT) {
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h
> index 30834b4..482c106 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_scan.h
> +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h
> @@ -70,6 +70,7 @@ struct tgsi_shader_info
>      boolean writes_edgeflag; /**<  vertex shader outputs edgeflag */
>      boolean uses_kill;  /**<  KIL or KILP instruction used? */
>      boolean uses_instanceid;
> +   boolean uses_vertexid;
>      boolean origin_lower_left;
>      boolean pixel_center_integer;
>      boolean color0_writes_all_cbufs;
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c
> index 6b97803..eb9190c 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_text.c
> +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c
> @@ -1023,6 +1023,7 @@ static const char *semantic_names[TGSI_SEMANTIC_COUNT] =
>      "EDGEFLAG",
>      "PRIM_ID",
>      "INSTANCEID",
> +   "VERTEXID",
>      "STENCIL"
>   };
>
> diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
> index 7236c92..b04e26d 100644
> --- a/src/gallium/include/pipe/p_shader_tokens.h
> +++ b/src/gallium/include/pipe/p_shader_tokens.h
> @@ -144,8 +144,9 @@ struct tgsi_declaration_dimension
>   #define TGSI_SEMANTIC_EDGEFLAG   8
>   #define TGSI_SEMANTIC_PRIMID     9
>   #define TGSI_SEMANTIC_INSTANCEID 10
> -#define TGSI_SEMANTIC_STENCIL    11
> -#define TGSI_SEMANTIC_COUNT      12 /**<  number of semantic values */
> +#define TGSI_SEMANTIC_VERTEXID   11
> +#define TGSI_SEMANTIC_STENCIL    12
> +#define TGSI_SEMANTIC_COUNT      13 /**<  number of semantic values */
>
>   struct tgsi_declaration_semantic
>   {


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


Looks good, but doesn't seem to help with 
https://bugs.freedesktop.org/show_bug.cgi?id=42834



More information about the mesa-dev mailing list