diff --git a/reference/opt/shaders-hlsl/comp/barriers.comp b/reference/opt/shaders-hlsl/comp/barriers.comp new file mode 100644 index 0000000..b341191 --- /dev/null +++ b/reference/opt/shaders-hlsl/comp/barriers.comp @@ -0,0 +1,26 @@ +static const uint3 gl_WorkGroupSize = uint3(4u, 1u, 1u); + +void comp_main() +{ + DeviceMemoryBarrier(); + DeviceMemoryBarrier(); + DeviceMemoryBarrier(); + DeviceMemoryBarrier(); + DeviceMemoryBarrier(); + DeviceMemoryBarrierWithGroupSync(); + DeviceMemoryBarrier(); + DeviceMemoryBarrierWithGroupSync(); + DeviceMemoryBarrier(); + DeviceMemoryBarrierWithGroupSync(); + DeviceMemoryBarrier(); + DeviceMemoryBarrierWithGroupSync(); + DeviceMemoryBarrier(); + DeviceMemoryBarrierWithGroupSync(); + DeviceMemoryBarrierWithGroupSync(); +} + +[numthreads(4, 1, 1)] +void main() +{ + comp_main(); +} diff --git a/reference/opt/shaders/comp/barriers.comp b/reference/opt/shaders/comp/barriers.comp index 2c78f32..a091497 100644 --- a/reference/opt/shaders/comp/barriers.comp +++ b/reference/opt/shaders/comp/barriers.comp @@ -10,5 +10,19 @@ void main() groupMemoryBarrier(); memoryBarrierShared(); barrier(); + memoryBarrier(); + memoryBarrierShared(); + barrier(); + memoryBarrierImage(); + memoryBarrierShared(); + barrier(); + memoryBarrierBuffer(); + memoryBarrierShared(); + barrier(); + groupMemoryBarrier(); + memoryBarrierShared(); + barrier(); + memoryBarrierShared(); + barrier(); } diff --git a/reference/shaders-hlsl/comp/barriers.comp b/reference/shaders-hlsl/comp/barriers.comp new file mode 100644 index 0000000..6b90a9b --- /dev/null +++ b/reference/shaders-hlsl/comp/barriers.comp @@ -0,0 +1,81 @@ +static const uint3 gl_WorkGroupSize = uint3(4u, 1u, 1u); + +void barrier_shared() +{ + DeviceMemoryBarrier(); +} + +void full_barrier() +{ + DeviceMemoryBarrier(); +} + +void image_barrier() +{ + DeviceMemoryBarrier(); +} + +void buffer_barrier() +{ + DeviceMemoryBarrier(); +} + +void group_barrier() +{ + DeviceMemoryBarrier(); +} + +void barrier_shared_exec() +{ + DeviceMemoryBarrierWithGroupSync(); +} + +void full_barrier_exec() +{ + DeviceMemoryBarrier(); + DeviceMemoryBarrierWithGroupSync(); +} + +void image_barrier_exec() +{ + DeviceMemoryBarrier(); + DeviceMemoryBarrierWithGroupSync(); +} + +void buffer_barrier_exec() +{ + DeviceMemoryBarrier(); + DeviceMemoryBarrierWithGroupSync(); +} + +void group_barrier_exec() +{ + DeviceMemoryBarrier(); + DeviceMemoryBarrierWithGroupSync(); +} + +void exec_barrier() +{ + DeviceMemoryBarrierWithGroupSync(); +} + +void comp_main() +{ + barrier_shared(); + full_barrier(); + image_barrier(); + buffer_barrier(); + group_barrier(); + barrier_shared_exec(); + full_barrier_exec(); + image_barrier_exec(); + buffer_barrier_exec(); + group_barrier_exec(); + exec_barrier(); +} + +[numthreads(4, 1, 1)] +void main() +{ + comp_main(); +} diff --git a/reference/shaders/comp/barriers.comp b/reference/shaders/comp/barriers.comp index 50da322..a1b975d 100644 --- a/reference/shaders/comp/barriers.comp +++ b/reference/shaders/comp/barriers.comp @@ -26,6 +26,40 @@ void group_barrier() groupMemoryBarrier(); } +void barrier_shared_exec() +{ + memoryBarrierShared(); + barrier(); +} + +void full_barrier_exec() +{ + memoryBarrier(); + memoryBarrierShared(); + barrier(); +} + +void image_barrier_exec() +{ + memoryBarrierImage(); + memoryBarrierShared(); + barrier(); +} + +void buffer_barrier_exec() +{ + memoryBarrierBuffer(); + memoryBarrierShared(); + barrier(); +} + +void group_barrier_exec() +{ + groupMemoryBarrier(); + memoryBarrierShared(); + barrier(); +} + void exec_barrier() { memoryBarrierShared(); @@ -39,6 +73,11 @@ void main() image_barrier(); buffer_barrier(); group_barrier(); + barrier_shared_exec(); + full_barrier_exec(); + image_barrier_exec(); + buffer_barrier_exec(); + group_barrier_exec(); exec_barrier(); } diff --git a/shaders-hlsl/comp/barriers.comp b/shaders-hlsl/comp/barriers.comp new file mode 100644 index 0000000..7e0ea42 --- /dev/null +++ b/shaders-hlsl/comp/barriers.comp @@ -0,0 +1,79 @@ +#version 310 es +layout(local_size_x = 4) in; + +void barrier_shared() +{ + memoryBarrierShared(); +} + +void full_barrier() +{ + memoryBarrier(); +} + +void image_barrier() +{ + memoryBarrierImage(); +} + +void buffer_barrier() +{ + memoryBarrierBuffer(); +} + +void group_barrier() +{ + groupMemoryBarrier(); +} + +void barrier_shared_exec() +{ + memoryBarrierShared(); + barrier(); +} + +void full_barrier_exec() +{ + memoryBarrier(); + barrier(); +} + +void image_barrier_exec() +{ + memoryBarrierImage(); + barrier(); +} + +void buffer_barrier_exec() +{ + memoryBarrierBuffer(); + barrier(); +} + +void group_barrier_exec() +{ + groupMemoryBarrier(); + barrier(); +} + +void exec_barrier() +{ + barrier(); +} + +void main() +{ + barrier_shared(); + full_barrier(); + image_barrier(); + buffer_barrier(); + group_barrier(); + + barrier_shared_exec(); + full_barrier_exec(); + image_barrier_exec(); + buffer_barrier_exec(); + group_barrier_exec(); + + exec_barrier(); +} diff --git a/shaders/comp/barriers.comp b/shaders/comp/barriers.comp index ebe4ed0..7e0ea42 100644 --- a/shaders/comp/barriers.comp +++ b/shaders/comp/barriers.comp @@ -26,6 +26,36 @@ void group_barrier() groupMemoryBarrier(); } +void barrier_shared_exec() +{ + memoryBarrierShared(); + barrier(); +} + +void full_barrier_exec() +{ + memoryBarrier(); + barrier(); +} + +void image_barrier_exec() +{ + memoryBarrierImage(); + barrier(); +} + +void buffer_barrier_exec() +{ + memoryBarrierBuffer(); + barrier(); +} + +void group_barrier_exec() +{ + groupMemoryBarrier(); + barrier(); +} + void exec_barrier() { barrier(); @@ -38,5 +68,12 @@ void main() image_barrier(); buffer_barrier(); group_barrier(); + + barrier_shared_exec(); + full_barrier_exec(); + image_barrier_exec(); + buffer_barrier_exec(); + group_barrier_exec(); + exec_barrier(); }