[Piglit] [PATCH 3/3] arb_program_interface_query: Fix TCS input expectations

Martin Peres martin.peres at linux.intel.com
Thu May 26 15:40:18 UTC 2016


On 26/05/16 01:36, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> Section 7.1 (Built-In Language Variables) of the GLSL 4.00 spec says:
>
>    In the tessellation control language, built-in variables are
>    intrinsically declared as:
>
>    in gl_PerVertex {
>       vec4 gl_Position;
>       float gl_PointSize;
>       float gl_ClipDistance[];
>    } gl_in[gl_MaxPatchVertices];
>
>    in int gl_PatchVerticesIn;
>    in int gl_PrimitiveID;
>    in int gl_InvocationID;
>
> Since gl_PointSize, gl_ClipDistance[], gl_PatchVerticesIn, and
> gl_PrimitiveID are not used, they are eliminated.

You are right, I should not mandate for them to be available since the 
compiler should be free to get rid of them even if I use SSO as they are 
merely inputs.

Reviewed-by: Martin Peres <martin.peres at linux.intel.com>

>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> Cc: Martin Peres <martin.peres at linux.intel.com>
> Cc: Dave Airlie <airlied at redhat.com>
> ---
>  .../arb_program_interface_query/resource-query.c   | 23 +++++++---------------
>  1 file changed, 7 insertions(+), 16 deletions(-)
>
> diff --git a/tests/spec/arb_program_interface_query/resource-query.c b/tests/spec/arb_program_interface_query/resource-query.c
> index d16c092..c4d190c 100755
> --- a/tests/spec/arb_program_interface_query/resource-query.c
> +++ b/tests/spec/arb_program_interface_query/resource-query.c
> @@ -211,25 +211,16 @@ static const char *st_r_in_vs[] = {"vs_input0", "vs_input1", NULL};
>  static const char *st_r_in_gs[] = {"gs_input[0]", "gl_PerVertex.gl_Position", NULL};
>  static const char *st_r_in_fs[] = {"fs_input1", NULL};
>  static const char *st_r_in_tes[] = {"tes_input[0]", "gl_PerVertex.gl_Position", NULL};
> -static const char *st_r_in_tcs[] = {"tcs_input[0]", "gl_PerVertex.gl_Position", NULL};
> +static const char *st_r_in_tcs[] = {"tcs_input[0]",
> +				    "gl_InvocationID",
> +				    "gl_PerVertex.gl_Position",
> +				    NULL};
>  static const char *st_r_out_vs[] = {"gl_Position", NULL};
>  static const char *st_r_out_gs[] = {"gs_output0", "gl_Position", NULL};
>  static const char *st_r_out_fs[] = {"fs_output0", "fs_output1", NULL};
>  static const char *st_r_out_tes[] = {"tes_output[0]", "gl_Position", NULL};
>  static const char *st_r_out_tcs[] = {"tcs_output[0]", "tcs_patch",
>  				     "gl_PerVertex.gl_Position",
> -				     "gl_PerVertex.gl_BackColor",
> -				     "gl_PerVertex.gl_BackSecondaryColor",
> -				     "gl_PerVertex.gl_ClipDistance[0]",
> -				     "gl_PerVertex.gl_CullDistance[0]",
> -				     "gl_PerVertex.gl_FogFragCoord",
> -				     "gl_PerVertex.gl_FrontColor",
> -				     "gl_PerVertex.gl_FrontSecondaryColor",
> -				     "gl_PerVertex.gl_Layer",
> -				     "gl_PerVertex.gl_PointSize",
> -				     "gl_PerVertex.gl_TexCoord[0]",
> -				     "gl_PerVertex.gl_ViewportIndex",
> -				     "gl_PerVertex.gl_ViewportMask[0]",
>  				     NULL};
>  static const char *st_r_buffer[] = {"vs_buf_var", "gs_buf_var", "fs_buf_var",
>  				    NULL};
> @@ -375,8 +366,8 @@ static const struct subtest_t subtests[] = {
>   ST( 2, 25, -1, -1,    NULL,    NULL,    NULL,  gs_std,  fs_std,   NULL, GL_PROGRAM_INPUT, "(gs,fs)", st_r_in_gs),
>   ST( 2, 10, -1, -1,  vs_std,    NULL,    NULL,  gs_std,  fs_std,   NULL, GL_PROGRAM_INPUT, "(vs,gs,fs)", st_r_in_vs),
>   ST( 2, 25, -1, -1,    NULL,    NULL, tes_sub,    NULL,    NULL,   NULL, GL_PROGRAM_INPUT, "(tes)", st_r_in_tes),
> - ST( 2, 25, -1, -1,    NULL, tcs_sub,    NULL,    NULL,    NULL,   NULL, GL_PROGRAM_INPUT, "(tcs)", st_r_in_tcs),
> - ST( 2, 25, -1, -1,    NULL, tcs_sub, tes_sub,    NULL,    NULL,   NULL, GL_PROGRAM_INPUT, "(tcs,tes)", st_r_in_tcs),
> + ST( 3, 25, -1, -1,    NULL, tcs_sub,    NULL,    NULL,    NULL,   NULL, GL_PROGRAM_INPUT, "(tcs)", st_r_in_tcs),
> + ST( 3, 25, -1, -1,    NULL, tcs_sub, tes_sub,    NULL,    NULL,   NULL, GL_PROGRAM_INPUT, "(tcs,tes)", st_r_in_tcs),
>   ST( 2, 10, -1, -1,  vs_std, tcs_sub, tes_sub,    NULL,    NULL,   NULL, GL_PROGRAM_INPUT, "(vs,tcs,tes)", st_r_in_vs),
>   ST( 0,  0, -1, -1,    NULL,    NULL,    NULL,    NULL,    NULL, cs_sub, GL_PROGRAM_INPUT, "(cs)", NULL),
>   ST( 1, 12, -1, -1,  vs_std,    NULL,    NULL,    NULL,    NULL,   NULL, GL_PROGRAM_OUTPUT, "(vs)", st_r_out_vs),
> @@ -387,7 +378,7 @@ static const struct subtest_t subtests[] = {
>   ST( 2, 11, -1, -1,    NULL,    NULL,    NULL,  gs_std,  fs_std,   NULL, GL_PROGRAM_OUTPUT, "(gs,fs)", st_r_out_fs),
>   ST( 2, 11, -1, -1,  vs_std,    NULL,    NULL,  gs_std,  fs_std,   NULL, GL_PROGRAM_OUTPUT, "(vs,gs,fs)", st_r_out_fs),
>   ST( 2, 14, -1, -1,    NULL,    NULL, tes_sub,    NULL,    NULL,   NULL, GL_PROGRAM_OUTPUT, "(tes)", st_r_out_tes),
> - ST(15, 36, -1, -1,    NULL, tcs_sub,    NULL,    NULL,    NULL,   NULL, GL_PROGRAM_OUTPUT, "(tcs)", st_r_out_tcs),
> + ST( 3, 25, -1, -1,    NULL, tcs_sub,    NULL,    NULL,    NULL,   NULL, GL_PROGRAM_OUTPUT, "(tcs)", st_r_out_tcs),
>   ST( 2, 14, -1, -1,    NULL, tcs_sub, tes_sub,    NULL,    NULL,   NULL, GL_PROGRAM_OUTPUT, "(tcs,tes)", st_r_out_tes),
>   ST( 2, 12, -1, -1,    NULL, tcs_sub, tes_sub,  gs_std,    NULL,   NULL, GL_PROGRAM_OUTPUT, "(tcs,tes,gs)", st_r_out_gs),
>   ST( 0,  0, -1, -1,    NULL,    NULL,    NULL,    NULL,    NULL, cs_sub, GL_PROGRAM_OUTPUT, "(cs)", st_r_cs_sub),
>


More information about the Piglit mailing list