dawn-cmake/test/bug/tint/926.wgsl.expected.msl
James Price 8094553c8a msl: Automatically remap binding numbers in exe
Remap all resources into a flat namespace, to allow tests to pass when
multiple resources use the same binding number.

Fixed: tint:959
Change-Id: I58ed07c789e1ea90fc370ceba73b9d8292902549
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/61261
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-08-12 19:47:20 +00:00

18 lines
570 B
Plaintext

#include <metal_stdlib>
using namespace metal;
struct DrawIndirectArgs {
/* 0x0000 */ atomic_uint vertexCount;
};
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);
}
kernel void computeMain(uint3 global_id [[thread_position_in_grid]], device DrawIndirectArgs& drawOut [[buffer(0)]]) {
thread uint tint_symbol_1 = 0u;
computeMain_inner(drawOut, global_id, &(tint_symbol_1));
return;
}