2019-09-04 11:10:32 +00:00
|
|
|
#version 450
|
2021-10-19 06:09:55 +00:00
|
|
|
#ifdef GL_ARB_fragment_shader_interlock
|
|
|
|
#extension GL_ARB_fragment_shader_interlock : enable
|
|
|
|
#define SPIRV_Cross_beginInvocationInterlock() beginInvocationInterlockARB()
|
|
|
|
#define SPIRV_Cross_endInvocationInterlock() endInvocationInterlockARB()
|
|
|
|
#elif defined(GL_INTEL_fragment_shader_ordering)
|
|
|
|
#extension GL_INTEL_fragment_shader_ordering : enable
|
|
|
|
#define SPIRV_Cross_beginInvocationInterlock() beginFragmentShaderOrderingINTEL()
|
|
|
|
#define SPIRV_Cross_endInvocationInterlock()
|
|
|
|
#endif
|
|
|
|
#if defined(GL_ARB_fragment_shader_interlock)
|
2019-09-04 11:10:32 +00:00
|
|
|
layout(pixel_interlock_ordered) in;
|
2021-10-19 06:09:55 +00:00
|
|
|
#elif !defined(GL_INTEL_fragment_shader_ordering)
|
|
|
|
#error Fragment Shader Interlock/Ordering extension missing!
|
|
|
|
#endif
|
2019-09-04 11:10:32 +00:00
|
|
|
|
|
|
|
layout(binding = 1, std430) buffer SSBO1
|
|
|
|
{
|
|
|
|
uint values1[];
|
2023-01-11 21:34:44 +00:00
|
|
|
} _11;
|
2019-09-04 11:10:32 +00:00
|
|
|
|
2023-01-11 21:34:44 +00:00
|
|
|
layout(binding = 2, std430) buffer _16_17
|
2019-09-04 11:10:32 +00:00
|
|
|
{
|
|
|
|
uint _m0[];
|
2023-01-11 21:34:44 +00:00
|
|
|
} _17;
|
2019-09-04 11:10:32 +00:00
|
|
|
|
|
|
|
layout(binding = 0, std430) buffer SSBO0
|
|
|
|
{
|
|
|
|
uint values0[];
|
2023-01-11 21:34:44 +00:00
|
|
|
} _13;
|
2019-09-04 11:10:32 +00:00
|
|
|
|
|
|
|
void callee2()
|
|
|
|
{
|
2023-01-11 21:34:44 +00:00
|
|
|
int _25 = int(gl_FragCoord.x);
|
|
|
|
_11.values1[_25]++;
|
2019-09-04 11:10:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void callee()
|
|
|
|
{
|
2023-01-11 21:34:44 +00:00
|
|
|
int _38 = int(gl_FragCoord.x);
|
|
|
|
_13.values0[_38]++;
|
2019-09-04 11:10:32 +00:00
|
|
|
callee2();
|
|
|
|
if (true)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-11 21:34:44 +00:00
|
|
|
void _52()
|
2019-09-04 11:10:32 +00:00
|
|
|
{
|
2023-01-11 21:34:44 +00:00
|
|
|
_17._m0[int(gl_FragCoord.x)] = 4u;
|
2019-09-04 11:10:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void spvMainInterlockedBody()
|
|
|
|
{
|
|
|
|
callee();
|
2023-01-11 21:34:44 +00:00
|
|
|
_52();
|
2019-09-04 11:10:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
// Interlocks were used in a way not compatible with GLSL, this is very slow.
|
2021-10-19 06:09:55 +00:00
|
|
|
SPIRV_Cross_beginInvocationInterlock();
|
2019-09-04 11:10:32 +00:00
|
|
|
spvMainInterlockedBody();
|
2021-10-19 06:09:55 +00:00
|
|
|
SPIRV_Cross_endInvocationInterlock();
|
2019-09-04 11:10:32 +00:00
|
|
|
}
|