[Piglit] [V3 1/4] ARB_explicit_uniform_location: test overlapping location within array
Anuj Phogat
anuj.phogat at gmail.com
Tue Mar 18 09:46:16 PDT 2014
On Mon, Mar 17, 2014 at 6:04 AM, Tapani Pälli <tapani.palli at intel.com> wrote:
> v2: fix style issues (Anuj)
> v3: change to be a shader-runner test (Ian)
>
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
> tests/all.py | 3 ++
> .../overlap-location-within-array.shader_test | 32 ++++++++++++++++++++++
> 2 files changed, 35 insertions(+)
> create mode 100644 tests/spec/arb_explicit_uniform_location/linker/overlap-location-within-array.shader_test
>
> diff --git a/tests/all.py b/tests/all.py
> index 6ae5220..aca9088 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -1928,6 +1928,9 @@ spec['ARB_explicit_uniform_location'] = arb_explicit_uniform_location
> import_glsl_parser_tests(arb_explicit_uniform_location,
> os.path.join(testsDir, 'spec', 'arb_explicit_uniform_location'),
> [''])
> +add_shader_test_dir(arb_explicit_uniform_location,
> + os.path.join(testsDir, 'spec', 'arb_explicit_uniform_location'),
> + recursive=True)
> add_plain_test(arb_explicit_uniform_location, 'arb_explicit_uniform_location-minmax')
> add_plain_test(arb_explicit_uniform_location, 'arb_explicit_uniform_location-boundaries')
> add_plain_test(arb_explicit_uniform_location, 'arb_explicit_uniform_location-array-elements')
> diff --git a/tests/spec/arb_explicit_uniform_location/linker/overlap-location-within-array.shader_test b/tests/spec/arb_explicit_uniform_location/linker/overlap-location-within-array.shader_test
> new file mode 100644
> index 0000000..f2ddcc6
> --- /dev/null
> +++ b/tests/spec/arb_explicit_uniform_location/linker/overlap-location-within-array.shader_test
> @@ -0,0 +1,32 @@
> +#
> +# Tests overlapping uniform location with array. Note that this test does
> +# not include testing for overlaps with unused uniform locations.
> +#
> +# The GL_ARB_explicit_uniform_location spec says:
> +# "No two default-block uniform variables in the program can have the same
> +# location, even if they are unused, otherwise a compiler or linker error
> +# will be generated"
> +
You can add another test where the variable with overlapping location
is in different shader unit.
> +[require]
> +GLSL >= 1.20
> +GL_ARB_explicit_uniform_location
> +
> +[vertex shader]
> +void main()
> +{
> + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
> +}
You can replace the whole vertex shader with:
[vertex shader passthrough]
> +
> +[fragment shader]
> +#version 120
> +#extension GL_ARB_explicit_uniform_location: require
> +layout(location = 0) uniform float a[16];
> +layout(location = 2) uniform float r;
> +
> +void main()
> +{
> + gl_FragColor = vec4(r, 1.0, 1.0, a[a.length() - 1]);
> +}
> +
> +[test]
> +link error
> --
> 1.8.3.1
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pigli
More information about the Piglit
mailing list