[Piglit] [PATCH 2/2] Don't set array members that are not used

Paul Berry stereotype441 at gmail.com
Tue Nov 8 10:35:02 PST 2011


On 4 November 2011 16:56, Ian Romanick <idr at freedesktop.org> wrote:

> From: Ian Romanick <ian.d.romanick at intel.com>
>
> 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 the set uniforms doesn't have a location.
>
> Previously these tests would fail on AMD's closed-source driver for
> this reason.  Now they pass.
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  tests/shaders/glsl-fs-uniform-array-1.shader_test |    5 +++--
>  tests/shaders/glsl-vs-uniform-array-1.shader_test |    5 +++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/tests/shaders/glsl-fs-uniform-array-1.shader_test
> b/tests/shaders/glsl-fs-uniform-array-1.shader_test
> index b992588..3ab81d8 100644
> --- a/tests/shaders/glsl-fs-uniform-array-1.shader_test
> +++ b/tests/shaders/glsl-fs-uniform-array-1.shader_test
> @@ -17,7 +17,8 @@ void main()
>  [test]
>  uniform vec4 arg[0] 1.0 0.0 0.0 0.0
>  uniform vec4 arg[1] 0.0 1.0 0.0 0.0
> -uniform vec4 arg[2] 0.0 0.0 1.0 0.0
> -uniform vec4 arg[3] 1.0 0.0 1.0 0.0
> +# The linker should optimize these members away, so don't set them.
> +#uniform vec4 arg[2] 0.0 0.0 1.0 0.0
> +#uniform vec4 arg[3] 1.0 0.0 1.0 0.0
>  draw rect -1 -1 2 2
>  probe rgb 1 1 0.0 1.0 0.0
> diff --git a/tests/shaders/glsl-vs-uniform-array-1.shader_test
> b/tests/shaders/glsl-vs-uniform-array-1.shader_test
> index 6719395..7c7bcdc 100644
> --- a/tests/shaders/glsl-vs-uniform-array-1.shader_test
> +++ b/tests/shaders/glsl-vs-uniform-array-1.shader_test
> @@ -20,7 +20,8 @@ void main()
>  [test]
>  uniform vec4 arg[0] 1.0 0.0 0.0 0.0
>  uniform vec4 arg[1] 0.0 1.0 0.0 0.0
> -uniform vec4 arg[2] 0.0 0.0 1.0 0.0
> -uniform vec4 arg[3] 1.0 0.0 1.0 0.0
> +# The linker should optimize these members away, so don't set them.
> +#uniform vec4 arg[2] 0.0 0.0 1.0 0.0
> +#uniform vec4 arg[3] 1.0 0.0 1.0 0.0
>  draw rect -1 -1 2 2
>  probe rgb 1 1 0.0 1.0 0.0
> --
> 1.7.6.4
>

Reviewed-by: Paul Berry <stereotype441 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20111108/6ea4d678/attachment.htm>


More information about the Piglit mailing list