[Piglit] [PATCH] ARB_shader_image_load_store: Test loading from a cleared image

Ilia Mirkin imirkin at alum.mit.edu
Fri Sep 4 11:47:14 PDT 2015


On Fri, Sep 4, 2015 at 2:26 PM, Jordan Justen <jordan.l.justen at intel.com> wrote:
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> Cc: Francisco Jerez <currojerez at riseup.net>
> ---
>  .../execution/load-from-cleared-image.shader_test  | 77 ++++++++++++++++++++++
>  1 file changed, 77 insertions(+)
>  create mode 100644 tests/spec/arb_shader_image_load_store/execution/load-from-cleared-image.shader_test
>
> diff --git a/tests/spec/arb_shader_image_load_store/execution/load-from-cleared-image.shader_test b/tests/spec/arb_shader_image_load_store/execution/load-from-cleared-image.shader_test
> new file mode 100644
> index 0000000..abecfb4
> --- /dev/null
> +++ b/tests/spec/arb_shader_image_load_store/execution/load-from-cleared-image.shader_test
> @@ -0,0 +1,77 @@
> +# Tests loading from an image just after clearing the image texture
> +#
> +[require]
> +GL >= 3.3
> +GLSL >= 3.30
> +GL_ARB_shader_image_load_store
> +
> +[vertex shader]

[vertex shader passthrough]

> +#version 130
> +in vec4 piglit_vertex;
> +
> +void main()
> +{
> +       gl_Position = piglit_vertex;
> +}
> +
> +[fragment shader]
> +#version 330

Could you remake this for version 130? The ext only requires GL 3.0,
and there's nothing in here that seems to need anything introduced in
GL 3.3. If you really need a core context for some reason, use GL 3.1.

This isn't purely academic, btw. Adreno a3xx hardware may be capable
of some of this stuff but doesn't have GS (so no GL 3.2). Also we may
end up doing this before GS on a4xx (for a GLES 3.1 target).

The changes should be pretty minor, just use gl_FragColor instead of
the outcolor.

> +#extension GL_ARB_shader_image_load_store: enable
> +
> +uniform vec4 color;
> +layout(rgba8) readonly uniform image2D src;
> +out vec4 outcolor;
> +
> +void main()
> +{
> +       ivec2 coord = ivec2(gl_FragCoord);
> +       if (imageLoad(src, coord) == color)
> +               outcolor = vec4(0.0, 1.0, 0.0, 1.0);
> +       else
> +               outcolor = vec4(1.0, 0.0, 0.0, 1.0);
> +}
> +
> +[test]
> +# Setup src image
> +texture rgbw 0 (16, 16) GL_RGBA8
> +uniform int src 0
> +image texture 0 GL_RGBA8
> +
> +# Texture 1 is the rendering output
> +texture rgbw 1 (16, 16) GL_RGBA8
> +
> +
> +# Clear the src image that we will be loading from
> +uniform vec4 color 0.0 0.0 0.0 0.0
> +clear color 0.0 0.0 0.0 0.0
> +fb tex 2d 0
> +clear
> +
> +# Test using image loads of the cleared texture
> +fb tex 2d 1
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
> +
> +
> +# Clear the src image that we will be loading from
> +uniform vec4 color 1.0 0.0 1.0 0.0
> +clear color 1.0 0.0 1.0 0.0
> +fb tex 2d 0
> +clear
> +
> +# Test using image loads of the cleared texture
> +fb tex 2d 1
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
> +
> +
> +# Clear the src image that we will be loading from
> +uniform vec4 color 0.0 1.0 0.0 1.0
> +clear color 0.0 1.0 0.0 1.0
> +fb tex 2d 0
> +clear
> +
> +# Test using image loads of the cleared texture
> +fb tex 2d 1
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
> --
> 2.5.0
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list