Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
30
third-party/vendor/metal/examples/mesh-shader/shaders.metal
vendored
Normal file
30
third-party/vendor/metal/examples/mesh-shader/shaders.metal
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct VertexOut {
|
||||
float4 position [[position]];
|
||||
};
|
||||
|
||||
using mesh_t = mesh<VertexOut, void, 3, 1, topology::triangle>;
|
||||
|
||||
[[mesh]] void mesh_function(mesh_t m) {
|
||||
VertexOut v;
|
||||
v.position = float4(-1.0, -1.0, 0.0, 1.0);
|
||||
|
||||
m.set_primitive_count(1);
|
||||
|
||||
m.set_vertex(0, v);
|
||||
v.position = float4(0.0, 1.0, 0.0, 1.0);
|
||||
m.set_vertex(1, v);
|
||||
v.position = float4(1.0, -1.0, 0.0, 1.0);
|
||||
m.set_vertex(2, v);
|
||||
|
||||
m.set_index(0, 0);
|
||||
m.set_index(1, 1);
|
||||
m.set_index(2, 2);
|
||||
}
|
||||
|
||||
fragment half4 fragment_function() {
|
||||
return half4(0.1, 1.0, 0.1, 1.0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue