blob: 076d0b3a965308dd7a707f9b046c84bc73c96817 [file] [log] [blame]
John Kessenich13fd6c92014-08-13 04:15:56 +00001#version 450 core
2
3in float in1;
4in vec2 in2;
5in vec3 in3;
6in vec4 in4;
7
8void main()
9{
10 vec2 v2 = dFdxFine(in2);
11 vec3 v3 = dFdyCoarse(in3);
12 vec4 v4 = fwidth(in4);
13 v4 = dFdyFine(in4);
14 v3 = dFdyFine(in3);
15 float f = dFdx(in1) + dFdxFine(in1) + dFdxCoarse(in1);
16 v4 = fwidthCoarse(in4) + fwidthFine(in4);
John Kessenich69968412014-08-13 06:37:59 +000017
18 float cull = gl_CullDistance[2];
John Kessenichcd77f8e2014-08-13 16:54:02 +000019 float consts = gl_MaxCullDistances + gl_MaxCombinedClipAndCullDistances + gl_MaxSamples;
John Kessenichdf1d81a2014-08-13 08:32:15 +000020
21 if (gl_HelperInvocation)
22 ++v4;
23
24 int sum = gl_MaxVertexImageUniforms +
25 gl_MaxFragmentImageUniforms +
26 gl_MaxComputeImageUniforms +
27 gl_MaxCombinedImageUniforms +
28 gl_MaxCombinedShaderOutputResources;
29
30 bool b1, b3, b;
31 uint uin;
32 bvec2 b2 = mix(bvec2(b1), bvec2(b3), bvec2(b));
33 uint um = mix(uin, uin, b);
34 ivec3 im3 = mix(ivec3(uin), ivec3(uin), bvec3(b));
John Kessenich13fd6c92014-08-13 04:15:56 +000035}
John Kessenichcd77f8e2014-08-13 16:54:02 +000036
37uniform sampler2DMS s2dms;
38uniform usampler2DMSArray us2dmsa;
39layout(rgba32i) uniform iimage2DMS ii2dms;
40layout(rgba32f) uniform image2DMSArray i2dmsa;
41
42void foo()
43{
44 int s = textureSamples(s2dms);
45 s += textureSamples(us2dmsa);
46 s += imageSamples(ii2dms);
47 s += imageSamples(i2dmsa);
48 float f = imageAtomicExchange(i2dmsa, ivec3(in3), 2, 4.5);
49}
Rex Xu3d9165f2016-05-19 07:10:01 +080050
51in float gl_CullDistance[6];
52
53float cull(int i)
54{
55 return (i >= 6) ? gl_CullDistance[5] : gl_CullDistance[i];
56}
John Kessenich8de7e7b2017-06-04 13:05:50 -060057
58layout(location = 6) in bName1 {
59 float f;
60 layout(location = 7) float g;
John Kessenich94c18a82017-06-04 13:17:20 -060061 mat4 m;
John Kessenich8de7e7b2017-06-04 13:05:50 -060062} bInst1;
John Kessenich94c18a82017-06-04 13:17:20 -060063layout(location = 12) in bName2 {
John Kessenich8de7e7b2017-06-04 13:05:50 -060064 float f;
John Kessenich94c18a82017-06-04 13:17:20 -060065 layout(location = 13) float g; // ERROR, location on array
John Kessenich8de7e7b2017-06-04 13:05:50 -060066} bInst2[3];
John Kessenich89400ea2017-06-29 10:46:47 -060067
68layout(early_fragment_tests) in float f; // ERROR, must be standalone