mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
36 lines
970 B
Text
36 lines
970 B
Text
|
#include <metal_stdlib>
|
||
|
using namespace metal;
|
||
|
struct xlatMtlShaderInput {
|
||
|
float3 _inPos [[attribute(0)]];
|
||
|
float3 _inNor [[attribute(1)]];
|
||
|
};
|
||
|
struct xlatMtlShaderOutput {
|
||
|
float gl_PointSize [[point_size]];
|
||
|
float4 gl_Position [[position]];
|
||
|
};
|
||
|
struct xlatMtlShaderUniform {
|
||
|
};
|
||
|
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
|
||
|
, uint gl_InstanceID [[instance_id]]
|
||
|
, uint gl_VertexID [[vertex_id]])
|
||
|
{
|
||
|
xlatMtlShaderOutput _mtl_o;
|
||
|
float3 p_1;
|
||
|
p_1.z = _mtl_i._inPos.z;
|
||
|
p_1.x = (_mtl_i._inPos.x + float(gl_VertexID));
|
||
|
p_1.y = (_mtl_i._inPos.y + float(gl_InstanceID));
|
||
|
p_1 = (p_1 + _mtl_i._inNor);
|
||
|
float4 tmpvar_2;
|
||
|
tmpvar_2.w = 1.0;
|
||
|
tmpvar_2.xyz = p_1;
|
||
|
_mtl_o.gl_Position = tmpvar_2;
|
||
|
_mtl_o.gl_PointSize = p_1.x;
|
||
|
return _mtl_o;
|
||
|
}
|
||
|
|
||
|
|
||
|
// stats: 6 alu 0 tex 0 flow
|
||
|
// inputs: 2
|
||
|
// #0: _inPos (high float) 3x1 [-1] loc 0
|
||
|
// #1: _inNor (high float) 3x1 [-1] loc 1
|