2014-08-13 04:15:56 +00:00
|
|
|
#version 450 core
|
|
|
|
|
|
|
|
in float in1;
|
|
|
|
in vec2 in2;
|
|
|
|
in vec3 in3;
|
|
|
|
in vec4 in4;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec2 v2 = dFdxFine(in2);
|
|
|
|
vec3 v3 = dFdyCoarse(in3);
|
|
|
|
vec4 v4 = fwidth(in4);
|
|
|
|
v4 = dFdyFine(in4);
|
|
|
|
v3 = dFdyFine(in3);
|
|
|
|
float f = dFdx(in1) + dFdxFine(in1) + dFdxCoarse(in1);
|
|
|
|
v4 = fwidthCoarse(in4) + fwidthFine(in4);
|
2014-08-13 06:37:59 +00:00
|
|
|
|
|
|
|
float cull = gl_CullDistance[2];
|
2014-08-13 16:54:02 +00:00
|
|
|
float consts = gl_MaxCullDistances + gl_MaxCombinedClipAndCullDistances + gl_MaxSamples;
|
2014-08-13 08:32:15 +00:00
|
|
|
|
|
|
|
if (gl_HelperInvocation)
|
|
|
|
++v4;
|
|
|
|
|
|
|
|
int sum = gl_MaxVertexImageUniforms +
|
|
|
|
gl_MaxFragmentImageUniforms +
|
|
|
|
gl_MaxComputeImageUniforms +
|
|
|
|
gl_MaxCombinedImageUniforms +
|
|
|
|
gl_MaxCombinedShaderOutputResources;
|
|
|
|
|
|
|
|
bool b1, b3, b;
|
|
|
|
uint uin;
|
|
|
|
bvec2 b2 = mix(bvec2(b1), bvec2(b3), bvec2(b));
|
|
|
|
uint um = mix(uin, uin, b);
|
|
|
|
ivec3 im3 = mix(ivec3(uin), ivec3(uin), bvec3(b));
|
2014-08-13 04:15:56 +00:00
|
|
|
}
|
2014-08-13 16:54:02 +00:00
|
|
|
|
|
|
|
uniform sampler2DMS s2dms;
|
|
|
|
uniform usampler2DMSArray us2dmsa;
|
|
|
|
layout(rgba32i) uniform iimage2DMS ii2dms;
|
|
|
|
layout(rgba32f) uniform image2DMSArray i2dmsa;
|
|
|
|
|
|
|
|
void foo()
|
|
|
|
{
|
|
|
|
int s = textureSamples(s2dms);
|
|
|
|
s += textureSamples(us2dmsa);
|
|
|
|
s += imageSamples(ii2dms);
|
|
|
|
s += imageSamples(i2dmsa);
|
|
|
|
float f = imageAtomicExchange(i2dmsa, ivec3(in3), 2, 4.5);
|
|
|
|
}
|
2016-05-18 23:10:01 +00:00
|
|
|
|
2021-03-24 19:52:23 +00:00
|
|
|
#extension GL_ARB_sparse_texture2: enable
|
|
|
|
|
|
|
|
uniform sampler2D s2D;
|
|
|
|
uniform isampler2DArray is2DArray;
|
|
|
|
uniform sampler2DRectShadow s2DRectShadow;
|
|
|
|
|
|
|
|
in flat ivec2 offsets[4];
|
|
|
|
in vec2 c2;
|
|
|
|
in vec3 c3;
|
|
|
|
|
|
|
|
void testOffsets()
|
|
|
|
{
|
|
|
|
vec4 texel = vec4(0.0);
|
|
|
|
ivec4 itexel = ivec4(0);
|
|
|
|
const ivec2 constOffsets[4] = ivec2[4](ivec2(1,2), ivec2(3,4), ivec2(15,16), ivec2(-2,0));
|
|
|
|
sparseTextureGatherOffsetsARB(s2D, c2, constOffsets, texel);
|
|
|
|
sparseTextureGatherOffsetsARB(is2DArray, c3, constOffsets, itexel, 2);
|
|
|
|
sparseTextureGatherOffsetsARB(s2DRectShadow, c2, 2.0, constOffsets, texel);
|
|
|
|
|
|
|
|
sparseTextureGatherOffsetsARB(s2D, c2, offsets, texel); // Error : Non constant offsets
|
|
|
|
sparseTextureGatherOffsetsARB(is2DArray, c3, offsets, itexel, 2); // Error : Non constant offsets
|
|
|
|
sparseTextureGatherOffsetsARB(s2DRectShadow, c2, 2.0, offsets, texel); // Error : Non constant offsets
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-05-18 23:10:01 +00:00
|
|
|
in float gl_CullDistance[6];
|
|
|
|
|
|
|
|
float cull(int i)
|
|
|
|
{
|
|
|
|
return (i >= 6) ? gl_CullDistance[5] : gl_CullDistance[i];
|
|
|
|
}
|
2017-06-04 19:05:50 +00:00
|
|
|
|
|
|
|
layout(location = 6) in bName1 {
|
|
|
|
float f;
|
|
|
|
layout(location = 7) float g;
|
2017-06-04 19:17:20 +00:00
|
|
|
mat4 m;
|
2017-06-04 19:05:50 +00:00
|
|
|
} bInst1;
|
2017-06-04 19:17:20 +00:00
|
|
|
layout(location = 12) in bName2 {
|
2017-06-04 19:05:50 +00:00
|
|
|
float f;
|
2017-06-04 19:17:20 +00:00
|
|
|
layout(location = 13) float g; // ERROR, location on array
|
2017-06-04 19:05:50 +00:00
|
|
|
} bInst2[3];
|
2017-06-29 16:46:47 +00:00
|
|
|
|
|
|
|
layout(early_fragment_tests) in float f; // ERROR, must be standalone
|