mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 22:11:01 +01:00
36 lines
699 B
Plaintext
36 lines
699 B
Plaintext
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
|
|
metal::float4 splat(
|
|
) {
|
|
metal::float2 a = ((metal::float2(1.0) + metal::float2(2.0)) - metal::float2(3.0)) / metal::float2(4.0);
|
|
metal::int4 b = metal::int4(5) % metal::int4(2);
|
|
return a.xyxy + static_cast<float4>(b);
|
|
}
|
|
|
|
int unary(
|
|
) {
|
|
if (!true) {
|
|
return 1;
|
|
} else {
|
|
return !1;
|
|
}
|
|
}
|
|
|
|
metal::float4 selection(
|
|
) {
|
|
metal::float4 vector1_ = metal::float4(1.0);
|
|
metal::float4 vector2_ = metal::float4(1.0);
|
|
int a = true ? 0 : 1;
|
|
return true ? vector1_ : vector2_;
|
|
}
|
|
|
|
kernel void main1(
|
|
) {
|
|
metal::float4 _e0 = splat();
|
|
int _e1 = unary();
|
|
metal::float4 _e2 = selection();
|
|
return;
|
|
}
|