[Piglit] [PATCH 1/8] variable-index-read.sh: extend to support glsl es 1.00
Eric Anholt
eric at anholt.net
Wed May 8 17:05:57 PDT 2013
Tom Gall <tom.gall at linaro.org> writes:
> 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 at linaro.org>
> ---
> tests/spec/glsl-1.10/variable-index-read.sh | 54 ++++++++++++++++++++++++---
> 1 file changed, 48 insertions(+), 6 deletions(-)
>
> diff --git a/tests/spec/glsl-1.10/variable-index-read.sh b/tests/spec/glsl-1.10/variable-index-read.sh
> index 80cb078..8fa2bc7 100755
> --- a/tests/spec/glsl-1.10/variable-index-read.sh
> +++ b/tests/spec/glsl-1.10/variable-index-read.sh
> @@ -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
I was stuck on trying to figure out what we ought to be doing about
vertex data on GLES.
I think you're relying on "vertex" being bound by the implementation to
the same varying as PIGLIT_ATTRIB_POS. I don't think that's guaranteed
of implementations. I just sent out a series that included automatic
support for a "piglit_vertex" and "piglit_texcoord" attrib in the GLES
case that would guarantee the ability to use piglit_draw_rect.
Does that sound like a good solution?
I'm also slightly tempted to have both ES and desktop use the same
projection matrix and drop the gl_ModelViewProjectionMatrix usage to
bring the two versions closer together. I don't feel strongly about
that, though.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130508/416731d9/attachment.pgp>
More information about the Piglit
mailing list