SPIRV-Cross/reference/shaders-msl/comp/access-private-workgroup-in-function.comp
2018-05-16 10:49:30 +02:00

35 lines
501 B
Plaintext

#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
void set_f(thread int& f)
{
f = 40;
}
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;
}
}