<div dir="ltr">The content looks good. I'm just not sure if supplying 100 as a parameter should be the trigger for GLES GLSL 1.00. It doesn't seem particularly obvious, although I know there is no regular GL GLSL version 1.00.<div>
<br></div><div style>A separate preexisting issue is the location of the file, which is again misleading.</div><div style><br></div><div style>Stuart</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 20, 2013 at 3:15 PM, Tom Gall <span dir="ltr"><<a href="mailto:tom.gall@linaro.org" target="_blank">tom.gall@linaro.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From tests/spec/glsl-1.10 extend variable-index-write.sh so that<br>
it can also correctly generates variable index write tests that<br>
support glsl-es-1.00.<br>
<br>
1.00 added as a valid parameter to generated tests for glsl-es-1.00.<br>
<br>
For 1.00 tests in the vertex shader an orthographic projection is<br>
applied since ortho during the test portion isn't supported on<br>
OpenGL ES.<br>
<br>
For 1.00 tests the fragent shader specifies default precision.<br>
<br>
For 1.00 tests emit in the [require] section the correct<br>
GLSL ES and GL ES settings.<br>
<br>
Signed-off-by: Tom Gall <<a href="mailto:tom.gall@linaro.org">tom.gall@linaro.org</a>><br>
---<br>
tests/spec/glsl-1.10/variable-index-write.sh | 67 +++++++++++++++++++++++---<br>
1 file changed, 61 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/tests/spec/glsl-1.10/variable-index-write.sh b/tests/spec/glsl-1.10/variable-index-write.sh<br>
index 96a4791..06802c4 100755<br>
--- a/tests/spec/glsl-1.10/variable-index-write.sh<br>
+++ b/tests/spec/glsl-1.10/variable-index-write.sh<br>
@@ -177,6 +177,10 @@ function emit_fs<br>
fi<br>
<br>
echo "[fragment shader]"<br>
+ if [ $v -eq 100 ]; then<br>
+ echo "precision highp float;"<br>
+ echo "precision highp int;"<br>
+ fi<br>
<br>
emit_globals $*<br>
<br>
@@ -207,14 +211,24 @@ function emit_test_vectors<br>
index_value=$4<br>
col=$5<br>
value_type=$6<br>
+ v=${version/./}<br>
<br>
- cat <<EOF<br>
+ if [ "$v" -eq 100 ]; then<br>
+ cat <<EOF<br>
+[test]<br>
+clear color 0.5 0.5 0.5 0.5<br>
+clear<br>
+<br>
+EOF<br>
+ else<br>
+ cat <<EOF<br>
[test]<br>
clear color 0.5 0.5 0.5 0.5<br>
clear<br>
ortho<br>
<br>
EOF<br>
+ fi<br>
<br>
# NOTE: shader_runner uses the matCxR names even for GLSL 1.10<br>
type="mat${matrix_dim}x${matrix_dim}"<br>
@@ -321,15 +335,37 @@ EOF<br>
<br>
function emit_fs_wr_test<br>
{<br>
+ v=${version/./}<br>
+<br>
echo "# Test generated by:"<br>
echo "# ${cmd}"<br>
echo<br>
echo "[require]"<br>
- echo "GLSL >= ${version}"<br>
+ if [ "$v" -eq 100 ]; then<br>
+ echo "GLSL ES >= ${version}"<br>
+ echo "GL ES >= 2.0"<br>
+ else<br>
+ echo "GLSL >= ${version}"<br>
+ fi<br>
echo<br>
<br>
echo "[vertex shader]"<br>
- echo "void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }"<br>
+ if [ "$v" -eq 100 ]; then<br>
+ echo "attribute vec4 vertex;"<br>
+ echo "mat4 projection = mat4("<br>
+ echo " 2.0/250.0, 0.0, 0.0, -1.0,"<br>
+ echo " 0.0, 2.0/250.0, 0.0, -1.0,"<br>
+ echo " 0.0, 0.0, -1.0, 0.0,"<br>
+ echo " 0.0, 0.0, 0.0, 1.0);"<br>
+ echo<br>
+ echo "void main()"<br>
+ echo "{"<br>
+ echo " gl_Position = vertex;"<br>
+ echo " gl_Position *= projection;"<br>
+ echo "}"<br>
+ else<br>
+ echo "void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }"<br>
+ fi<br>
echo<br>
<br>
emit_fs $*<br>
@@ -342,20 +378,39 @@ function emit_vs_wr_test<br>
matrix_dim=$1<br>
array_dim=$2<br>
mode=$3<br>
+ v=${version/./}<br>
<br>
echo "# Test generated by:"<br>
echo "# ${cmd}"<br>
echo<br>
echo "[require]"<br>
- echo "GLSL >= ${version}"<br>
+ if [ "$v" -eq 100 ]; then<br>
+ echo "GLSL ES >= ${version}"<br>
+ echo "GL ES >= 2.0"<br>
+ else<br>
+ echo "GLSL >= ${version}"<br>
+ fi<br>
echo<br>
<br>
echo "[vertex shader]"<br>
+ if [ "$v" -eq 100 ]; then<br>
+ echo "attribute vec4 vertex;"<br>
+ echo "mat4 projection = mat4("<br>
+ echo " 2.0/250.0, 0.0, 0.0, -1.0,"<br>
+ echo " 0.0, 2.0/250.0, 0.0, -1.0,"<br>
+ echo " 0.0, 0.0, -1.0, 0.0,"<br>
+ echo " 0.0, 0.0, 0.0, 1.0);"<br>
+ fi<br>
emit_globals $*<br>
<br>
echo "void main()"<br>
echo "{"<br>
- echo " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"<br>
+ if [ "$v" -eq 100 ]; then<br>
+ echo " gl_Position = vertex;"<br>
+ echo " gl_Position *= projection;"<br>
+ else<br>
+ echo " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"<br>
+ fi<br>
echo<br>
<br>
emit_set_matrix $*<br>
@@ -387,7 +442,7 @@ if [ "x$1" = "x" ]; then<br>
version="1.10"<br>
else<br>
case "$1" in<br>
- 1.[12]0) version="$1";;<br>
+ 1.[012]0) version="$1";;<br>
*)<br>
echo "Bogus GLSL version \"$1\" specified."<br>
exit 1<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.10.4<br>
<br>
_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</font></span></blockquote></div><br></div>