diff options
author | Danylo Piliaiev <danylo.piliaiev@gmail.com> | 2019-01-10 12:13:52 +0200 |
---|---|---|
committer | Timothy Arceri <tarceri@itsqueeze.com> | 2019-01-11 13:00:33 +1100 |
commit | 41b01e6b8c4a8e4c8949a13743125458100ff152 (patch) | |
tree | 8127c892ca6e1859e87147757235c7bb04476543 | |
parent | ef6095478168c4bfb8ea621458e56f9e15cb7377 (diff) |
Test that ES frag shader with invariant outputs compiles
In all GLSL ES versions output variables in fragment shader are allowed
to be invariant.
From Section 4.6.1 ("The Invariant Qualifier") GLSL ES 1.00 spec:
"Only the following variables may be declared as invariant:
...
- Built-in special variables output from the fragment shader."
From Section 4.6.1 ("The Invariant Qualifier") GLSL ES 3.00 spec:
"Only variables output from a shader can be candidates for invariance."
v2: moved new tests to tests/spec/glsl-es folders
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107842
-rw-r--r-- | tests/spec/glsl-es-1.00/compiler/invariant.frag | 17 | ||||
-rw-r--r-- | tests/spec/glsl-es-3.00/compiler/invariant.frag | 15 |
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/spec/glsl-es-1.00/compiler/invariant.frag b/tests/spec/glsl-es-1.00/compiler/invariant.frag new file mode 100644 index 000000000..440d3dfb5 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/invariant.frag @@ -0,0 +1,17 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] + +/* From Section 4.6.1 ("The Invariant Qualifier") GLSL ES 1.00 spec: + * + * "Only the following variables may be declared as invariant: + * Built-in special variables output from the fragment shader." + */ + +#version 100 + +invariant gl_FragColor; +invariant gl_FragData; + +void main() { } diff --git a/tests/spec/glsl-es-3.00/compiler/invariant.frag b/tests/spec/glsl-es-3.00/compiler/invariant.frag new file mode 100644 index 000000000..0b5002f9d --- /dev/null +++ b/tests/spec/glsl-es-3.00/compiler/invariant.frag @@ -0,0 +1,15 @@ +// [config] +// expect_result: pass +// glsl_version: 3.00 +// [end config] + +/* From Section 4.6.1 ("The Invariant Qualifier") GLSL ES 3.00 spec: + * + * "Only variables output from a shader can be candidates for invariance." + */ + +#version 300 es + +invariant out highp vec4 test; + +void main() { } |