-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
struct Vertex { | ||
@location(0) position: vec2f | ||
} | ||
|
||
struct NoteInstance { | ||
@location(1) position: vec2f | ||
} | ||
|
||
struct VertexOutput { | ||
@builtin(position) position: vec4f | ||
} | ||
|
||
@vertex | ||
fn vs_main(vertex: Vertex, note: NoteInstance) -> VertexOutput { | ||
var out: VertexOutput; | ||
return out; | ||
} | ||
|
||
@fragment | ||
fn fs_main(in: VertexOutput, note: NoteInstance) -> @location(0) vec4f { | ||
return in.position; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// language: metal2.0 | ||
#include <metal_stdlib> | ||
#include <simd/simd.h> | ||
|
||
using metal::uint; | ||
|
||
struct Vertex { | ||
metal::float2 position; | ||
}; | ||
struct NoteInstance { | ||
metal::float2 position; | ||
}; | ||
struct VertexOutput { | ||
metal::float4 position; | ||
}; | ||
|
||
struct vs_mainInput { | ||
metal::float2 position [[attribute(0)]]; | ||
metal::float2 position_1 [[attribute(1)]]; | ||
}; | ||
struct vs_mainOutput { | ||
metal::float4 position [[position]]; | ||
}; | ||
vertex vs_mainOutput vs_main( | ||
vs_mainInput varyings [[stage_in]] | ||
) { | ||
const Vertex vertex_ = { varyings.position }; | ||
const NoteInstance note = { varyings.position_1 }; | ||
VertexOutput out = {}; | ||
VertexOutput _e3 = out; | ||
const auto _tmp = _e3; | ||
return vs_mainOutput { _tmp.position }; | ||
} | ||
|
||
|
||
struct fs_mainInput { | ||
metal::float2 position_3 [[user(loc1), center_perspective]]; | ||
}; | ||
struct fs_mainOutput { | ||
metal::float4 member_1 [[color(0)]]; | ||
}; | ||
fragment fs_mainOutput fs_main( | ||
fs_mainInput varyings_1 [[stage_in]] | ||
, metal::float4 position_2 [[position]] | ||
) { | ||
const VertexOutput in = { position_2 }; | ||
const NoteInstance note_1 = { varyings_1.position_3 }; | ||
return fs_mainOutput { in.position }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters