mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-05 11:45:54 +00:00
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>
18 lines
570 B
Plaintext
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;
|
|
}
|
|
|