Module: Mesa Branch: image-store-array Commit: 875cf5e1c6d9159627a75f8419669b72cf8576ff URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=875cf5e1c6d9159627a75f8419669b72cf8576ff
Author: Dave Airlie <[email protected]> Date: Tue Jun 16 16:30:07 2020 +1000 arb_shader_image_load_store: test storing to two different image formats. This is a corner case I needed to handle in llvmpipe. --- .../execution/imageStore-array.shader_test | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/tests/spec/arb_shader_image_load_store/execution/imageStore-array.shader_test b/tests/spec/arb_shader_image_load_store/execution/imageStore-array.shader_test new file mode 100644 index 00000000000..f232e9f3427 --- /dev/null +++ b/tests/spec/arb_shader_image_load_store/execution/imageStore-array.shader_test @@ -0,0 +1,81 @@ +# Verify writing storing to images with different formats in array works + +[require] +GL >= 3.3 +GLSL >= 3.30 +GL_ARB_shader_image_load_store +GL_ARB_gpu_shader5 + +[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; +uniform int idx; +writeonly uniform image2D tex[2]; +out vec4 outcolor; + +void main() +{ + imageStore(tex[idx], 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) GL_RGBA8 +image texture 0 GL_RGBA8 + +uniform int tex 1 +texture rgbw 1 (16, 16) GL_RGBA32F +image texture 1 GL_RGBA32F + +# Texture 2 is the rendering output. We don't care about this. +texture rgbw 2 (16, 16) GL_RGBA8 + +# Store red using imageStore +uniform vec4 color 1.0 0.0 0.0 1.0 +uniform int idx 0 +fb tex 2d 2 +draw rect -1 -1 2 2 + +uniform vec4 color 1.0 0.0 0.0 1.0 +uniform int idx 1 +fb tex 2d 2 +draw rect -1 -1 2 2 + +# Test the result of imageStore +memory barrier GL_FRAMEBUFFER_BARRIER_BIT +fb tex 2d 0 +probe all rgba 1.0 0.0 0.0 1.0 + +fb tex 2d 1 +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 +uniform int idx 0 +fb tex 2d 2 +draw rect -1 -1 2 2 + +uniform vec4 color 0.0 1.0 0.0 1.0 +uniform int idx 1 +fb tex 2d 2 +draw rect -1 -1 2 2 + +# Test the result of imageStore +memory barrier GL_FRAMEBUFFER_BARRIER_BIT +fb tex 2d 0 +probe all rgba 0.0 1.0 0.0 1.0 +fb tex 2d 1 +probe all rgba 0.0 1.0 0.0 1.0 _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
