mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
55 lines
1.4 KiB
Plaintext
55 lines
1.4 KiB
Plaintext
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
typedef float type6[1u];
|
|
struct gl_PerVertex {
|
|
metal::float4 gl_Position;
|
|
float gl_PointSize;
|
|
type6 gl_ClipDistance;
|
|
type6 gl_CullDistance;
|
|
};
|
|
struct type10 {
|
|
metal::float2 member;
|
|
metal::float4 gl_Position1;
|
|
float gl_PointSize1;
|
|
type6 gl_ClipDistance1;
|
|
};
|
|
|
|
void main1(
|
|
thread metal::float2& v_uv,
|
|
thread metal::float2 const& a_uv,
|
|
thread gl_PerVertex& _,
|
|
thread metal::float2 const& a_pos
|
|
) {
|
|
v_uv = a_uv;
|
|
metal::float2 _e13 = a_pos;
|
|
_.gl_Position = metal::float4(_e13.x, _e13.y, 0.0, 1.0);
|
|
return;
|
|
}
|
|
|
|
struct main2Input {
|
|
metal::float2 a_uv1 [[attribute(1)]];
|
|
metal::float2 a_pos1 [[attribute(0)]];
|
|
};
|
|
struct main2Output {
|
|
metal::float2 member [[user(loc0), center_perspective]];
|
|
metal::float4 gl_Position1 [[position]];
|
|
float gl_PointSize1 [[point_size]];
|
|
type6 gl_ClipDistance1 [[clip_distance]];
|
|
};
|
|
vertex main2Output main2(
|
|
main2Input varyings [[stage_in]]
|
|
) {
|
|
metal::float2 v_uv = {};
|
|
metal::float2 a_uv = {};
|
|
gl_PerVertex _ = {};
|
|
metal::float2 a_pos = {};
|
|
const auto a_uv1 = varyings.a_uv1;
|
|
const auto a_pos1 = varyings.a_pos1;
|
|
a_uv = a_uv1;
|
|
a_pos = a_pos1;
|
|
main1(v_uv, a_uv, _, a_pos);
|
|
const auto _tmp = type10 {v_uv, _.gl_Position, _.gl_PointSize, {_.gl_ClipDistance[0]}};
|
|
return main2Output { _tmp.member, _tmp.gl_Position1, _tmp.gl_PointSize1, {_tmp.gl_ClipDistance1[0]} };
|
|
}
|