[Piglit] [PATCH] Remove #version from variable indexing shader tests.

Ian Romanick idr at freedesktop.org
Fri Dec 14 15:16:06 PST 2012


On 12/13/2012 10:00 AM, Stuart Abercrombie wrote:
> The idea is to ultimately remove explicit #version directives from all
> .shader_test files, so we can just rely on GLSL >=, and then the ES
> analog, allowing these tests to run on GL or GLES -- what Paul Berry
> outlined a while back, basically.
>
> This patch is confined to the variable indexing tests.  It removes
> #version outputting from
>
> tests/spec/glsl-1.10/variable-index-read.sh
> tests/spec/glsl-1.10/variable-index-write.sh
>
> and the files generated for 1.10/1.20 from these scripts.  I've
> included the script modification below.

Has shader_runner been modified to insert #version?  Without that all of 
the '#version 120' tests will fail.

As is, none of these tests will work as ES shaders because they all use 
built-in variables that don't exist in ES.

I think some of these tests might try variable indexing kinds of arrays 
that ES does not require be indexable.  See part 5 of appendix A in the 
GLSL ES 1.00 specification.

I think the first step is to modify this generator to generate '#version 
100' shaders that will work.  Then we can think about unifying ES and 
desktop.

> The follow-up was intended to be removal of #version from other
> .shader_test files, and other regularization like what I sent in
> before.
>
> Since other work is being done for GLES I don't know if this is still
> a reasonable way forward.  Thoughts?
>
> Stuart
>
> diff --git a/tests/spec/glsl-1.10/variable-index-read.sh
> b/tests/spec/glsl-1.10/variable-index-read.sh
> index 12b0685..80cb078 100755
> --- a/tests/spec/glsl-1.10/variable-index-read.sh
> +++ b/tests/spec/glsl-1.10/variable-index-read.sh
> @@ -164,7 +164,6 @@ function emit_vs
>       fi
>
>       echo "[vertex shader]"
> -    echo "#version ${version/./}"
>       emit_globals $*
>
>       echo "void main()"
> @@ -218,7 +217,6 @@ emit_fs()
>       do_compare=$7
>
>       echo "[fragment shader]"
> -    echo "#version ${version/./}"
>       emit_globals $*
>
>       echo "void main()"
> diff --git a/tests/spec/glsl-1.10/variable-index-write.sh
> b/tests/spec/glsl-1.10/variable-index-write.sh
> index 449a750..96a4791 100755
> --- a/tests/spec/glsl-1.10/variable-index-write.sh
> +++ b/tests/spec/glsl-1.10/variable-index-write.sh
> @@ -177,7 +177,6 @@ function emit_fs
>       fi
>
>       echo "[fragment shader]"
> -    echo "#version ${version/./}"
>
>       emit_globals $*
>
> @@ -330,7 +329,6 @@ function emit_fs_wr_test
>       echo
>
>       echo "[vertex shader]"
> -    echo "#version ${version/./}"
>       echo "void main() { gl_Position = gl_ModelViewProjectionMatrix *
> gl_Vertex; }"
>       echo
>
> @@ -353,7 +351,6 @@ function emit_vs_wr_test
>       echo
>
>       echo "[vertex shader]"
> -    echo "#version ${version/./}"
>       emit_globals $*
>
>       echo "void main()"
> @@ -374,7 +371,6 @@ function emit_vs_wr_test
>
>       if [ "x$mode" != "xvarying" ];then
>   	echo "[fragment shader]"
> -	echo "#version ${version/./}"
>   	echo "void main() { gl_FragColor = gl_Color; }"
>   	echo
>       else
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>



More information about the Piglit mailing list