2022-02-03 18:00:04 +00:00
|
|
|
// language: metal2.0
|
2021-05-29 01:49:50 +00:00
|
|
|
#include <metal_stdlib>
|
|
|
|
#include <simd/simd.h>
|
|
|
|
|
2022-02-21 21:22:54 +00:00
|
|
|
using metal::uint;
|
|
|
|
|
2022-01-06 01:15:09 +00:00
|
|
|
struct _mslBufferSizes {
|
2022-02-21 21:22:54 +00:00
|
|
|
uint size3;
|
2022-01-06 01:15:09 +00:00
|
|
|
};
|
|
|
|
|
2021-12-27 02:57:47 +00:00
|
|
|
constexpr constant bool Foo_2 = true;
|
2021-11-09 14:24:41 +00:00
|
|
|
struct type_2 {
|
2021-05-29 02:11:39 +00:00
|
|
|
float inner[10u];
|
2021-05-29 01:49:50 +00:00
|
|
|
};
|
2021-12-27 02:57:47 +00:00
|
|
|
struct Foo {
|
|
|
|
metal::packed_float3 v3_;
|
|
|
|
float v1_;
|
|
|
|
};
|
2022-01-06 01:15:09 +00:00
|
|
|
typedef metal::float2 type_6[1];
|
2022-01-21 17:30:18 +00:00
|
|
|
struct type_8 {
|
|
|
|
metal::float4 inner[20];
|
2022-01-06 01:15:09 +00:00
|
|
|
};
|
2022-04-10 19:26:52 +00:00
|
|
|
constant metal::float3 const_type_4_ = {0.0, 0.0, 0.0};
|
|
|
|
constant metal::float3x3 const_type_10_ = {const_type_4_, const_type_4_, const_type_4_};
|
2021-05-29 01:49:50 +00:00
|
|
|
|
2021-11-09 14:24:41 +00:00
|
|
|
kernel void main_(
|
|
|
|
threadgroup type_2& wg
|
2021-11-24 22:36:57 +00:00
|
|
|
, threadgroup metal::atomic_uint& at_1
|
2022-02-03 18:00:04 +00:00
|
|
|
, device Foo& alignment [[user(fake0)]]
|
2022-03-06 17:08:40 +00:00
|
|
|
, device type_6 const& dummy [[user(fake0)]]
|
2022-02-04 21:31:16 +00:00
|
|
|
, constant _mslBufferSizes& _buffer_sizes [[user(fake0)]]
|
2021-05-29 01:49:50 +00:00
|
|
|
) {
|
2022-04-10 10:35:04 +00:00
|
|
|
metal::float3 unnamed;
|
|
|
|
metal::float2 unnamed_1;
|
|
|
|
int idx = 1;
|
2021-12-27 02:57:47 +00:00
|
|
|
float Foo_1 = 1.0;
|
2021-11-24 22:36:57 +00:00
|
|
|
bool at = true;
|
2022-01-21 17:30:18 +00:00
|
|
|
float _e9 = alignment.v1_;
|
|
|
|
wg.inner[3] = _e9;
|
2022-04-10 17:22:56 +00:00
|
|
|
float _e14 = alignment.v3_[0];
|
2022-01-21 17:30:18 +00:00
|
|
|
wg.inner[2] = _e14;
|
2022-04-10 17:22:56 +00:00
|
|
|
metal::float3 _e16 = alignment.v3_;
|
2022-04-10 10:35:04 +00:00
|
|
|
unnamed = _e16;
|
2022-04-10 17:22:56 +00:00
|
|
|
metal::float3 _e19 = alignment.v3_;
|
2022-04-10 10:35:04 +00:00
|
|
|
unnamed_1 = _e19.zx;
|
2022-03-06 17:08:40 +00:00
|
|
|
alignment.v1_ = 4.0;
|
2022-02-04 21:31:16 +00:00
|
|
|
wg.inner[1] = static_cast<float>(1 + (_buffer_sizes.size3 - 0 - 8) / 8);
|
2021-11-24 22:36:57 +00:00
|
|
|
metal::atomic_store_explicit(&at_1, 2u, metal::memory_order_relaxed);
|
2022-04-10 10:35:04 +00:00
|
|
|
alignment.v3_ = metal::float3(1.0);
|
2022-04-10 17:22:56 +00:00
|
|
|
alignment.v3_[0] = 1.0;
|
|
|
|
alignment.v3_[0] = 2.0;
|
2022-04-10 10:35:04 +00:00
|
|
|
int _e42 = idx;
|
|
|
|
alignment.v3_[_e42] = 3.0;
|
2022-04-10 19:26:52 +00:00
|
|
|
metal::float3 _e47 = alignment.v3_;
|
|
|
|
metal::float3 unnamed_2 = _e47 * const_type_10_;
|
|
|
|
metal::float3 _e50 = alignment.v3_;
|
|
|
|
metal::float3 unnamed_3 = const_type_10_ * _e50;
|
2021-05-29 01:49:50 +00:00
|
|
|
}
|