Merge pull request #2892 from greg-lunarg/mb
[platform/upstream/glslang.git] / Test / 140.vert
1 #version 140\r
2 \r
3 uniform isamplerBuffer sbuf;\r
4 \r
5 layout(std140) uniform blockName {\r
6     int anonMem;\r
7 };\r
8 \r
9 void main()\r
10 {\r
11     int id = gl_InstanceID;\r
12     id += anonMem;\r
13     id += texelFetch(sbuf, 8).w;\r
14     gl_ClipVertex;      // could be ERROR, but compiling under compatibility profile\r
15     gl_Color;           // could be ERROR, but compiling under compatibility profile\r
16     gl_LightSource[0];  // could be ERROR, but compiling under compatibility profile\r
17     gl_DepthRange.far;\r
18     gl_TexCoord;        // could be ERROR, but compiling under compatibility profile\r
19     gl_FogFragCoord;    // could be ERROR, but compiling under compatibility profile\r
20     gl_FrontColor;      // could be ERROR, but compiling under compatibility profile\r
21 }\r
22 \r
23 out vec4 gl_Position;  // ERROR\r
24 \r
25 layout(location = 9) in vec4 locBad;  // ERROR\r
26 \r
27 #extension GL_ARB_explicit_attrib_location : enable\r
28 \r
29 layout(location = 9) in vec4 loc;\r
30 \r
31 #extension GL_ARB_separate_shader_objects : enable\r
32 \r
33 out vec4 gl_Position;\r
34 in vec4 gl_Position;   // ERROR\r
35 out vec3 gl_Position;  // ERROR\r
36 \r
37 out float gl_PointSize;\r
38 out vec4 gl_ClipVertex;\r
39 out float gl_FogFragCoord;\r
40 \r
41 uniform sampler2DRect s2dr;\r
42 uniform sampler2DRectShadow s2drs;\r
43 in ivec2 itloc2;\r
44 in vec2 tloc2;\r
45 in vec3 tloc3;\r
46 in vec4 tloc4;\r
47 \r
48 void foo()\r
49 {\r
50     vec4 v = texelFetch(s2dr, itloc2);\r
51     v += texelFetch(s2dr, itloc2, 0.2);     // ERROR, no lod\r
52     v += texture(s2dr, tloc2);\r
53     v += texture(s2dr, tloc2, 0.3);         // ERROR, no bias\r
54     v += texture(s2drs, tloc3);\r
55     v += textureProj(s2dr, tloc3);\r
56     v += textureProj(s2dr, tloc4);\r
57     v += textureProjGradOffset(s2dr, tloc4, ivec2(0.0), ivec2(0.0), ivec2(1,2));\r
58     v += textureProjGradOffset(s2drs, tloc4, ivec2(0.0), ivec2(0.0), ivec2(1,2));\r
59 }\r
60
61 void devi()
62 {
63     gl_DeviceIndex; // ERROR, no extension
64     gl_ViewIndex;   // ERROR, no extension
65 }
66
67 #ifdef GL_EXT_device_group
68 #extension GL_EXT_device_group : enable
69 #endif
70
71 #ifdef GL_EXT_multiview
72 #extension GL_EXT_multiview : enable
73 #endif
74
75 void devie()
76 {
77     gl_DeviceIndex;
78     gl_ViewIndex;
79 }