[Piglit] [PATCH] arb_program_interface_query: add linker test for querying varyings

Ilia Mirkin imirkin at alum.mit.edu
Fri Sep 25 00:17:18 PDT 2015


On Fri, Sep 25, 2015 at 3:09 AM, Tapani Pälli <tapani.palli at intel.com> wrote:
> This fails with current Mesa due to a bug in commit:
>         4639cea2921669527eb43dcb49724c05afb27e8e
>
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>  .../linker/query-varyings.shader_test              | 33 ++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
>  create mode 100644 tests/spec/arb_program_interface_query/linker/query-varyings.shader_test
>
> diff --git a/tests/spec/arb_program_interface_query/linker/query-varyings.shader_test b/tests/spec/arb_program_interface_query/linker/query-varyings.shader_test
> new file mode 100644
> index 0000000..01acee5
> --- /dev/null
> +++ b/tests/spec/arb_program_interface_query/linker/query-varyings.shader_test
> @@ -0,0 +1,33 @@
> +# Tests that we can succesfully query properties of varyings
> +# that have interface GL_PROGRAM_INPUT in fragment stage.
> +#
> +# This tests that possible optimization for packing variables
> +# does not loose information about individual variables.

lose = opposite of find
loose = opposite of tight

> +#
> +[require]
> +GLSL >= 1.10
> +GL_ARB_program_interface_query
> +
> +[vertex shader]
> +#version 110
> +varying float r, g, b;
> +void main()
> +{
> +       r = 1.0;
> +       g = 0.0;
> +       b = 1.0;
> +       gl_Position = vec4(0.0);
> +}
> +
> +[fragment shader]
> +#version 110
> +varying float r, g, b;
> +void main()
> +{
> +       gl_FragColor = vec4(r, g, b, 1.0);
> +}
> +
> +[test]
> +verify program_interface_query GL_PROGRAM_INPUT r GL_ARRAY_SIZE 1
> +verify program_interface_query GL_PROGRAM_INPUT g GL_TYPE GL_FLOAT
> +verify program_interface_query GL_PROGRAM_INPUT b GL_REFERENCED_BY_FRAGMENT_SHADER 1

I can't say I've gotten to know the piq interface that well, but this
seems plausible. My one point of confusion is how it knows that this
is about the frag shader, and not, say, geometry or tess stages.
Assuming this little bit is easily explainable,

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>


More information about the Piglit mailing list