[Piglit] [PATCH] glsl-1.20: new test for a GLSL scoping bug in Mesa

Brian Paul brianp at vmware.com
Tue Sep 9 08:35:11 PDT 2014


On 09/09/2014 08:51 AM, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> Mesa things Name is a type in "gl_Position = Name".

"thinks"


> ---
>   .../compiler/scoping-struct-vs-variable.vert       | 24 ++++++++++++++++++++++
>   1 file changed, 24 insertions(+)
>   create mode 100644 tests/spec/glsl-1.20/compiler/scoping-struct-vs-variable.vert
>
> diff --git a/tests/spec/glsl-1.20/compiler/scoping-struct-vs-variable.vert b/tests/spec/glsl-1.20/compiler/scoping-struct-vs-variable.vert
> new file mode 100644
> index 0000000..2ab288b
> --- /dev/null
> +++ b/tests/spec/glsl-1.20/compiler/scoping-struct-vs-variable.vert
> @@ -0,0 +1,24 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.20
> +// check_link: true
> +// [end config]
> +//
> +// GLSLangSpec.1.20.8, 4.2 Scoping:
> +//
> +// "If a nested scope redeclares a name used in an outer scope, it hides all
> +//  existing uses of that name. There is no way to access the hidden name or
> +//  make it unhidden, without exiting the scope that hid it."
> +
> +#version 120
> +
> +struct Name {
> +    float a;
> +};
> +
> +void main()
> +{
> +    vec4 Name = vec4(1.0);
> +    gl_Position = Name;
> +}
> +
>

Reviewed-by: Brian Paul <brianp at vmware.com>




More information about the Piglit mailing list