summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-08-25 12:15:02 +1000
committerMarek Olšák <marek.olsak@amd.com>2017-09-27 13:26:16 +0200
commitc3e0585feab5629a565273604043116bb8caf1a2 (patch)
tree4e8fb4cb4a866916f2d7d21cf9a6766dae113d29
parent674109085192aa69d032a21c04c0bca61b8f97ea (diff)
image_load_store: add a new test for a bug seen on AMD VEGA.
This is ported from a vulkan cts test showing the same brokenness. Signed-off-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r--tests/spec/arb_shader_image_load_store/execution/image_checkerboard.shader_test67
1 files changed, 67 insertions, 0 deletions
diff --git a/tests/spec/arb_shader_image_load_store/execution/image_checkerboard.shader_test b/tests/spec/arb_shader_image_load_store/execution/image_checkerboard.shader_test
new file mode 100644
index 000000000..b8d67b0ac
--- /dev/null
+++ b/tests/spec/arb_shader_image_load_store/execution/image_checkerboard.shader_test
@@ -0,0 +1,67 @@
+# This is a port of one of the Vulkan CTS tests to piglit GL
+# to test a bug seen developing radv for vega.
+#
+# dEQP-VK.binding_model.shader_access.primary_cmd_buf.storage_image.fragment.single_descriptor.2d
+# it isn't a direct port but it shows the same bug.
+#
+# This just copies 4 squares from the image into the final image and probes them.
+# On vega some bits are corrupted.
+[require]
+GL >= 3.3
+GLSL >= 3.30
+GL_ARB_shader_image_load_store
+SIZE 256 256
+
+[vertex shader]
+#version 330
+flat out highp int frag_quadrant_id;
+void main (void)
+{
+ highp vec4 result_position;
+ highp int quadrant_id;
+ highp int quadPhase = gl_VertexID % 6;
+ highp int quadXcoord = int(quadPhase == 1 || quadPhase == 4 || quadPhase == 5);
+ highp int quadYcoord = int(quadPhase == 2 || quadPhase == 3 || quadPhase == 5);
+ highp int quadOriginX = (gl_VertexID / 6) % 2;
+ highp int quadOriginY = (gl_VertexID / 6) / 2;
+ quadrant_id = gl_VertexID / 6;
+ result_position = vec4(float(quadOriginX + quadXcoord - 1), float(quadOriginY + quadYcoord - 1), 0.0, 1.0);
+ gl_Position = result_position;
+ frag_quadrant_id = quadrant_id;
+}
+
+
+[fragment shader]
+#version 330
+#extension GL_ARB_shader_image_load_store: enable
+
+layout(rgba8) readonly uniform highp image2D u_image;
+flat in highp int frag_quadrant_id;
+out mediump vec4 o_color;
+void main (void)
+{
+ highp int quadrant_id = frag_quadrant_id;
+ highp vec4 result_color;
+ if (quadrant_id == 0)
+ result_color = imageLoad(u_image, ivec2(6, 13));
+ else if (quadrant_id == 1)
+ result_color = imageLoad(u_image, ivec2(51, 40));
+ else if (quadrant_id == 2)
+ result_color = imageLoad(u_image, ivec2(42, 26));
+ else
+ result_color = imageLoad(u_image, ivec2(25, 35));
+ o_color.xyzw = result_color.xyzw;
+}
+
+[test]
+# Use textures that are large enough to actually trigger the use
+# of compression.
+texture rgbw 0 (64, 64) GL_RGBA8
+image texture 0 GL_RGBA8
+
+draw arrays GL_TRIANGLES 0 24
+probe rect rgba (0, 0, 128, 128) (1.0, 0.0, 0.0, 1.0)
+probe rect rgba (128, 0, 128, 128) (1.0, 1.0, 1.0, 1.0)
+probe rect rgba (0, 128, 128, 128) (0.0, 1.0, 0.0, 1.0)
+probe rect rgba (128, 128, 128, 128) (0.0, 0.0, 1.0, 1.0)
+