aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gall <tom.gall@linaro.org>2013-04-25 14:52:03 -0500
committerTom Gall <tom.gall@linaro.org>2013-04-25 14:52:03 -0500
commit989261fc35a895d880914fb015de434bb9cca49b (patch)
tree1bc52f5530b28d3c5f86e9cfbe0759eb0cc315ad
parent7041bc24ec5b047546dca968810f5cffe9931157 (diff)
parent02b8d6ae7a58abea2ac905bd67a960cbaa0231cb (diff)
downloadpiglit-gles2-all.tar.gz
Merge branch 'more-glsl-es-compiler' into gles2-allgles2-all
Conflicts: generated_tests/CMakeLists.txt
-rw-r--r--generated_tests/CMakeLists.txt4
-rwxr-xr-xgenerated_tests/outerProduct-invalid-parameters.sh91
-rw-r--r--tests/spec/glsl-es-1.00/compiler/built-in-functions/outerProduct-vec2.vert12
3 files changed, 107 insertions, 0 deletions
diff --git a/generated_tests/CMakeLists.txt b/generated_tests/CMakeLists.txt
index c0950d18..ee7d419e 100644
--- a/generated_tests/CMakeLists.txt
+++ b/generated_tests/CMakeLists.txt
@@ -82,6 +82,9 @@ piglit_make_sh_generated_tests(
piglit_make_sh_generated_tests(
variable-index-write-120_tests.list
variable-index-write.sh 1.20)
+piglit_make_sh_generated_tests(
+ outerProduct-invalid-parameters_tests.list
+ outerProduct-invalid-parameters.sh 3.00)
# Add a "gen-tests" target that can be used to generate all the
# tests without doing any other compilation.
@@ -92,6 +95,7 @@ add_custom_target(gen-tests ALL
builtin_cl_int_tests.list
interpolation_tests.list
non-lvalue_tests.list
+ outerProduct-invalid-parameters_tests.list
texture_query_lod_tests.list
uniform-initializer_tests.list
variable-index-read-100_tests.list
diff --git a/generated_tests/outerProduct-invalid-parameters.sh b/generated_tests/outerProduct-invalid-parameters.sh
new file mode 100755
index 00000000..7def598f
--- /dev/null
+++ b/generated_tests/outerProduct-invalid-parameters.sh
@@ -0,0 +1,91 @@
+#!/bin/bash
+
+function emit_vs
+{
+ targetdir=$1
+ t=$2
+
+ echo "$targetdir/outerProduct-$t.vert"
+ cat > $targetdir/outerProduct-$t.vert <<EOF
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.00
+ * [end config]
+ * outerProduct is available in OpenGL SL ES 3.00 but
+ * not for all data types.
+ *
+ * http://www.khronos.org/opengles/sdk/docs/manglsl/xhtml/outerProduct.xml
+ */
+void main () {
+ gl_Position = vec4(0);
+ outerProduct(${t}(0), ${t}(0));
+}
+EOF
+}
+
+function emit_valid_vs
+{
+ targetdir=$1
+ t=$2
+
+ echo "$targetdir/outerProduct-$t.vert"
+ cat > $targetdir/outerProduct-$t.vert <<EOF
+/* [config]
+ * expect_result: pass
+ * glsl_version: 3.00
+ * [end config]
+ * outerProduct is available in OpenGL SL ES 3.00.
+ * not for all data types.
+ *
+ * http://www.khronos.org/opengles/sdk/docs/manglsl/xhtml/outerProduct.xml
+ */
+void main () {
+ gl_Position = vec4(0);
+ outerProduct(${t}(0), ${t}(0));
+}
+EOF
+}
+
+function emit_valid_mixed_vs
+{
+ targetdir=$1
+ t=$2
+ u=$3
+
+ echo "$targetdir/outerProduct-$t.vert"
+ cat > $targetdir/outerProduct-$t.vert <<EOF
+/* [config]
+ * expect_result: pass
+ * glsl_version: 3.00
+ * [end config]
+ * outerProduct is available in OpenGL SL ES 3.00.
+ * not for all data types.
+ *
+ * http://www.khronos.org/opengles/sdk/docs/manglsl/xhtml/outerProduct.xml
+ */
+void main () {
+ gl_Position = vec4(0);
+ outerProduct(${t}(0), ${u}(0));
+}
+EOF
+}
+
+set +x
+
+targetdir="spec/glsl-es-3.00/compiler/built-in-functions"
+mkdir -p $targetdir
+
+for i in int float bool bvec2 bvec3 bvec4 mat2 mat2x2 mat2x3 mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4
+do
+ emit_vs $targetdir $i
+done
+for i in vec2 vec3 vec4
+do
+ emit_valid_vs $targetdir $i
+done
+emit_valid_mixed_vs $targetdir vec3 vec2
+emit_valid_mixed_vs $targetdir vec2 vec3
+emit_valid_mixed_vs $targetdir vec4 vec2
+emit_valid_mixed_vs $targetdir vec4 vec3
+emit_valid_mixed_vs $targetdir vec2 vec4
+emit_valid_mixed_vs $targetdir vec3 vec4
diff --git a/tests/spec/glsl-es-1.00/compiler/built-in-functions/outerProduct-vec2.vert b/tests/spec/glsl-es-1.00/compiler/built-in-functions/outerProduct-vec2.vert
new file mode 100644
index 00000000..bcdac9e9
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/built-in-functions/outerProduct-vec2.vert
@@ -0,0 +1,12 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ * outerProduct is not available in OpenGL SL 1.00. It is
+ * available in OpenGL SL 3.00.
+ * http://www.khronos.org/opengles/sdk/docs/manglsl/xhtml/outerProduct.xml
+ */
+void main () {
+ gl_Position = vec4(0);
+ outerProduct(vec2(0), vec2(0));
+}