2021-07-05 15:56:32 +00:00
|
|
|
#include <metal_stdlib>
|
2021-06-24 19:01:06 +00:00
|
|
|
|
2021-07-05 15:56:32 +00:00
|
|
|
using namespace metal;
|
2021-06-24 19:01:06 +00:00
|
|
|
struct DrawIndirectArgs {
|
2021-07-05 15:56:32 +00:00
|
|
|
/* 0x0000 */ atomic_uint vertexCount;
|
2021-06-24 19:01:06 +00:00
|
|
|
};
|
|
|
|
|
2021-08-04 22:15:28 +00:00
|
|
|
void computeMain_inner(device DrawIndirectArgs& drawOut, uint3 global_id, thread uint* const tint_symbol) {
|
|
|
|
uint const firstVertex = atomic_fetch_add_explicit(&(drawOut.vertexCount), *(tint_symbol), memory_order_relaxed);
|
|
|
|
}
|
|
|
|
|
2021-07-05 15:56:32 +00:00
|
|
|
kernel void computeMain(uint3 global_id [[thread_position_in_grid]], device DrawIndirectArgs& drawOut [[buffer(5)]]) {
|
|
|
|
thread uint tint_symbol_1 = 0u;
|
2021-08-04 22:15:28 +00:00
|
|
|
computeMain_inner(drawOut, global_id, &(tint_symbol_1));
|
2021-07-05 15:56:32 +00:00
|
|
|
return;
|
2021-06-24 19:01:06 +00:00
|
|
|
}
|
|
|
|
|