[Piglit] [PATCH] arb_shader_image_load_store: basic imageStore using a uniform

Francisco Jerez currojerez at riseup.net
Thu Dec 4 02:34:10 PST 2014


Jordan Justen <jordan.l.justen at intel.com> writes:

> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> Cc: Francisco Jerez <currojerez at riseup.net>
> ---
> Francisco,
>
> I was looking at your image-load-store branch. I noticed using
> imageStore directly from a uniform results in:
>
> brw_ir_svec4.h:94: brw::array_reg<R> brw::half(const brw::array_reg<R>&, unsigned int) [with R = fs_reg]: Assertion `reg_width(storage(reg)) == 16' failed.

Thanks, this looks useful to me,

Reviewed-by: Francisco Jerez <currojerez at riseup.net>

For a fix you need something like this BTW:
http://lists.freedesktop.org/archives/mesa-dev/2014-December/071872.html

I've just back-ported it to my image-load-store branch.

>
> -Jordan
>
>  .../basic-imageStore-from-uniform.shader_test      | 56 ++++++++++++++++++++++
>  1 file changed, 56 insertions(+)
>  create mode 100644 tests/spec/arb_shader_image_load_store/execution/basic-imageStore-from-uniform.shader_test
>
> diff --git a/tests/spec/arb_shader_image_load_store/execution/basic-imageStore-from-uniform.shader_test b/tests/spec/arb_shader_image_load_store/execution/basic-imageStore-from-uniform.shader_test
> new file mode 100644
> index 0000000..802eda0
> --- /dev/null
> +++ b/tests/spec/arb_shader_image_load_store/execution/basic-imageStore-from-uniform.shader_test
> @@ -0,0 +1,56 @@
> +# Verify simple reading of a uniform and output to an image
> +
> +[require]
> +GL >= 3.3
> +GLSL >= 3.30
> +GL_ARB_shader_image_load_store
> +
> +[vertex shader]
> +#version 130
> +in vec4 piglit_vertex;
> +
> +void main()
> +{
> +	gl_Position = piglit_vertex;
> +}
> +
> +[fragment shader]
> +#version 330
> +#extension GL_ARB_shader_image_load_store: enable
> +
> +uniform vec4 color;
> +writeonly uniform image2D tex;
> +out vec4 outcolor;
> +
> +void main()
> +{
> +	imageStore(tex, ivec2(gl_FragCoord.xy), color);
> +	outcolor = vec4(0.0, 0.0, 0.0, 1.0);
> +}
> +
> +[test]
> +# Texture 0 is the imageStore output.
> +uniform int tex 0
> +texture rgbw 0 (16, 16)
> +image texture 0
> +
> +# Texture 1 is the rendering output. We don't care about this.
> +texture rgbw 1 (16, 16)
> +
> +# Store red using imageStore
> +uniform vec4 color 1.0 0.0 0.0 1.0
> +fb tex 2d 1
> +draw rect -1 -1 2 2
> +
> +# Test the result of imageStore
> +fb tex 2d 0
> +probe all rgba 1.0 0.0 0.0 1.0
> +
> +# Store green using imageStore
> +uniform vec4 color 0.0 1.0 0.0 1.0
> +fb tex 2d 1
> +draw rect -1 -1 2 2
> +
> +# Test the result of imageStore
> +fb tex 2d 0
> +probe all rgba 0.0 1.0 0.0 1.0
> -- 
> 2.1.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20141204/e59344d1/attachment.sig>


More information about the Piglit mailing list