From 825f07c04a510958b0e9d2c4e90d931881eecbec Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Fri, 29 Sep 2017 10:21:02 +0200 Subject: [PATCH] Add test for specialization constant workgroup size on HLSL. --- .../comp/specialization-constant-workgroup.comp | 16 ++++++++++++++++ .../comp/specialization-constant-workgroup.comp | 12 ++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 reference/shaders-hlsl/comp/specialization-constant-workgroup.comp create mode 100644 shaders-hlsl/comp/specialization-constant-workgroup.comp diff --git a/reference/shaders-hlsl/comp/specialization-constant-workgroup.comp b/reference/shaders-hlsl/comp/specialization-constant-workgroup.comp new file mode 100644 index 00000000..61a55659 --- /dev/null +++ b/reference/shaders-hlsl/comp/specialization-constant-workgroup.comp @@ -0,0 +1,16 @@ +const uint _13 = 1u; +const uint _15 = 1u; +const uint3 gl_WorkGroupSize = uint3(_13, 10u, _15); + +RWByteAddressBuffer _10 : register(u0); + +void comp_main() +{ + _10.Store3(0, gl_WorkGroupSize); +} + +[numthreads(1, 10, 1)] +void main() +{ + comp_main(); +} diff --git a/shaders-hlsl/comp/specialization-constant-workgroup.comp b/shaders-hlsl/comp/specialization-constant-workgroup.comp new file mode 100644 index 00000000..3beeb8c1 --- /dev/null +++ b/shaders-hlsl/comp/specialization-constant-workgroup.comp @@ -0,0 +1,12 @@ +#version 310 es +layout(local_size_x_id = 3, local_size_y = 10, local_size_z_id = 20) in; + +layout(binding = 0) buffer SSBO +{ + uvec3 wg_size; +}; + +void main() +{ + wg_size = gl_WorkGroupSize; +}