struct VertexInput { float3 pos; float3 col; float2 uv; }; struct UniformBuffer { float4x4 model, view, proj; }; ConstantBuffer ubo; struct VertexOutput { float4 pos : SV_Position; float3 col; float2 uv; }; [shader("vertex")] VertexOutput vert_main(VertexInput vi) { VertexOutput vo; // vo.pos = float4(vi.pos, 0., 1.); vo.pos = mul(ubo.proj, mul(ubo.view, mul(ubo.model, float4(vi.pos, 1.)))); vo.col = vi.col; vo.uv = vi.uv; return vo; } Sampler2D texture; [shader("fragment")] float4 frag_main(VertexOutput vo) : SV_Target { return texture.Sample(vo.uv); }