[Piglit] [PATCH 6/6] arb_bindless_texture: add explicit-texture-binding.shader_test

Timothy Arceri tarceri at itsqueeze.com
Thu Apr 27 00:30:50 UTC 2017


On 27/04/17 08:52, Samuel Pitoiset wrote:
> Make sure it's allowed to pass a handle via the OpenGL API
> when the explicit binding qualifier is defined in the shader.
> 
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>   .../execution/explicit-texture-binding.shader_test | 28 ++++++++++++++++++++++
>   1 file changed, 28 insertions(+)
>   create mode 100644 tests/spec/arb_bindless_texture/execution/explicit-texture-binding.shader_test
> 
> diff --git a/tests/spec/arb_bindless_texture/execution/explicit-texture-binding.shader_test b/tests/spec/arb_bindless_texture/execution/explicit-texture-binding.shader_test
> new file mode 100644
> index 000000000..07e55a127
> --- /dev/null
> +++ b/tests/spec/arb_bindless_texture/execution/explicit-texture-binding.shader_test
> @@ -0,0 +1,28 @@
> +# In this test, set a wrong binding texture unit directly in the shader and
> +# pass a texture handle through the OpenGL API. The test shouldn't fail if
> +# the sampler is considered bindless (64-bit handle).
> +[require]
> +GL >= 4.2
> +GLSL >= 4.20
> +GL_ARB_bindless_texture
> +
> +[vertex shader passthrough]
> +
> +[fragment shader]
> +#version 420
> +#extension GL_ARB_bindless_texture: require
> +
> +layout (bindless_sampler, binding = 5) uniform sampler2D tex;
> +out vec4 finalColor;
> +
> +void main()
> +{
> +	finalColor = texture2D(tex, vec2(0, 0));
> +}
> +
> +[test]
> +texture rgbw 0 (16, 16)
> +resident texture 0
> +uniform handle tex 0
> +draw rect -1 -1 2 2
> +relative probe rgb (0.0, 0.0) (1.0, 0.0, 0.0)
> 

For completeness you could add a different texture to the binding 
defined in the shader first draw/test. Then switch using the api, draw 
and test.

With that change:

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>


More information about the Piglit mailing list