John Kessenich | 13fd6c9 | 2014-08-13 04:15:56 +0000 | [diff] [blame] | 1 | #version 450 core
|
| 2 |
|
| 3 | in float in1;
|
| 4 | in vec2 in2;
|
| 5 | in vec3 in3;
|
| 6 | in vec4 in4;
|
| 7 |
|
| 8 | void 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 Kessenich | 6996841 | 2014-08-13 06:37:59 +0000 | [diff] [blame] | 17 |
|
| 18 | float cull = gl_CullDistance[2];
|
John Kessenich | cd77f8e | 2014-08-13 16:54:02 +0000 | [diff] [blame] | 19 | float consts = gl_MaxCullDistances + gl_MaxCombinedClipAndCullDistances + gl_MaxSamples;
|
John Kessenich | df1d81a | 2014-08-13 08:32:15 +0000 | [diff] [blame] | 20 |
|
| 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 Kessenich | 13fd6c9 | 2014-08-13 04:15:56 +0000 | [diff] [blame] | 35 | }
|
John Kessenich | cd77f8e | 2014-08-13 16:54:02 +0000 | [diff] [blame] | 36 |
|
| 37 | uniform sampler2DMS s2dms;
|
| 38 | uniform usampler2DMSArray us2dmsa;
|
| 39 | layout(rgba32i) uniform iimage2DMS ii2dms;
|
| 40 | layout(rgba32f) uniform image2DMSArray i2dmsa;
|
| 41 |
|
| 42 | void 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 Xu | 3d9165f | 2016-05-19 07:10:01 +0800 | [diff] [blame] | 50 |
|
| 51 | in float gl_CullDistance[6];
|
| 52 |
|
| 53 | float cull(int i)
|
| 54 | {
|
| 55 | return (i >= 6) ? gl_CullDistance[5] : gl_CullDistance[i];
|
| 56 | }
|
John Kessenich | 8de7e7b | 2017-06-04 13:05:50 -0600 | [diff] [blame] | 57 |
|
| 58 | layout(location = 6) in bName1 {
|
| 59 | float f;
|
| 60 | layout(location = 7) float g;
|
John Kessenich | 94c18a8 | 2017-06-04 13:17:20 -0600 | [diff] [blame] | 61 | mat4 m;
|
John Kessenich | 8de7e7b | 2017-06-04 13:05:50 -0600 | [diff] [blame] | 62 | } bInst1;
|
John Kessenich | 94c18a8 | 2017-06-04 13:17:20 -0600 | [diff] [blame] | 63 | layout(location = 12) in bName2 {
|
John Kessenich | 8de7e7b | 2017-06-04 13:05:50 -0600 | [diff] [blame] | 64 | float f;
|
John Kessenich | 94c18a8 | 2017-06-04 13:17:20 -0600 | [diff] [blame] | 65 | layout(location = 13) float g; // ERROR, location on array
|
John Kessenich | 8de7e7b | 2017-06-04 13:05:50 -0600 | [diff] [blame] | 66 | } bInst2[3];
|
John Kessenich | 89400ea | 2017-06-29 10:46:47 -0600 | [diff] [blame] | 67 |
|
| 68 | layout(early_fragment_tests) in float f; // ERROR, must be standalone
|