SPIRV-Cross/reference/shaders-msl/comp/access-private-workgroup-in-function.comp

35 lines
515 B
Plaintext

#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
inline void set_f(thread int& f)
{
f = 40;
}
inline void set_shared_u(threadgroup int& u)
{
u = 50;
}
kernel void main0(uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]])
{
threadgroup int u;
int f;
set_f(f);
set_shared_u(u);
if (gl_LocalInvocationIndex == 0u)
{
f = 10;
}
else
{
f = 30;
u = 20;
}
}