This commit is contained in:
2026-01-23 19:09:00 +03:00
parent cc82acc18c
commit 65607ee284
72 changed files with 6422 additions and 15 deletions

View File

@@ -0,0 +1,38 @@
#include "OgreUnifiedShader.h"
struct RasterizerData
{
vec4 pos [[position]];
vec2 uv;
};
struct Vertex
{
IN(vec3 pos, POSITION);
IN(vec2 uv, TEXCOORD0);
};
struct Uniform
{
mat4 mvpMtx;
mat4 texMtx;
};
// first 15 slots are reserved for the vertex attributes
#define UNIFORM_INDEX_START 16
vertex RasterizerData default_vp(Vertex in [[stage_in]],
constant Uniform& u [[buffer(UNIFORM_INDEX_START)]])
{
RasterizerData out;
out.pos = u.mvpMtx * vec4(in.pos, 1);
out.uv = (u.texMtx * vec4(in.uv,1,1)).xy;
return out;
}
fragment half4 default_fp(RasterizerData in [[stage_in]],
metal::texture2d<half> tex [[texture(0)]],
metal::sampler s [[sampler(0)]])
{
return tex.sample(s, in.uv);
}