mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-06 12:15:43 +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>
26 lines
635 B
Plaintext
26 lines
635 B
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
struct Constants {
|
|
/* 0x0000 */ uint zero;
|
|
};
|
|
struct Result {
|
|
/* 0x0000 */ uint value;
|
|
};
|
|
struct tint_array_wrapper {
|
|
/* 0x0000 */ atomic_int arr[3];
|
|
};
|
|
struct TestData {
|
|
/* 0x0000 */ tint_array_wrapper data;
|
|
};
|
|
|
|
int runTest(constant Constants& constants, device TestData& s) {
|
|
return atomic_load_explicit(&(s.data.arr[(0u + uint(constants.zero))]), memory_order_relaxed);
|
|
}
|
|
|
|
kernel void tint_symbol(constant Constants& constants [[buffer(0)]], device Result& result [[buffer(1)]], device TestData& s [[buffer(2)]]) {
|
|
result.value = uint(runTest(constants, s));
|
|
return;
|
|
}
|
|
|