diff options
author | Erfan Ahmadi <ahmadierfan99@gmail.com> | 2021-10-19 09:09:55 +0300 |
---|---|---|
committer | Hans-Kristian Arntzen <post@arntzen-software.no> | 2021-10-25 11:50:10 +0300 |
commit | 43eecb23603a5eccaefdc423a8b488931609c85f (patch) | |
tree | 12cf58dd1f6032464b3f40ab04a4136e2b3c95e6 /reference/opt | |
parent | 94dea2507e4fb65fb155359b19780382fb7542bf (diff) |
SPIRV-Cross contribution needed for `INTEL_fragment_shader_ordering`
Diffstat (limited to 'reference/opt')
4 files changed, 60 insertions, 12 deletions
diff --git a/reference/opt/shaders/frag/pixel-interlock-ordered.frag b/reference/opt/shaders/frag/pixel-interlock-ordered.frag index 46cca96c..915b5651 100644 --- a/reference/opt/shaders/frag/pixel-interlock-ordered.frag +++ b/reference/opt/shaders/frag/pixel-interlock-ordered.frag @@ -1,6 +1,18 @@ #version 450 -#extension GL_ARB_fragment_shader_interlock : require +#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) layout(pixel_interlock_ordered) in; +#elif !defined(GL_INTEL_fragment_shader_ordering) +#error Fragment Shader Interlock/Ordering extension missing! +#endif layout(binding = 2, std430) coherent buffer Buffer { @@ -13,11 +25,11 @@ layout(binding = 1, r32ui) uniform uimage2D img2; void main() { - beginInvocationInterlockARB(); + SPIRV_Cross_beginInvocationInterlock(); imageStore(img, ivec2(0), vec4(1.0, 0.0, 0.0, 1.0)); uint _27 = imageAtomicAdd(img2, ivec2(0), 1u); _30.foo += 42; uint _41 = atomicAnd(_30.bar, 255u); - endInvocationInterlockARB(); + SPIRV_Cross_endInvocationInterlock(); } diff --git a/reference/opt/shaders/frag/pixel-interlock-unordered.frag b/reference/opt/shaders/frag/pixel-interlock-unordered.frag index d60cd145..13962daf 100644 --- a/reference/opt/shaders/frag/pixel-interlock-unordered.frag +++ b/reference/opt/shaders/frag/pixel-interlock-unordered.frag @@ -1,6 +1,18 @@ #version 450 -#extension GL_ARB_fragment_shader_interlock : require +#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) layout(pixel_interlock_unordered) in; +#elif !defined(GL_INTEL_fragment_shader_ordering) +#error Fragment Shader Interlock/Ordering extension missing! +#endif layout(binding = 2, std430) coherent buffer Buffer { @@ -13,11 +25,11 @@ layout(binding = 1, r32ui) uniform uimage2D img2; void main() { - beginInvocationInterlockARB(); + SPIRV_Cross_beginInvocationInterlock(); imageStore(img, ivec2(0), vec4(1.0, 0.0, 0.0, 1.0)); uint _27 = imageAtomicAdd(img2, ivec2(0), 1u); _30.foo += 42; uint _41 = atomicAnd(_30.bar, 255u); - endInvocationInterlockARB(); + SPIRV_Cross_endInvocationInterlock(); } diff --git a/reference/opt/shaders/frag/sample-interlock-ordered.frag b/reference/opt/shaders/frag/sample-interlock-ordered.frag index 67ca5560..9d5f90e4 100644 --- a/reference/opt/shaders/frag/sample-interlock-ordered.frag +++ b/reference/opt/shaders/frag/sample-interlock-ordered.frag @@ -1,6 +1,18 @@ #version 450 -#extension GL_ARB_fragment_shader_interlock : require +#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) layout(sample_interlock_ordered) in; +#elif !defined(GL_INTEL_fragment_shader_ordering) +#error Fragment Shader Interlock/Ordering extension missing! +#endif layout(binding = 2, std430) coherent buffer Buffer { @@ -13,11 +25,11 @@ layout(binding = 1, r32ui) uniform uimage2D img2; void main() { - beginInvocationInterlockARB(); + SPIRV_Cross_beginInvocationInterlock(); imageStore(img, ivec2(0), vec4(1.0, 0.0, 0.0, 1.0)); uint _27 = imageAtomicAdd(img2, ivec2(0), 1u); _30.foo += 42; uint _47 = atomicAnd(_30.bar, uint(gl_SampleMaskIn[0])); - endInvocationInterlockARB(); + SPIRV_Cross_endInvocationInterlock(); } diff --git a/reference/opt/shaders/frag/sample-interlock-unordered.frag b/reference/opt/shaders/frag/sample-interlock-unordered.frag index ea74397d..44119881 100644 --- a/reference/opt/shaders/frag/sample-interlock-unordered.frag +++ b/reference/opt/shaders/frag/sample-interlock-unordered.frag @@ -1,6 +1,18 @@ #version 450 -#extension GL_ARB_fragment_shader_interlock : require +#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) layout(sample_interlock_unordered) in; +#elif !defined(GL_INTEL_fragment_shader_ordering) +#error Fragment Shader Interlock/Ordering extension missing! +#endif layout(binding = 2, std430) coherent buffer Buffer { @@ -13,11 +25,11 @@ layout(binding = 1, r32ui) uniform uimage2D img2; void main() { - beginInvocationInterlockARB(); + SPIRV_Cross_beginInvocationInterlock(); imageStore(img, ivec2(0), vec4(1.0, 0.0, 0.0, 1.0)); uint _27 = imageAtomicAdd(img2, ivec2(0), 1u); _30.foo += 42; uint _41 = atomicAnd(_30.bar, 255u); - endInvocationInterlockARB(); + SPIRV_Cross_endInvocationInterlock(); } |