aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gall <tom.gall@linaro.org>2013-04-23 13:48:28 -0500
committerTom Gall <tom.gall@linaro.org>2013-04-23 13:48:28 -0500
commitc4ef209c142adfdcab0cc6e0f4f59545e30163d2 (patch)
treea094dbdaf57c1621a9c064b3c9c23b51066d73b5
parent763d1cf88804b752c20cc9aaaa351f838e0fd0ba (diff)
update variable-index-read.sh and variable-index-write.sh to
support android with precision default settings and glsl es 1.00
-rwxr-xr-xtests/spec/glsl-1.10/variable-index-read.sh20
-rwxr-xr-xtests/spec/glsl-1.10/variable-index-write.sh37
2 files changed, 43 insertions, 14 deletions
diff --git a/tests/spec/glsl-1.10/variable-index-read.sh b/tests/spec/glsl-1.10/variable-index-read.sh
index 80cb078d..da1fc2df 100755
--- a/tests/spec/glsl-1.10/variable-index-read.sh
+++ b/tests/spec/glsl-1.10/variable-index-read.sh
@@ -164,11 +164,18 @@ function emit_vs
fi
echo "[vertex shader]"
+ echo "attribute vec4 vertex;"
+ echo "mat4 projection = mat4("
+ echo " 2.0/250.0, 0.0, 0.0, -1.0,"
+ echo " 0.0, 2.0/250.0, 0.0, -1.0,"
+ echo " 0.0, 0.0, -1.0, 0.0,"
+ echo " 0.0, 0.0, 0.0, 1.0);"
emit_globals $*
echo "void main()"
echo "{"
- echo " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
+ echo " gl_Position = vertex;"
+ echo " gl_Position *= projection;"
# Only emit the code to set the matrix if the vertex shader is generating
# varyings for a fragment shader or the matrix is in local storage and the
@@ -287,7 +294,6 @@ function emit_test_vectors
[test]
clear color 0.5 0.5 0.5 0.5
clear
-ortho
EOF
@@ -375,7 +381,8 @@ function emit_fs_rd_test
echo "# ${cmd}"
echo
echo "[require]"
- echo "GLSL >= $version"
+ echo "GLSL ES >= $version"
+ echo "GL ES >= 2.0"
echo
emit_vs $* 0
@@ -393,7 +400,8 @@ function emit_vs_rd_test
echo "# ${cmd}"
echo
echo "[require]"
- echo "GLSL >= $version"
+ echo "GLSL ES >= $version"
+ echo "GL ES >= 2.0"
echo
emit_vs $* 1
@@ -405,10 +413,10 @@ function emit_vs_rd_test
cmd="$0 $*"
if [ "x$1" = "x" ]; then
- version="1.10"
+ version="1.00"
else
case "$1" in
- 1.[12]0) version="$1";;
+ 1.00) version="$1";;
*)
echo "Bogus GLSL version \"$1\" specified."
exit 1
diff --git a/tests/spec/glsl-1.10/variable-index-write.sh b/tests/spec/glsl-1.10/variable-index-write.sh
index 96a47918..cd6aa519 100755
--- a/tests/spec/glsl-1.10/variable-index-write.sh
+++ b/tests/spec/glsl-1.10/variable-index-write.sh
@@ -212,7 +212,6 @@ function emit_test_vectors
[test]
clear color 0.5 0.5 0.5 0.5
clear
-ortho
EOF
@@ -288,7 +287,7 @@ EOF
echo "uniform int col $((c-1))"
fi
- for r in $rows; do
+ for r in $rows; do
if [ "x$value_type" = "xfloat" ]; then
echo "uniform int row $((r-1))"
fi
@@ -325,15 +324,28 @@ function emit_fs_wr_test
echo "# ${cmd}"
echo
echo "[require]"
- echo "GLSL >= ${version}"
+ echo "GLSL ES >= ${version}"
+ echo "GL ES >= 2.0"
echo
echo "[vertex shader]"
- echo "void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }"
+ echo "attribute vec4 vertex;"
+ echo "mat4 projection = mat4("
+ echo " 2.0/250.0, 0.0, 0.0, -1.0,"
+ echo " 0.0, 2.0/250.0, 0.0, -1.0,"
+ echo " 0.0, 0.0, -1.0, 0.0,"
+ echo " 0.0, 0.0, 0.0, 1.0);"
+ echo
+ echo "void main()"
+ echo "{"
+ echo " gl_Position = vertex;"
+ echo " gl_Position *= projection;"
+ echo "}"
echo
emit_fs $*
emit_test_vectors $*
+ echo "clear"
}
@@ -347,15 +359,23 @@ function emit_vs_wr_test
echo "# ${cmd}"
echo
echo "[require]"
- echo "GLSL >= ${version}"
+ echo "GLSL ES >= ${version}"
+ echo "GL ES >= 2.0"
echo
echo "[vertex shader]"
+ echo "attribute vec4 vertex;"
+ echo "mat4 projection = mat4("
+ echo " 2.0/250.0, 0.0, 0.0, -1.0,"
+ echo " 0.0, 2.0/250.0, 0.0, -1.0,"
+ echo " 0.0, 0.0, -1.0, 0.0,"
+ echo " 0.0, 0.0, 0.0, 1.0);"
emit_globals $*
echo "void main()"
echo "{"
- echo " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
+ echo " gl_Position = vertex;"
+ echo " gl_Position *= projection;"
echo
emit_set_matrix $*
@@ -378,16 +398,17 @@ function emit_vs_wr_test
fi
emit_test_vectors $*
+ echo "clear"
}
cmd="$0 $*"
if [ "x$1" = "x" ]; then
- version="1.10"
+ version="1.00"
else
case "$1" in
- 1.[12]0) version="$1";;
+ 1.[0]0) version="$1";;
*)
echo "Bogus GLSL version \"$1\" specified."
exit 1