mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-06 04:05:40 +00:00
Added to hlsl, msl, glsl, and spirv backends. Bug: tint:1300 Change-Id: I06062bd8e4b32acbc4a8670b060a7a22bc1ae034 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80600 Reviewed-by: Ben Clayton <bclayton@google.com> Reviewed-by: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
31 lines
842 B
Plaintext
31 lines
842 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(device TestData* const tint_symbol_3, const constant Constants* const tint_symbol_4) {
|
|
return atomic_load_explicit(&((*(tint_symbol_3)).data.arr[(0u + uint((*(tint_symbol_4)).zero))]), memory_order_relaxed);
|
|
}
|
|
|
|
kernel void tint_symbol(device TestData* tint_symbol_5 [[buffer(2)]], const constant Constants* tint_symbol_6 [[buffer(0)]], device Result* tint_symbol_7 [[buffer(1)]]) {
|
|
int const tint_symbol_1 = runTest(tint_symbol_5, tint_symbol_6);
|
|
uint const tint_symbol_2 = uint(tint_symbol_1);
|
|
(*(tint_symbol_7)).value = tint_symbol_2;
|
|
return;
|
|
}
|
|
|