diff --git a/Test/120.frag b/Test/120.frag index 89f88747afa44e83ccf0998a947519ebb6df7d79..58a1c39feef2c75320695f95bcb803432153b1b3 100644 --- a/Test/120.frag +++ b/Test/120.frag @@ -78,7 +78,23 @@ void main() bool b; gl_FragColor += b ? v : m; // ERROR, types don't match around ":" } + + gl_FragColor.xr; // ERROR, swizzlers not from same field space + centTexCoord.z; // ERROR, swizzler out of range + (a,b) = true; // ERROR, not an l-value } float imageBuffer; float uimage2DRect; + +int main() {} // ERROR +void main(int a) {} // ERROR + +const int a; // ERROR + +int foo(in float a); +int foo(out float a) // ERROR +{ + return 3.2; // ERROR + foo(a); // ERROR +} diff --git a/Test/array.frag b/Test/array.frag index 090d353da495bcbb3a944f5d4da5c9a0f2064fed..6bf313d03d3e7586d9d165be96f7269e0051c733 100644 --- a/Test/array.frag +++ b/Test/array.frag @@ -54,4 +54,6 @@ void main() const int ca3[3] = int[](3, 2); // ERROR int ica[] = int[](3, 2); int ica3[3] = int[](3, 2); // ERROR + ica[3.1] = 3; // ERROR + ica[u[1]] = 4; // ERROR } diff --git a/Test/precision.frag b/Test/precision.frag index 1f695c730ce626c3bd88993c57ef2c6f736db478..0531322e068b6ca448c1cdc720d3aef31114b6c1 100644 --- a/Test/precision.frag +++ b/Test/precision.frag @@ -68,3 +68,9 @@ void main() texture2D(samplerMed, vec2(0.1, 0.2)); texture2D(samplerHigh, vec2(0.1, 0.2)); } + +precision mediump bool; // ERROR +//precision mediump struct { int a; } s; // ERROR +struct s {int a;}; +precision mediump s; // ERROR +mediump bvec2 b2; // ERROR diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index b549953cefcb297f1aa72dca4659b62dbb83b5aa..3a3b31af1af2ff1abe7cecfa2ca73f2c34f900ec 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -891,7 +891,8 @@ void TParseContext::precisionQualifierCheck(int line, TPublicType& publicType) if (publicType.basicType == EbtFloat || publicType.basicType == EbtUint || publicType.basicType == EbtInt || publicType.basicType == EbtSampler) { if (publicType.qualifier.precision == EpqNone) error(line, "type requires declaration of default precision qualifier", TType::getBasicString(publicType.basicType), ""); - } + } else if (publicType.qualifier.precision != EpqNone) + error(line, "type cannot have precision qualifier", TType::getBasicString(publicType.basicType), ""); } void TParseContext::parameterSamplerCheck(int line, TStorageQualifier qualifier, const TType& type)