mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-11 04:51:32 +11:00
28 lines
508 B
Plaintext
Generated
28 lines
508 B
Plaintext
Generated
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
using namespace metal;
|
|
|
|
struct ConfigBuf
|
|
{
|
|
uint size;
|
|
uint value;
|
|
};
|
|
|
|
struct TargetBuf
|
|
{
|
|
uint data[1];
|
|
};
|
|
|
|
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(256u, 1u, 1u);
|
|
|
|
kernel void main0(const device ConfigBuf& _19 [[buffer(0)]], device TargetBuf& _32 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
|
{
|
|
uint ix = gl_GlobalInvocationID.x;
|
|
if (ix < _19.size)
|
|
{
|
|
_32.data[ix] = _19.value;
|
|
}
|
|
}
|
|
|