[Piglit] [PATCH] Add EXT_shader_integer_mix tests for booleans in if statements.
Kenneth Graunke
kenneth at whitecape.org
Fri Aug 22 11:46:25 PDT 2014
This trips up a i965 bug where we forgot to handle ir_triop_csel in
emit_bool_to_cond_code.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
.../execution/fs-mix-if-bool.shader_test | 30 +++++++++++++++++
.../execution/vs-mix-if-bool.shader_test | 38 ++++++++++++++++++++++
2 files changed, 68 insertions(+)
create mode 100644 tests/spec/ext_shader_integer_mix/execution/fs-mix-if-bool.shader_test
create mode 100644 tests/spec/ext_shader_integer_mix/execution/vs-mix-if-bool.shader_test
diff --git a/tests/spec/ext_shader_integer_mix/execution/fs-mix-if-bool.shader_test b/tests/spec/ext_shader_integer_mix/execution/fs-mix-if-bool.shader_test
new file mode 100644
index 0000000..50a27b8
--- /dev/null
+++ b/tests/spec/ext_shader_integer_mix/execution/fs-mix-if-bool.shader_test
@@ -0,0 +1,30 @@
+[require]
+GLSL >= 1.30
+GL_EXT_shader_integer_mix
+
+[vertex shader passthrough]
+
+[fragment shader]
+#extension GL_EXT_shader_integer_mix: enable
+
+uniform bool a;
+uniform bool b;
+uniform bool selector;
+
+void main()
+{
+ if (mix(a, b, selector)) {
+ gl_FragColor = vec4(0, 1, 0, 1);
+ } else {
+ gl_FragColor = vec4(1, 0, 0, 1);
+ }
+}
+
+[test]
+uniform int a 1
+uniform int b 0
+uniform int selector 0
+
+draw rect -1 -1 2 2
+probe all rgba 0 1 0 1
+
diff --git a/tests/spec/ext_shader_integer_mix/execution/vs-mix-if-bool.shader_test b/tests/spec/ext_shader_integer_mix/execution/vs-mix-if-bool.shader_test
new file mode 100644
index 0000000..c71b75b
--- /dev/null
+++ b/tests/spec/ext_shader_integer_mix/execution/vs-mix-if-bool.shader_test
@@ -0,0 +1,38 @@
+[require]
+GLSL >= 1.30
+GL_EXT_shader_integer_mix
+
+[vertex shader]
+#extension GL_EXT_shader_integer_mix: enable
+out vec4 color;
+
+uniform bool a;
+uniform bool b;
+uniform bool selector;
+
+void main()
+{
+ if (mix(a, b, selector)) {
+ color = vec4(0, 1, 0, 1);
+ } else {
+ color = vec4(1, 0, 0, 1);
+ }
+ gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+in vec4 color;
+
+void main()
+{
+ gl_FragColor = color;
+}
+
+[test]
+uniform int a 1
+uniform int b 0
+uniform int selector 0
+
+draw rect -1 -1 2 2
+probe all rgba 0 1 0 1
+
--
2.0.2
More information about the Piglit
mailing list