blob: 9820e2a9454532afcd9dd0848ccaeea5a81fe9ce [file] [log] [blame]
John Kessenich0fbb0c42013-06-06 18:31:21 +00001#version 300 es
2
John Kessenich41a36bb2013-06-19 05:41:25 +00003precision mediump float;
4
John Kessenich0fbb0c42013-06-06 18:31:21 +00005struct S {
6 vec4 u;
7 uvec4 v;
John Kessenich41a36bb2013-06-19 05:41:25 +00008 lowp isampler3D sampler;
John Kessenich0fbb0c42013-06-06 18:31:21 +00009 vec3 w;
10 struct T1 { // ERROR
11 int a;
12 } t;
13};
14
15uniform S s;
16
17uniform fooBlock {
18 uvec4 bv;
John Kessenich5053a392014-01-07 17:44:41 +000019 uniform mat2 bm2;
John Kessenich41a36bb2013-06-19 05:41:25 +000020 lowp isampler2D sampler; // ERROR
John Kessenich3cd00242015-09-30 18:57:47 -060021 struct T2 { // ERROR
John Kessenich0fbb0c42013-06-06 18:31:21 +000022 int a;
23 } t;
John Kessenich3cd00242015-09-30 18:57:47 -060024 S fbs; // ERROR, contains a sampler
John Kessenich0fbb0c42013-06-06 18:31:21 +000025};
26
27uniform barBlock {
28 uvec4 nbv;
29 int ni;
30} inst;
31
32uniform barBlockArray {
33 uvec4 nbv;
34 int ni;
35} insts[4];
36
John Kessenich06f84642013-06-24 17:26:56 +000037uniform unreferenced {
38 float f;
39 uint u;
40};
41
John Kessenich0fbb0c42013-06-06 18:31:21 +000042void main()
43{
44 texture(s.sampler, vec3(inst.ni, bv.y, insts[2].nbv.z));
John Kessenich41a36bb2013-06-19 05:41:25 +000045 insts[s.v.x]; // ERROR
John Kesseniche9022e12015-07-20 12:03:04 -060046 fooBlock; // ERROR
47 mat4(s); // ERROR
48 int insts;
49 float barBlock;
50 mat4(barBlock);
51 mat4(unreferenced); // ERROR, bad type
52 ++s; // ERROR
53 inst - 1; // ERROR
54 ++barBlock;
55 2 * barBlockArray; // ERROR
John Kessenich0fbb0c42013-06-06 18:31:21 +000056}
John Kesseniche9022e12015-07-20 12:03:04 -060057
58int fooBlock; // ERROR, redef.