@@ -156,6 +156,7 @@ function emit_vs
col=$5
expect_type=$6
do_compare=$7
+ v=${version/./}
if [ $array_dim -ne 0 ]; then
idx="[${index_value}]"
@@ -164,11 +165,24 @@ function emit_vs
fi
echo "[vertex shader]"
+ if [ $v -eq 100 ]; then
+ 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);"
+ fi
emit_globals $*
echo "void main()"
echo "{"
- echo " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
+ if [ $v -eq 100 ]; then
+ echo " gl_Position = vertex;"
+ echo " gl_Position *= projection;"
+ else
+ echo " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
+ fi
# 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
@@ -215,8 +229,13 @@ emit_fs()
col=$5
expect_type=$6
do_compare=$7
+ v=${version/./}
echo "[fragment shader]"
+ if [ $v -eq 100 ]; then
+ echo "precision highp float;"
+ echo "precision highp int;"
+ fi
emit_globals $*
echo "void main()"
@@ -275,6 +294,7 @@ function emit_test_vectors
index_value=$4
col=$5
expect_type=$6
+ v=${version/./}
# Optimizing GLSL linkers may reduce the size of the uniform array if tail
# elements are not accessed. Shader runner will fail the test if one of
@@ -283,16 +303,24 @@ function emit_test_vectors
array_dim=$((index_value+1))
fi
- cat <<EOF
+ if [ "$v" -eq 100 ]; then
+ cat <<EOF
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+EOF
+ else
+ cat <<EOF
[test]
clear color 0.5 0.5 0.5 0.5
clear
ortho
EOF
+ fi
# NOTE: shader_runner uses the matCxR names even for GLSL 1.10
- v=${version/./}
type="mat${matrix_dim}x${matrix_dim}"
if [ "x$mode" = "xuniform" -a $v -le 110 ]; then
if [ $array_dim -eq 0 ]; then
@@ -371,11 +399,18 @@ EOF
# index in the fragment shader.
function emit_fs_rd_test
{
+ v=${version/./}
+
echo "# Test generated by:"
echo "# ${cmd}"
echo
echo "[require]"
- echo "GLSL >= $version"
+ if [ $v -eq 100 ]; then
+ echo "GLSL ES >= $version"
+ echo "GL ES >= 2.0"
+ else
+ echo "GLSL >= $version"
+ fi
echo
emit_vs $* 0
@@ -389,11 +424,18 @@ function emit_fs_rd_test
# index in the fragment shader.
function emit_vs_rd_test
{
+ v=${version/./}
+
echo "# Test generated by:"
echo "# ${cmd}"
echo
echo "[require]"
- echo "GLSL >= $version"
+ if [ $v -eq 100 ]; then
+ echo "GLSL ES >= $version"
+ echo "GL ES >= 2.0"
+ else
+ echo "GLSL >= $version"
+ fi
echo
emit_vs $* 1
@@ -408,7 +450,7 @@ if [ "x$1" = "x" ]; then
version="1.10"
else
case "$1" in
- 1.[12]0) version="$1";;
+ 1.[012]0) version="$1";;
*)
echo "Bogus GLSL version \"$1\" specified."
exit 1
Please apply. Initially posted ~ a month ago. No negative feedback. From tests/spec/glsl-1.10 extend variable-index-read.sh so that it can also correctly generates variable index read tests that support glsl-es-1.00. 1.00 added as a valid parameter to generated tests for glsl-es-1.00. For 1.00 tests the vertex shader an orthographic projection is applied since ortho during the test portion isn't supported on OpenGL ES. For 1.00 tests the fragent shader specifies default precision. For 1.00 tests emit in the [require] section the correct GLSL ES and GL ES settings. Signed-off-by: Tom Gall <tom.gall@linaro.org> --- tests/spec/glsl-1.10/variable-index-read.sh | 54 ++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 6 deletions(-)