[Piglit] [PATCH v2 1/2] Verify that vertex shader "in" parameters are read-only.
Ian Romanick
idr at freedesktop.org
Mon Nov 14 12:47:40 PST 2011
On 11/12/2011 09:46 AM, Paul Berry wrote:
> Piglit already contained tests to verify that in GLSL 1.00-1.20, a
> vertex shader could not write to a variable declared "attribute" (see
> spec/glsl-1.xx/compiler/storage-qualfiers/static-write-attribute-*.vert).
> In GLSL 1.30, such variables are now declared as global "in"
> variables. These new tests verify that the existing read-only
> behavior of these variables is preserved.
The series is
Reivewed-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
> .../storage-qualifiers/static-write-in-direct.vert | 18 +++++++++++++++++
> .../static-write-in-indirect.vert | 21 ++++++++++++++++++++
> 2 files changed, 39 insertions(+), 0 deletions(-)
> create mode 100644 tests/spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-direct.vert
> create mode 100644 tests/spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-indirect.vert
>
> diff --git a/tests/spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-direct.vert b/tests/spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-direct.vert
> new file mode 100644
> index 0000000..9c879e2
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-direct.vert
> @@ -0,0 +1,18 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.30
> +// [end config]
> +//
> +// From page 31 (37 of pdf) of the GLSL 1.30 spec:
> +// Variables declared as in or centroid in may not be written
> +// to during shader execution.
> +
> +
> +#version 130
> +
> +in float x;
> +
> +float f() {
> + x = 0.0;
> + return x;
> +}
> diff --git a/tests/spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-indirect.vert b/tests/spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-indirect.vert
> new file mode 100644
> index 0000000..8385286
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-indirect.vert
> @@ -0,0 +1,21 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.30
> +// [end config]
> +//
> +// From page 31 (37 of pdf) of the GLSL 1.30 spec:
> +// Variables declared as in or centroid in may not be written
> +// to during shader execution.
> +
> +
> +#version 130
> +
> +in float x;
> +
> +void f(out float y) {
> + y = 0.0;
> +}
> +
> +void g() {
> + f(x);
> +}
More information about the Piglit
mailing list