Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu>
---
 tests/bugs/texture-waw-hazard.shader_test | 36 +++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 tests/bugs/texture-waw-hazard.shader_test

diff --git a/tests/bugs/texture-waw-hazard.shader_test 
b/tests/bugs/texture-waw-hazard.shader_test
new file mode 100644
index 0000000..7af0d87
--- /dev/null
+++ b/tests/bugs/texture-waw-hazard.shader_test
@@ -0,0 +1,36 @@
+# This test triggers a WaW situation on Kepler+, where the color
+# output is stored in registers $r0..$r3, and if the texture results
+# are also stored there, we might forget a barrier before overwriting
+# those registers with the green color value.
+[require]
+GLSL >= 1.20
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 120
+uniform sampler2D tex;
+uniform bool false_val = false;
+
+void main()
+{
+       vec4 tex = texture2D(tex, vec2(0));
+       if (false_val) {
+               // Make sure that the texbar ends up in the false
+               // branch. A plain copy might get optimized into
+               // something that happens to work out.
+               gl_FragColor = 0.5 * tex;
+       } else {
+               gl_FragColor = vec4(0, 1, 0, 1);
+       }
+}
+
+[test]
+texture rgbw 0 ( 8 , 8 )
+
+clear color 0.1 0.1 0.1 0.1
+clear
+
+uniform int tex 0
+draw rect -1 -1 2 2
+probe all rgba 0 1 0 1
-- 
2.4.10

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

Reply via email to