mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-28 09:09:19 +01:00
* Add support for arrayLength to the wgsl frontend * Fix clippy warning * Add draft support for array length to the msl backend * Finalize support for array length in msl * Convert buffer size to array length in msl backend * Fix clippy warning * Fix misleading documentation * Changes based on review of PR * Use a fake binding for sizes buffer in msl backend if necessary * Only generate the msl buffer size structure if globals are present that have unsized arrays * Make sure to generate separators * Replace uses_unsized_buffers with !self.runtime_sized_buffers.is_empty() * Clear self.runtime_sized_buffers * Run snapshot of shadow.msl * Add Expression::ArrayLength support to the spirv backend * Remove wgsl target from the access snapshot test * Update access.msl snapshot * Update stack size for msl backend * Update stack size again for msl backend
28 lines
559 B
Plaintext
28 lines
559 B
Plaintext
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
struct _mslBufferSizes {
|
|
metal::uint size0;
|
|
};
|
|
|
|
typedef int type1[1];
|
|
struct Bar {
|
|
type1 data;
|
|
};
|
|
struct type4 {
|
|
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)]]
|
|
) {
|
|
return fooOutput { static_cast<float4>(int4(type4 {bar.data[(1 + (_buffer_sizes.size0 - 0 - 4) / 4) - 1u], 2, 3, 4, 5}.inner[vi])) };
|
|
}
|