mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 22:11:01 +01:00
39 lines
868 B
Plaintext
39 lines
868 B
Plaintext
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
struct _mslBufferSizes {
|
|
metal::uint size0;
|
|
};
|
|
|
|
typedef int type2[1];
|
|
struct Bar {
|
|
metal::float4x4 matrix;
|
|
type2 data;
|
|
};
|
|
struct type6 {
|
|
int inner[5];
|
|
};
|
|
|
|
struct fooInput {
|
|
};
|
|
struct fooOutput {
|
|
metal::float4 member [[position]];
|
|
};
|
|
vertex fooOutput foo(
|
|
metal::uint vi [[vertex_id]]
|
|
, device Bar& bar [[buffer(0)]]
|
|
, constant _mslBufferSizes& _buffer_sizes [[buffer(24)]]
|
|
) {
|
|
float foo1 = 0.0;
|
|
type6 c;
|
|
float baz = foo1;
|
|
foo1 = 1.0;
|
|
metal::float4 _e9 = bar.matrix[3];
|
|
float b = _e9.x;
|
|
int a = bar.data[(1 + (_buffer_sizes.size0 - 64 - 4) / 4) - 2u];
|
|
for(int _i=0; _i<5; ++_i) c.inner[_i] = type6 {a, static_cast<int>(b), 3, 4, 5}.inner[_i];
|
|
c.inner[vi + 1u] = 42;
|
|
int value = c.inner[vi];
|
|
return fooOutput { static_cast<float4>(metal::int4(value)) };
|
|
}
|