On Thu, Mar 28, 2013 at 1:50 PM, Stuart Abercrombie <sabercrom...@google.com> wrote: > 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.
It's probably quite safe to say that a GLSL 1.00 will never happen and that GLSL 1.00 will always mean GLSL ES 1.00. I hate to drive from 100 by adding a 100es or something but I can see the case for it. > A separate preexisting issue is the location of the file, which is again > misleading. Yes these need to move. I think that's a separate patch and plan to submit that as well. Likewise the files that these scripts generate need to be deleted from git and then a little bit of script added so that at build time all these tests are generated in their respective glsl-xx-x.xx directories. I think that's a separate patch and also I plan to do it. > Stuart > > > On Wed, Mar 20, 2013 at 3:15 PM, Tom Gall <tom.g...@linaro.org> wrote: >> >> From tests/spec/glsl-1.10 extend variable-index-write.sh so that >> it can also correctly generates variable index write 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 in 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.g...@linaro.org> >> --- >> tests/spec/glsl-1.10/variable-index-write.sh | 67 >> +++++++++++++++++++++++--- >> 1 file changed, 61 insertions(+), 6 deletions(-) >> >> diff --git a/tests/spec/glsl-1.10/variable-index-write.sh >> b/tests/spec/glsl-1.10/variable-index-write.sh >> index 96a4791..06802c4 100755 >> --- a/tests/spec/glsl-1.10/variable-index-write.sh >> +++ b/tests/spec/glsl-1.10/variable-index-write.sh >> @@ -177,6 +177,10 @@ function emit_fs >> fi >> >> echo "[fragment shader]" >> + if [ $v -eq 100 ]; then >> + echo "precision highp float;" >> + echo "precision highp int;" >> + fi >> >> emit_globals $* >> >> @@ -207,14 +211,24 @@ function emit_test_vectors >> index_value=$4 >> col=$5 >> value_type=$6 >> + v=${version/./} >> >> - 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 >> type="mat${matrix_dim}x${matrix_dim}" >> @@ -321,15 +335,37 @@ EOF >> >> function emit_fs_wr_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 >> >> echo "[vertex shader]" >> - echo "void main() { gl_Position = gl_ModelViewProjectionMatrix * >> gl_Vertex; }" >> + 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);" >> + echo >> + echo "void main()" >> + echo "{" >> + echo " gl_Position = vertex;" >> + echo " gl_Position *= projection;" >> + echo "}" >> + else >> + echo "void main() { gl_Position = gl_ModelViewProjectionMatrix * >> gl_Vertex; }" >> + fi >> echo >> >> emit_fs $* >> @@ -342,20 +378,39 @@ function emit_vs_wr_test >> matrix_dim=$1 >> array_dim=$2 >> mode=$3 >> + 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 >> >> 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 >> echo >> >> emit_set_matrix $* >> @@ -387,7 +442,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 >> -- >> 1.7.10.4 >> >> _______________________________________________ >> Piglit mailing list >> Piglit@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/piglit > > -- Regards, Tom "Where's the kaboom!? There was supposed to be an earth-shattering kaboom!" Marvin Martian Tech Lead, Graphics Working Group | Linaro.org │ Open source software for ARM SoCs w) tom.gall att linaro.org h) tom_gall att mac.com _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit