diff options
author | Tom Gall <tom.gall@linaro.org> | 2013-02-15 11:35:50 -0600 |
---|---|---|
committer | Paul Berry <stereotype441@gmail.com> | 2013-02-15 14:28:58 -0800 |
commit | 4cd2cb8e8410dbff8a89d35aff719e86343f1b5b (patch) | |
tree | ce24b2719821a959dc96fdea2d9f0bebe16db497 /tests/spec/glsl-es-1.00 | |
parent | 51915e0a486416ed6f8bf14f901bc451dd7b2b47 (diff) |
glsl-es-1.00: Move contents of glsl-1.00 to glsl-es-1.00
Move contents of glsl-1.00 to the glsl-es-1.00 directory.
Remove a few blank lines at the end of 4 tests so that git is happy.
Last fix up all.tests so that all shader and glslparser tests for
glsl-es-1.00 are listed and referenced in the new directory.
V2: patch squashed and generated with --find-renames
Signed-off-by: Tom Gall <tom.gall@linaro.org>
V3 (Paul Berry <stereotype441@gmail.com>): Add missing initialization
of spec['glsl-es-1.00']['execution'] to all.tests.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Diffstat (limited to 'tests/spec/glsl-es-1.00')
40 files changed, 810 insertions, 0 deletions
diff --git a/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/division-by-zero-01.frag b/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/division-by-zero-01.frag new file mode 100644 index 00000000..33094f7b --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/division-by-zero-01.frag @@ -0,0 +1,18 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] +// +// Division by zero is legal for floating point values. +// +// From section 5.9 of the GLSL ES 1.00 spec: +// Dividing by zero does not cause an exception but does result in an +// unspecified value. + +#version 100 + +float +f() { + float x = 1.0 / 0.0; + return x; +} diff --git a/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/division-by-zero-02.frag b/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/division-by-zero-02.frag new file mode 100644 index 00000000..f195214b --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/division-by-zero-02.frag @@ -0,0 +1,18 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] +// +// Division by zero is legal for integer values. +// +// From section 5.9 of the GLSL ES 1.00 spec: +// Dividing by zero does not cause an exception but does result in an +// unspecified value. + +#version 100 + +int +f() { + int x = 1 / 0; + return x; +} diff --git a/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/modulus-00.frag b/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/modulus-00.frag new file mode 100644 index 00000000..1204c6fb --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/modulus-00.frag @@ -0,0 +1,17 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// [end config] +// +// The modulus operator '%' is reserved. +// +// From section 5.9 of the GLSL ES 1.00 spec: +// The operator remainder (%) is reserved for future use. + +#version 100 + +int +f() { + int tea_time = 15 % 24; + return tea_time; +} diff --git a/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-prohibited.frag b/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-prohibited.frag new file mode 100644 index 00000000..d33f053a --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-prohibited.frag @@ -0,0 +1,19 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// [end config] +// +// Check that assignment to an array is illegal in GLSL ES 1.00. +// +// From section 5.8 of the GLSL ES 1.00 spec: +// Array variables are l-values and may be passed to parameters +// declared as out or inout. However, they may not be used as the +// target of an assignment. + +#version 100 + +void f(float x[2]) +{ + float y[2]; + y = x; +} diff --git a/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-prohibited.vert b/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-prohibited.vert new file mode 100644 index 00000000..d33f053a --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-prohibited.vert @@ -0,0 +1,19 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// [end config] +// +// Check that assignment to an array is illegal in GLSL ES 1.00. +// +// From section 5.8 of the GLSL ES 1.00 spec: +// Array variables are l-values and may be passed to parameters +// declared as out or inout. However, they may not be used as the +// target of an assignment. + +#version 100 + +void f(float x[2]) +{ + float y[2]; + y = x; +} diff --git a/tests/spec/glsl-es-1.00/compiler/assignment-operators/modulus-assign-00.frag b/tests/spec/glsl-es-1.00/compiler/assignment-operators/modulus-assign-00.frag new file mode 100644 index 00000000..7b35a9a8 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/assignment-operators/modulus-assign-00.frag @@ -0,0 +1,20 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// [end config] +// +// The modulus assignment operator '%=' is reserved. +// +// From section 5.8 of the GLSL ES 1.00 spec: +// The assignments remainder into (%=), left shift by (<<=), right shift +// by (>>=), inclusive or into ( |=), and exclusive or into ( ^=) are +// reserved for future use. + +#version 100 + +int +f() { + int x = 19; + x %= 4; + return x; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-bool-01.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-bool-01.frag new file mode 100644 index 00000000..07b669fc --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-bool-01.frag @@ -0,0 +1,22 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// [end config] +// +// Type bool cannot have default precision. +// +// From section 4.5.3 of the GLSL 1.00 spec: +// The precision statement +// precision precision-qualifier type; +// can be used to establish a default precision qualifier. The type field +// can be either int or float. [...] Any other types or qualifiers will +// result in an error. + + +#version 100 + +precision lowp bool; + +float f() { + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-float-01.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-float-01.frag new file mode 100644 index 00000000..63b8756f --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-float-01.frag @@ -0,0 +1,21 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] +// +// Type float can have default precision. +// +// From section 4.5.3 of the GLSL 1.00 spec: +// The precision statement +// precision precision-qualifier type; +// can be used to establish a default precision qualifier. The type field +// can be either int or float, + + +#version 100 + +precision lowp float; + +float f() { + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-int-01.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-int-01.frag new file mode 100644 index 00000000..ecfd6e7a --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-int-01.frag @@ -0,0 +1,21 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] +// +// Type int can have default precision. +// +// From section 4.5.3 of the GLSL 1.00 spec: +// The precision statement +// precision precision-qualifier type; +// can be used to establish a default precision qualifier. The type field +// can be either int or float, + + +#version 100 + +precision mediump int; + +float f() { + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-sampler.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-sampler.frag new file mode 100644 index 00000000..f6007961 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-sampler.frag @@ -0,0 +1,28 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// check_link: true +// [end config] +// +// From the GLSL ES 1.00 specification, section 4.5.3 ("Default +// Precision Qualifiers"): +// +// "The precision statement +// +// precision precision-qualifier type; +// +// can be used to establish a default precision qualifier. The +// type field can be int or float or any of the sampler types, and +// the precision-qualifier can be lowp, mediump, or highp." +// +// This test verifies that a default precision qualifier can be used +// on all of GLSL ES 1.00's sampler types. + +#version 100 + +precision mediump sampler2D; +precision mediump samplerCube; + +void main() +{ +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-sampler.vert b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-sampler.vert new file mode 100644 index 00000000..b44d016f --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-sampler.vert @@ -0,0 +1,29 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// check_link: true +// [end config] +// +// From the GLSL ES 1.00 specification, section 4.5.3 ("Default +// Precision Qualifiers"): +// +// "The precision statement +// +// precision precision-qualifier type; +// +// can be used to establish a default precision qualifier. The +// type field can be int or float or any of the sampler types, and +// the precision-qualifier can be lowp, mediump, or highp." +// +// This test verifies that a default precision qualifier can be used +// on all of GLSL ES 1.00's sampler types. + +#version 100 + +precision mediump sampler2D; +precision mediump samplerCube; + +void main() +{ + gl_Position = vec4(0.0); +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-vec-01.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-vec-01.frag new file mode 100644 index 00000000..777d0691 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-vec-01.frag @@ -0,0 +1,23 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// [end config] +// +// Vector types cannot have default precision. +// +// From section 4.5.3 of the GLSL 1.00 spec: +// The precision statement +// precision precision-qualifier type; +// can be used to establish a default precision qualifier. The type field +// can be either int or float. [...] Any other types or qualifiers will +// result in an error. + + + +#version 100 + +precision mediump vec2; + +float f() { + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/no-default-float-precision.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/no-default-float-precision.frag new file mode 100644 index 00000000..1d8890c2 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/no-default-float-precision.frag @@ -0,0 +1,21 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// check_link: true +// [end config] +// +// From section 4.5.3 ("Default Precision Qualifiers") of the GLSL ES +// 1.00 spec: +// +// "The fragment language has no default precision qualifier for +// floating point types. Hence for float, floating point vector +// and matrix variable declarations, either the declaration must +// include a precision qualifier or the default float precision +// must have been previously declared." + +#version 100 + +void main() +{ + float f = 1.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-bool-01.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-bool-01.frag new file mode 100644 index 00000000..a350ae6e --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-bool-01.frag @@ -0,0 +1,17 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// [end config] +// +// Precision qualifiers cannot be applied to bool variables. +// +// From section 4.5.2 of the GLSL 1.00 spec: +// Literal constants do not have precision qualifiers. Neither do Boolean +// variables. + +#version 100 + +float f() { + lowp bool b; + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-bool-02.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-bool-02.frag new file mode 100644 index 00000000..0251c78f --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-bool-02.frag @@ -0,0 +1,17 @@ +// [config] +// expect_result: fail +// glsl_version: 1.30 +// [end config] +// +// Precision qualifiers cannot be applied to boolean vectors. +// +// From section 4.5.2 of the GLSL 1.30 spec: +// Literal constants do not have precision qualifiers. Neither do Boolean +// variables. + +#version 130 + +float f() { + lowp bvec2 v; + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-float-01.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-float-01.frag new file mode 100644 index 00000000..9e122b8d --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-float-01.frag @@ -0,0 +1,17 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] +// +// Precision qualifiers can be applied to floats. +// +// From section 4.5.2 of the GLSL 1.00 spec: +// Any floating point or any integer declaration can have the type +// preceded by one of these precision qualifiers + +#version 100 + +float f() { + mediump float x; + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-float-02.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-float-02.frag new file mode 100644 index 00000000..e84dba02 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-float-02.frag @@ -0,0 +1,17 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] +// +// Precision qualifiers can be applied to float vectors. +// +// From section 4.5.2 of the GLSL 1.00 spec: +// Any floating point or any integer declaration can have the type +// preceded by one of these precision qualifiers + +#version 100 + +float f() { + lowp vec2 v; + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-float-03.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-float-03.frag new file mode 100644 index 00000000..d4878edd --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-float-03.frag @@ -0,0 +1,18 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] +// +// Precision qualifiers can be applied to float arrays. +// +// From section 4.5.2 of the GLSL 1.00 spec: +// Any floating point or any integer declaration can have the type +// preceded by one of these precision qualifiers + +#version 100 + +lowp float a[4]; + +float f() { + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-float-04.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-float-04.frag new file mode 100644 index 00000000..b13877df --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-float-04.frag @@ -0,0 +1,17 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] +// +// Precision qualifiers can be applied to float matrices. +// +// From section 4.5.2 of the GLSL 1.00 spec: +// Any floating point or any integer declaration can have the type +// preceded by one of these precision qualifiers + +#version 100 + +float f() { + lowp mat4 m; + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-fs-highp-01.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-fs-highp-01.frag new file mode 100644 index 00000000..7540d300 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-fs-highp-01.frag @@ -0,0 +1,24 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] +// +// If high precision is available in the fragment shader, then it should be +// legal to use it. +// +// From section 4.5.4 of the GLSL 1.00 spec: +// "The built-in macro GL_FRAGMENT_PRECISION_HIGH is defined to one on +// systems supporting highp precision in the fragment language +// #define GL_FRAGMENT_PRECISION_HIGH 1 +// and is not defined on systems not supporting highp precision in the +// fragment language." + +#version 100 + +#ifdef GL_FRAGMENT_PRECISION_HIGH +highp float x; +#endif + +float f() { + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-fs-highp-02.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-fs-highp-02.frag new file mode 100644 index 00000000..a79d0f02 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-fs-highp-02.frag @@ -0,0 +1,26 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// [end config] +// +// If high precision is unavailable in the fragment shader, then it should be +// illegal to use it. +// +// From section 4.5.4 of the GLSL 1.00 spec: +// "The built-in macro GL_FRAGMENT_PRECISION_HIGH is defined to one on +// systems supporting highp precision in the fragment language +// #define GL_FRAGMENT_PRECISION_HIGH 1 +// and is not defined on systems not supporting highp precision in the +// fragment language." + +#version 100 + +#ifndef GL_FRAGMENT_PRECISION_HIGH +highp float x; +#else +#error +#endif + +float f() { + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-function-param-01.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-function-param-01.frag new file mode 100644 index 00000000..8ab67340 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-function-param-01.frag @@ -0,0 +1,16 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] +// +// Function parameters and return types can have precision qualifiers. +// +// From section 4.5.2 of the GLSL 1.00 spec: +// Any floating point or any integer declaration can have the type +// preceded by one of these precision qualifiers + +#version 100 + +lowp float f(lowp int x) { + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-global-01.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-global-01.frag new file mode 100644 index 00000000..83e4ce96 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-global-01.frag @@ -0,0 +1,19 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] +// +// Global variables can have precision qualifiers. +// +// From section 4.5.2 of the GLSL 1.00 spec: +// Any floating point or any integer declaration can have the type +// preceded by one of these precision qualifiers + +#version 100 + +uniform mediump float x; +varying lowp float y; + +float f() { + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-int-01.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-int-01.frag new file mode 100644 index 00000000..061b3654 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-int-01.frag @@ -0,0 +1,17 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] +// +// Precision qualifiers can be applied to ints. +// +// From section 4.5.2 of the GLSL 1.00 spec: +// Any floating point or any integer declaration can have the type +// preceded by one of these precision qualifiers + +#version 100 + +float f() { + lowp int x; + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-int-02.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-int-02.frag new file mode 100644 index 00000000..3572a4b7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-int-02.frag @@ -0,0 +1,17 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] +// +// Precision qualifiers can be applied to integer vectors. +// +// From section 4.5.2 of the GLSL 1.00 spec: +// Any floating point or any integer declaration can have the type +// preceded by one of these precision qualifiers + +#version 100 + +float f() { + mediump ivec2 v; + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-int-03.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-int-03.frag new file mode 100644 index 00000000..4ed9263f --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-int-03.frag @@ -0,0 +1,18 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] +// +// Precision qualifiers can be applied to int arrays. +// +// From section 4.5.2 of the GLSL 1.00 spec: +// Any floating point or any integer declaration can have the type +// preceded by one of these precision qualifiers + +#version 100 + +lowp int a[4]; + +float f() { + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-literal-const-01.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-literal-const-01.frag new file mode 100644 index 00000000..abeb82c9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-literal-const-01.frag @@ -0,0 +1,16 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// [end config] +// +// Precision qualifiers cannot be applied to integer literals. +// +// From section 4.5.2 of the GLSL 1.00 spec: +// Literal constants do not have precision qualifiers. + +#version 100 + +float f() { + lowp int x = lowp 1; + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-literal-const-02.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-literal-const-02.frag new file mode 100644 index 00000000..8daeb3bb --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-literal-const-02.frag @@ -0,0 +1,16 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// [end config] +// +// Precision qualifiers cannot be applied to float literals. +// +// From section 4.5.2 of the GLSL 1.00 spec: +// Literal constants do not have precision qualifiers. + +#version 100 + +float f() { + lowp float x = lowp 0.0; + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-local-01.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-local-01.frag new file mode 100644 index 00000000..4f7e2852 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-local-01.frag @@ -0,0 +1,17 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] +// +// Local variables can have precision qualifiers. +// +// From section 4.5.2 of the GLSL 1.00 spec: +// Any floating point or any integer declaration can have the type +// preceded by one of these precision qualifiers + +#version 100 + +float f() { + lowp float x = 0.0; + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-struct-01.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-struct-01.frag new file mode 100644 index 00000000..07161a27 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-struct-01.frag @@ -0,0 +1,21 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// [end config] +// +// Precision qualifiers cannot be applied to structs. +// +// This test declares the struct and its sole member with matching +// precision qualifier. +// +// See section 4.5.2 of the GLSL 1.00 spec. + +#version 100 + +lowp struct s { + lowp float a; +}; + +float f() { + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-struct-02.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-struct-02.frag new file mode 100644 index 00000000..4dcaa980 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-struct-02.frag @@ -0,0 +1,21 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// [end config] +// +// Precision qualifiers cannot be applied to structs. +// +// This test declares the struct, but none of its members, with a precision +// qualifier. +// +// See section 4.5.2 of the GLSL 1.00 spec. + +#version 100 + +lowp struct s { + float a; +}; + +float f() { + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-vs-highp-01.vert b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-vs-highp-01.vert new file mode 100644 index 00000000..bf9a0eb9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/precision-vs-highp-01.vert @@ -0,0 +1,18 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// [end config] +// +// High precision is always available in the vertex shader. +// +// From section 4.5.2 of the GLSL 1.00 spec: +// "The vertex language requires any uses of lowp, mediump and highp to +// compile and link without error." + +#version 100 + +highp float x; + +float f() { + return 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag new file mode 100644 index 00000000..497d2757 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag @@ -0,0 +1,28 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// check_link: true +// [end config] +// +// Check that an array can be used as a function inout parameter in +// GLSL ES 1.00. +// +// In this test, the array is declared using C-style array +// declaration syntax (float x[2] as opposed to float[2] x). +// +// From section 5.8 of the GLSL ES 1.00 spec: +// Array variables are l-values and may be passed to parameters +// declared as out or inout. However, they may not be used as the +// target of an assignment. + +#version 100 + +void f(inout float x[2]) +{ +} + +void main() +{ + float[2] x; + f(x); +} diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert new file mode 100644 index 00000000..af7075f7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert @@ -0,0 +1,29 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// check_link: true +// [end config] +// +// Check that an array can be used as a function inout parameter in +// GLSL ES 1.00. +// +// In this test, the array is declared using C-style array +// declaration syntax (float x[2] as opposed to float[2] x). +// +// From section 5.8 of the GLSL ES 1.00 spec: +// Array variables are l-values and may be passed to parameters +// declared as out or inout. However, they may not be used as the +// target of an assignment. + +#version 100 + +void f(inout float x[2]) +{ +} + +void main() +{ + float[2] x; + f(x); + gl_Position = vec4(0.0); +} diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.frag b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.frag new file mode 100644 index 00000000..2dd38abe --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.frag @@ -0,0 +1,28 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// check_link: true +// [end config] +// +// Check that an array can be used as a function out parameter in +// GLSL ES 1.00. +// +// In this test, the array is declared using C-style array +// declaration syntax (float x[2] as opposed to float[2] x). +// +// From section 5.8 of the GLSL ES 1.00 spec: +// Array variables are l-values and may be passed to parameters +// declared as out or inout. However, they may not be used as the +// target of an assignment. + +#version 100 + +void f(out float x[2]) +{ +} + +void main() +{ + float[2] x; + f(x); +} diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.vert b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.vert new file mode 100644 index 00000000..2f839bac --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.vert @@ -0,0 +1,29 @@ +// [config] +// expect_result: pass +// glsl_version: 1.00 +// check_link: true +// [end config] +// +// Check that an array can be used as a function out parameter in +// GLSL 1.00. +// +// In this test, the array is declared using C-style array +// declaration syntax (float x[2] as opposed to float[2] x). +// +// From section 5.8 of the GLSL ES 1.00 spec: +// Array variables are l-values and may be passed to parameters +// declared as out or inout. However, they may not be used as the +// target of an assignment. + +#version 100 + +void f(out float x[2]) +{ +} + +void main() +{ + float[2] x; + f(x); + gl_Position = vec4(0.0); +} diff --git a/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-attribute-01.vert b/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-attribute-01.vert new file mode 100644 index 00000000..75474796 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-attribute-01.vert @@ -0,0 +1,17 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// [end config] +// +// From section 4.3.3 of the GLSL 1.00 spec: +// Attribute variables are read-only as far as the vertex shader is +// concerned. + +#version 100 + +attribute float x; + +float f() { + x = 0.0; + return x; +} diff --git a/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-attribute-02.vert b/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-attribute-02.vert new file mode 100644 index 00000000..a972d341 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-attribute-02.vert @@ -0,0 +1,20 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// [end config] +// +// From section 4.3.3 of the GLSL 1.00 spec: +// Attribute variables are read-only as far as the vertex shader is +// concerned. + +#version 100 + +attribute float x; + +void f(out float y) { + y = 0.0; +} + +void g() { + f(x); +} diff --git a/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-varying-01.frag b/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-varying-01.frag new file mode 100644 index 00000000..f61d29ca --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-varying-01.frag @@ -0,0 +1,15 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// [end config] +// +// From section 4.3.5 of the GLSL 1.00 spec: +// A fragment shader can not write to a varying variable. + +#version 100 + +varying float x; + +void g() { + x = 0.0; +} diff --git a/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-varying-02.frag b/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-varying-02.frag new file mode 100644 index 00000000..e5548c5f --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-varying-02.frag @@ -0,0 +1,19 @@ +// [config] +// expect_result: fail +// glsl_version: 1.00 +// [end config] +// +// From section 4.3.5 of the GLSL 1.00 spec: +// A fragment shader can not write to a varying variable. + +#version 100 + +varying float x; + +void f(out float y) { + y = 0.0; +} + +void g() { + f(x); +} |