From 439602dc6cd3dd06449042c98742368aac2aaaab Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Tue, 18 Sep 2018 09:32:53 +0200 Subject: [PATCH] Add missing reference files. --- .../asm/comp/atomic-decrement.asm.comp | 22 +++++++++++++++++++ .../asm/comp/atomic-increment.asm.comp | 22 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 reference/opt/shaders-hlsl/asm/comp/atomic-decrement.asm.comp create mode 100644 reference/opt/shaders-hlsl/asm/comp/atomic-increment.asm.comp diff --git a/reference/opt/shaders-hlsl/asm/comp/atomic-decrement.asm.comp b/reference/opt/shaders-hlsl/asm/comp/atomic-decrement.asm.comp new file mode 100644 index 00000000..b86b5327 --- /dev/null +++ b/reference/opt/shaders-hlsl/asm/comp/atomic-decrement.asm.comp @@ -0,0 +1,22 @@ +RWByteAddressBuffer u0_counter : register(u1); +RWBuffer u0 : register(u0); + +static uint3 gl_GlobalInvocationID; +struct SPIRV_Cross_Input +{ + uint3 gl_GlobalInvocationID : SV_DispatchThreadID; +}; + +void comp_main() +{ + uint _29; + u0_counter.InterlockedAdd(0, -1, _29); + u0[uint(asint(asfloat(_29))) + 0u] = uint(int(gl_GlobalInvocationID.x)).x; +} + +[numthreads(4, 1, 1)] +void main(SPIRV_Cross_Input stage_input) +{ + gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID; + comp_main(); +} diff --git a/reference/opt/shaders-hlsl/asm/comp/atomic-increment.asm.comp b/reference/opt/shaders-hlsl/asm/comp/atomic-increment.asm.comp new file mode 100644 index 00000000..f2338f22 --- /dev/null +++ b/reference/opt/shaders-hlsl/asm/comp/atomic-increment.asm.comp @@ -0,0 +1,22 @@ +RWByteAddressBuffer u0_counter : register(u1); +RWBuffer u0 : register(u0); + +static uint3 gl_GlobalInvocationID; +struct SPIRV_Cross_Input +{ + uint3 gl_GlobalInvocationID : SV_DispatchThreadID; +}; + +void comp_main() +{ + uint _29; + u0_counter.InterlockedAdd(0, 1, _29); + u0[uint(asint(asfloat(_29))) + 0u] = uint(int(gl_GlobalInvocationID.x)).x; +} + +[numthreads(4, 1, 1)] +void main(SPIRV_Cross_Input stage_input) +{ + gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID; + comp_main(); +}