Add specialization constant work group size test for MSL.
This commit is contained in:
Родитель
825f07c04a
Коммит
cff0fb57dc
|
@ -0,0 +1,21 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
constant uint _13_tmp [[function_constant(3)]];
|
||||
constant uint _13 = is_function_constant_defined(_13_tmp) ? _13_tmp : 1u;
|
||||
constant uint _15_tmp [[function_constant(20)]];
|
||||
constant uint _15 = is_function_constant_defined(_15_tmp) ? _15_tmp : 1u;
|
||||
constant uint3 gl_WorkGroupSize = uint3(_13, 10u, _15);
|
||||
|
||||
struct SSBO
|
||||
{
|
||||
uint3 wg_size;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _10 [[buffer(0)]])
|
||||
{
|
||||
_10.wg_size = gl_WorkGroupSize;
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
Загрузка…
Ссылка в новой задаче