[Piglit] [PATCH 03/11] mesa_shader_integer_functions: Clone arb_gpu_shader5 overloads test

Ian Romanick idr at freedesktop.org
Wed Jun 29 21:23:03 UTC 2016


From: Ian Romanick <ian.d.romanick at intel.com>

    cd tests/spec/mesa_shader_integer_functions/execution
    cp ../../arb_gpu_shader5/execution/overloads.shader_test .
    sed --in-place -e 's/1[.]50/1.30/g;s/150/130/g' \
        -e 's/ARB_gpu_shader5/MESA_shader_integer_functions/g' \
	overloads.shader_test

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 .../execution/overloads.shader_test                | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 tests/spec/mesa_shader_integer_functions/execution/overloads.shader_test

diff --git a/tests/spec/mesa_shader_integer_functions/execution/overloads.shader_test b/tests/spec/mesa_shader_integer_functions/execution/overloads.shader_test
new file mode 100644
index 0000000..bdd7703
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/execution/overloads.shader_test
@@ -0,0 +1,39 @@
+[require]
+GLSL >= 1.30
+GL_MESA_shader_integer_functions
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 130
+#extension GL_MESA_shader_integer_functions : enable
+
+// Test overload resolution where all candidates require implicit
+// conversions. Under unextended GLSL 1.30, resolution is ambiguous,
+// since both functions require implicit conversions.
+
+out vec4 result;
+
+void foo(float x, int y, float z)
+{
+	result = vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+void foo(float x, int y, int z)
+{
+	/* better for `z` */
+	result = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+void main()
+{
+	int a = 0;
+	int b = 1;
+	int c = 2;
+
+	foo(a, b, c);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.5.5



More information about the Piglit mailing list