[Piglit] [PATCH] arb_shader_storage_buffer_object: Test copying a large SSBO item

Iago Toral itoral at igalia.com
Fri Nov 20 02:58:35 PST 2015


Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>

If the only point of this test is to reproduce the link failure, notice
that it is sufficient to do this:

[fragment shader]
#version 330
#extension GL_ARB_shader_storage_buffer_object: require

#define SIZE 16

layout (std430) buffer SSBO {
    mat4 m1[SIZE];
    mat4 m2[SIZE];
};

void main() {
    m2 = m1;
}

I'll send a separate e-mail to mesa-dev to discuss the underlying
problem.

Iago

On Thu, 2015-11-19 at 17:23 -0800, Jordan Justen wrote:
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> Cc: Kristian Høgsberg <krh at bitplanet.net>
> Cc: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
> Cc: Iago Toral Quiroga <itoral at igalia.com>
> ---
>  This fails to link on i965.
> 
>  .../execution/large-field-copy.shader_test         | 66 ++++++++++++++++++++++
>  1 file changed, 66 insertions(+)
>  create mode 100644 tests/spec/arb_shader_storage_buffer_object/execution/large-field-copy.shader_test
> 
> diff --git a/tests/spec/arb_shader_storage_buffer_object/execution/large-field-copy.shader_test b/tests/spec/arb_shader_storage_buffer_object/execution/large-field-copy.shader_test
> new file mode 100644
> index 0000000..a949507
> --- /dev/null
> +++ b/tests/spec/arb_shader_storage_buffer_object/execution/large-field-copy.shader_test
> @@ -0,0 +1,66 @@
> +# Test that a 'large' field of an SSBO can be copied.
> +
> +[require]
> +GL >= 3.3
> +GLSL >= 3.30
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader passthrough]
> +
> +[fragment shader]
> +#version 330
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +#define SIZE 16
> +
> +layout (std430) buffer SSBO {
> +    mat4 m1[SIZE];
> +    mat4 m2[SIZE];
> +};
> +
> +out vec4 color;
> +
> +uniform uint mode;
> +
> +void main() {
> +    bool pass = true;
> +    int i;
> +
> +    switch (mode) {
> +    case 0u:
> +        for (i = 0; i < SIZE; i++) {
> +	    m1[i] = mat4(vec4(i + 0), vec4(i + 1),
> +	                 vec4(i + 2), vec4(i + 3));
> +	}
> +	break;
> +    case 1u:
> +        m2 = m1;
> +	break;
> +    case 2u:
> +        for (i = 0; i < SIZE; i++) {
> +	    pass = pass && (m2[i] == mat4(vec4(i + 0), vec4(i + 1),
> +	                                  vec4(i + 2), vec4(i + 3)));
> +	}
> +	break;
> +    }
> +
> +    if (pass)
> +        color = vec4(0.0, 1.0, 0.0, 1.0);
> +    else
> +        color = vec4(1.0, 0.0, 0.0, 1.0);
> +}
> +
> +[test]
> +ssbo 2048
> +
> +uniform uint mode 0
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
> +
> +uniform uint mode 1
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
> +
> +uniform uint mode 2
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0




More information about the Piglit mailing list