Files
wgpu/tests/out/msl/const-exprs.msl
T

81 lines
1.4 KiB
Plaintext

// language: metal2.0
#include <metal_stdlib>
#include <simd/simd.h>
using metal::uint;
constant int FOUR = 4;
constant int FOUR_ALIAS = 4;
constant int TEST_CONSTANT_ADDITION = 8;
constant int TEST_CONSTANT_ALIAS_ADDITION = 8;
void swizzle_of_compose(
device metal::int4& out
) {
out = metal::int4(4, 3, 2, 1);
return;
}
void index_of_compose(
device int& out2_
) {
int _e2 = out2_;
out2_ = _e2 + 2;
return;
}
void compose_three_deep(
device int& out2_
) {
int _e2 = out2_;
out2_ = _e2 + 6;
return;
}
void non_constant_initializers(
device metal::int4& out
) {
int w = 30;
int x = {};
int y = {};
int z = 70;
int _e2 = w;
x = _e2;
int _e4 = x;
y = _e4;
int _e9 = w;
int _e10 = x;
int _e11 = y;
int _e12 = z;
metal::int4 _e14 = out;
out = _e14 + metal::int4(_e9, _e10, _e11, _e12);
return;
}
void splat_of_constant(
device metal::int4& out
) {
out = metal::int4(-4, -4, -4, -4);
return;
}
void compose_of_constant(
device metal::int4& out
) {
out = metal::int4(-4, -4, -4, -4);
return;
}
kernel void main_(
device metal::int4& out [[user(fake0)]]
, device int& out2_ [[user(fake0)]]
) {
swizzle_of_compose(out);
index_of_compose(out2_);
compose_three_deep(out2_);
non_constant_initializers(out);
splat_of_constant(out);
compose_of_constant(out);
return;
}