Test that ES frag shader with invariant outputs compiles

Submitted by Danylo Piliaiev on Jan. 9, 2019, 5:35 p.m.

Details

Message ID 20190109173516.14974-1-danylo.piliaiev@globallogic.com
State New
Headers show
Series "Test that ES frag shader with invariant outputs compiles" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Danylo Piliaiev Jan. 9, 2019, 5:35 p.m.
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."

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107842

Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
---
 .../glslparsertest/shaders/invariant.V100.frag | 18 ++++++++++++++++++
 .../glslparsertest/shaders/invariant.V300.frag | 16 ++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 tests/glslparsertest/shaders/invariant.V100.frag
 create mode 100644 tests/glslparsertest/shaders/invariant.V300.frag

Patch hide | download patch | download mbox

diff --git a/tests/glslparsertest/shaders/invariant.V100.frag b/tests/glslparsertest/shaders/invariant.V100.frag
new file mode 100644
index 000000000..a6463d1dd
--- /dev/null
+++ b/tests/glslparsertest/shaders/invariant.V100.frag
@@ -0,0 +1,18 @@ 
+// [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/glslparsertest/shaders/invariant.V300.frag b/tests/glslparsertest/shaders/invariant.V300.frag
new file mode 100644
index 000000000..8d7707d8c
--- /dev/null
+++ b/tests/glslparsertest/shaders/invariant.V300.frag
@@ -0,0 +1,16 @@ 
+// [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() { }

Comments

On 10/1/19 4:35 am, Danylo Piliaiev wrote:
> 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."
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107842
> 
> Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
> ---
>   .../glslparsertest/shaders/invariant.V100.frag | 18 ++++++++++++++++++
>   .../glslparsertest/shaders/invariant.V300.frag | 16 ++++++++++++++++


New tests should not go in this dir. Please put them in

tests/spec/glsl-es-1.00/compiler/invariant.frag
tests/spec/glsl-es-3.00/compiler/invariant.frag

>   2 files changed, 34 insertions(+)
>   create mode 100644 tests/glslparsertest/shaders/invariant.V100.frag
>   create mode 100644 tests/glslparsertest/shaders/invariant.V300.frag
> 
> diff --git a/tests/glslparsertest/shaders/invariant.V100.frag b/tests/glslparsertest/shaders/invariant.V100.frag
> new file mode 100644
> index 000000000..a6463d1dd
> --- /dev/null
> +++ b/tests/glslparsertest/shaders/invariant.V100.frag
> @@ -0,0 +1,18 @@
> +// [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/glslparsertest/shaders/invariant.V300.frag b/tests/glslparsertest/shaders/invariant.V300.frag
> new file mode 100644
> index 000000000..8d7707d8c
> --- /dev/null
> +++ b/tests/glslparsertest/shaders/invariant.V300.frag
> @@ -0,0 +1,16 @@
> +// [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() { }
>
Please do not put anything in tests/glslparsertest/, these tests belong in in
tests/spec/glsl-es-1.00 and tests/spec/glsl-es-3.00 respectively.

Quoting Danylo Piliaiev (2019-01-09 09:35:16)
> 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."
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107842
> 
> Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
> ---
>  .../glslparsertest/shaders/invariant.V100.frag | 18 ++++++++++++++++++
>  .../glslparsertest/shaders/invariant.V300.frag | 16 ++++++++++++++++
>  2 files changed, 34 insertions(+)
>  create mode 100644 tests/glslparsertest/shaders/invariant.V100.frag
>  create mode 100644 tests/glslparsertest/shaders/invariant.V300.frag
> 
> diff --git a/tests/glslparsertest/shaders/invariant.V100.frag b/tests/glslparsertest/shaders/invariant.V100.frag
> new file mode 100644
> index 000000000..a6463d1dd
> --- /dev/null
> +++ b/tests/glslparsertest/shaders/invariant.V100.frag
> @@ -0,0 +1,18 @@
> +// [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/glslparsertest/shaders/invariant.V300.frag b/tests/glslparsertest/shaders/invariant.V300.frag
> new file mode 100644
> index 000000000..8d7707d8c
> --- /dev/null
> +++ b/tests/glslparsertest/shaders/invariant.V300.frag
> @@ -0,0 +1,16 @@
> +// [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() { }
> -- 
> 2.20.1
> 
> _______________________________________________
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
I missed Tim's email, please ignore this.

Quoting Dylan Baker (2019-01-10 09:16:42)
> Please do not put anything in tests/glslparsertest/, these tests belong in in
> tests/spec/glsl-es-1.00 and tests/spec/glsl-es-3.00 respectively.
> 
> Quoting Danylo Piliaiev (2019-01-09 09:35:16)
> > 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."
> > 
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107842
> > 
> > Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
> > ---
> >  .../glslparsertest/shaders/invariant.V100.frag | 18 ++++++++++++++++++
> >  .../glslparsertest/shaders/invariant.V300.frag | 16 ++++++++++++++++
> >  2 files changed, 34 insertions(+)
> >  create mode 100644 tests/glslparsertest/shaders/invariant.V100.frag
> >  create mode 100644 tests/glslparsertest/shaders/invariant.V300.frag
> > 
> > diff --git a/tests/glslparsertest/shaders/invariant.V100.frag b/tests/glslparsertest/shaders/invariant.V100.frag
> > new file mode 100644
> > index 000000000..a6463d1dd
> > --- /dev/null
> > +++ b/tests/glslparsertest/shaders/invariant.V100.frag
> > @@ -0,0 +1,18 @@
> > +// [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/glslparsertest/shaders/invariant.V300.frag b/tests/glslparsertest/shaders/invariant.V300.frag
> > new file mode 100644
> > index 000000000..8d7707d8c
> > --- /dev/null
> > +++ b/tests/glslparsertest/shaders/invariant.V300.frag
> > @@ -0,0 +1,16 @@
> > +// [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() { }
> > -- 
> > 2.20.1
> > 
> > _______________________________________________
> > Piglit mailing list
> > Piglit@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/piglit