[Mesa-dev] [RFC PATCH 12/56] mesa: Add tessellation shader builtin varyings.
Ian Romanick
idr at freedesktop.org
Tue Sep 30 09:33:15 PDT 2014
On 09/20/2014 06:40 PM, Chris Forbes wrote:
> From: Fabian Bieler <fabianbieler at fastmail.fm>
>
> ---
> src/mesa/main/mtypes.h | 15 ++++++++++++++-
> src/mesa/program/prog_print.c | 4 ++++
> 2 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 9e989d7..9088e97 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -239,6 +239,8 @@ typedef enum
> VARYING_SLOT_VIEWPORT, /* Appears as VS or GS output */
> VARYING_SLOT_FACE, /* FS only */
> VARYING_SLOT_PNTC, /* FS only */
> + VARYING_SLOT_TESS_LEVEL_OUTER, /* Appears in both tessellation shaders. */
> + VARYING_SLOT_TESS_LEVEL_INNER, /* Appears in both tessellation shaders. */
> VARYING_SLOT_VAR0, /* First generic varying slot */
> VARYING_SLOT_MAX = VARYING_SLOT_VAR0 + MAX_VARYING
> } gl_varying_slot;
> @@ -275,6 +277,8 @@ typedef enum
> #define VARYING_BIT_VIEWPORT BITFIELD64_BIT(VARYING_SLOT_VIEWPORT)
> #define VARYING_BIT_FACE BITFIELD64_BIT(VARYING_SLOT_FACE)
> #define VARYING_BIT_PNTC BITFIELD64_BIT(VARYING_SLOT_PNTC)
> +#define VARYING_BIT_TESS_LEVEL_OUTER BITFIELD64_BIT(VARYING_SLOT_TESS_LEVEL_OUTER)
> +#define VARYING_BIT_TESS_LEVEL_INNER BITFIELD64_BIT(VARYING_SLOT_TESS_LEVEL_INNER)
> #define VARYING_BIT_VAR(V) BITFIELD64_BIT(VARYING_SLOT_VAR0 + (V))
> /*@}*/
>
> @@ -298,6 +302,8 @@ _mesa_varying_slot_in_fs(gl_varying_slot slot)
> case VARYING_SLOT_EDGE:
> case VARYING_SLOT_CLIP_VERTEX:
> case VARYING_SLOT_LAYER:
> + case VARYING_SLOT_TESS_LEVEL_OUTER:
> + case VARYING_SLOT_TESS_LEVEL_INNER:
> return GL_FALSE;
> default:
> return GL_TRUE;
> @@ -2140,7 +2146,7 @@ typedef enum
> * \name Geometry shader system values
> */
> /*@{*/
> - SYSTEM_VALUE_INVOCATION_ID,
> + SYSTEM_VALUE_INVOCATION_ID, /**< (Also in Tessellation Control shader) */
> /*@}*/
>
> /**
> @@ -2153,6 +2159,13 @@ typedef enum
> SYSTEM_VALUE_SAMPLE_MASK_IN,
> /*@}*/
>
> + /**
> + * \name Tessellation Evaluation shader system values
> + */
> + /*@{*/
> + SYSTEM_VALUE_TESS_COORD,
> + /*@}*/
> +
This hunk and the previous hunk should get merged with the hunk in patch
19. I don't think it matters much whether they go to 19 or 19 comes here.
> SYSTEM_VALUE_MAX /**< Number of values */
> } gl_system_value;
>
> diff --git a/src/mesa/program/prog_print.c b/src/mesa/program/prog_print.c
> index 475e241..26881e8 100644
> --- a/src/mesa/program/prog_print.c
> +++ b/src/mesa/program/prog_print.c
> @@ -147,6 +147,8 @@ arb_input_attrib_string(GLint index, GLenum progType)
> "fragment.(twenty-one)", /* VARYING_SLOT_VIEWPORT */
> "fragment.(twenty-two)", /* VARYING_SLOT_FACE */
> "fragment.(twenty-three)", /* VARYING_SLOT_PNTC */
> + "fragment.(twenty-four)", /* VARYING_SLOT_TESS_LEVEL_OUTER */
> + "fragment.(twenty-five)", /* VARYING_SLOT_TESS_LEVEL_INNER */
> "fragment.varying[0]",
> "fragment.varying[1]",
> "fragment.varying[2]",
> @@ -272,6 +274,8 @@ arb_output_attrib_string(GLint index, GLenum progType)
> "result.(twenty-one)", /* VARYING_SLOT_VIEWPORT */
> "result.(twenty-two)", /* VARYING_SLOT_FACE */
> "result.(twenty-three)", /* VARYING_SLOT_PNTC */
> + "result.(twenty-four)", /* VARYING_SLOT_TESS_LEVEL_OUTER */
> + "result.(twenty-five)", /* VARYING_SLOT_TESS_LEVEL_INNER */
> "result.varying[0]",
> "result.varying[1]",
> "result.varying[2]",
>
More information about the mesa-dev
mailing list