mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-23 07:51:08 +01:00
Also, just use a single out variable for each type. rather than introducing a new output variable for every test we add.
44 lines
776 B
Plaintext
44 lines
776 B
Plaintext
// language: metal2.0
|
|
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
using metal::uint;
|
|
|
|
|
|
void swizzle_of_compose(
|
|
device metal::int4& out
|
|
) {
|
|
metal::int2 a = metal::int2(1, 2);
|
|
metal::int2 b = metal::int2(3, 4);
|
|
out = metal::int4(4, 3, 2, 1);
|
|
return;
|
|
}
|
|
|
|
void index_of_compose(
|
|
device int& out2_
|
|
) {
|
|
metal::int2 a_1 = metal::int2(1, 2);
|
|
metal::int2 b_1 = metal::int2(3, 4);
|
|
int _e7 = out2_;
|
|
out2_ = _e7 + 2;
|
|
return;
|
|
}
|
|
|
|
void compose_three_deep(
|
|
device int& out2_
|
|
) {
|
|
int _e2 = out2_;
|
|
out2_ = _e2 + 6;
|
|
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_);
|
|
return;
|
|
}
|