mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-28 17:19:11 +01:00
* [msl-out] wrap arrays in structs so that they can be returned by functions * Fix clippy problems * use a raw array for output fields * Fix clippy problems * Apply suggestions * Remove put_initialization_component * Check if the array is a constant size * Don't use the pointer class
18 lines
311 B
Plaintext
18 lines
311 B
Plaintext
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
struct type3 {
|
|
int inner[5];
|
|
};
|
|
|
|
struct fooInput {
|
|
};
|
|
struct fooOutput {
|
|
metal::float4 member [[position]];
|
|
};
|
|
vertex fooOutput foo(
|
|
metal::uint vi [[vertex_id]]
|
|
) {
|
|
return fooOutput { static_cast<float4>(int4(type3 {1, 2, 3, 4, 5}.inner[vi])) };
|
|
}
|