From: Nicolai Hähnle <nicolai.haeh...@amd.com>

This exercises a required DCC decompression path for Radeon VI.
---
 .../execution/write-to-rendered-image.shader_test  | 73 ++++++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 
tests/spec/arb_shader_image_load_store/execution/write-to-rendered-image.shader_test

diff --git 
a/tests/spec/arb_shader_image_load_store/execution/write-to-rendered-image.shader_test
 
b/tests/spec/arb_shader_image_load_store/execution/write-to-rendered-image.shader_test
new file mode 100644
index 0000000..6976c85
--- /dev/null
+++ 
b/tests/spec/arb_shader_image_load_store/execution/write-to-rendered-image.shader_test
@@ -0,0 +1,73 @@
+# Verify that after a texture has been rendered to, image stores and loads
+# work correctly.
+#
+# The intention is to check interactions with compression buffers; in
+# particular, this exercises a required decompression path with DCC on
+# Radeon VI+
+
+[require]
+GL >= 3.3
+GLSL >= 3.30
+GL_ARB_shader_image_load_store
+SIZE 256 256
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 330
+#extension GL_ARB_shader_image_load_store: enable
+
+uniform int read;
+uniform int write;
+uniform vec4 color;
+layout(rgba8) uniform image2D imgRead;
+writeonly uniform image2D imgWrite;
+out vec4 outcolor;
+
+void main()
+{
+       ivec2 coords = ivec2(gl_FragCoord.xy);
+
+       if (read != 0)
+               outcolor = imageLoad(imgRead, coords);
+       else
+               outcolor = color;
+
+       if (write != 0)
+               imageStore(imgWrite, coords, color);
+}
+
+[test]
+# Use textures that are large enough to actually trigger the use
+# of compression.
+texture rgbw 0 (256, 256) GL_RGBA8
+image texture 0 GL_RGBA8
+texture rgbw 1 (256, 256) GL_RGBA8
+image texture 1 GL_RGBA8
+
+# Draw red to texture 1
+uniform int read 0
+uniform int write 0
+uniform int imgRead 0
+uniform int imgWrite 0
+uniform vec4 color 1.0 0.0 0.0 1.0
+fb tex 2d 1
+draw rect -1 -1 2 2
+
+# Store green to texture 1
+uniform int read 0
+uniform int write 1
+uniform int imgRead 1
+uniform int imgWrite 1
+uniform vec4 color 0.0 1.0 0.0 1.0
+fb tex 2d 0
+draw rect -1 -1 2 2
+
+memory barrier GL_TEXTURE_FETCH_BARRIER_BIT
+
+# Read from texture 1
+uniform int read 1
+uniform int write 0
+draw rect -1 -1 2 2
+
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.5.0

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to