mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-14 19:31:25 +00:00
Add the unit tests samples from src/reader/spirv when: - they are valid for Vulkan 1.0 (plus some common extensions) - they should translate to valid WGSL Bug: tint:1043 Change-Id: I40a01990dbc40aff5cf7ace0b1aabfd0e437f638 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60000 Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: David Neto <dneto@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Reviewed-by: James Price <jrprice@google.com>
44 lines
828 B
Plaintext
44 lines
828 B
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
struct tint_array_wrapper {
|
|
uint arr[2];
|
|
};
|
|
struct S {
|
|
uint field0;
|
|
float field1;
|
|
tint_array_wrapper field2;
|
|
};
|
|
|
|
void main_1(thread bool* const tint_symbol_1, thread bool* const tint_symbol_2) {
|
|
while (true) {
|
|
uint x_2_phi = 0u;
|
|
uint x_3_phi = 0u;
|
|
bool const x_101 = *(tint_symbol_1);
|
|
bool const x_102 = *(tint_symbol_2);
|
|
x_2_phi = 0u;
|
|
x_3_phi = 1u;
|
|
if (x_101) {
|
|
break;
|
|
}
|
|
while (true) {
|
|
uint const x_2 = x_2_phi;
|
|
uint const x_3 = x_3_phi;
|
|
x_2_phi = (x_2 + 1u);
|
|
x_3_phi = x_3;
|
|
if (x_102) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
fragment void tint_symbol() {
|
|
thread bool tint_symbol_3 = false;
|
|
thread bool tint_symbol_4 = false;
|
|
main_1(&(tint_symbol_3), &(tint_symbol_4));
|
|
return;
|
|
}
|
|
|