36 lines
743 B
HLSL
36 lines
743 B
HLSL
struct VS_Input
|
|
{
|
|
uint VertexIndex : SV_VertexID;
|
|
};
|
|
|
|
struct VS_Output
|
|
{
|
|
float2 UV0 : TEXCOORD0;
|
|
float4 VertexPosition : SV_Position;
|
|
};
|
|
|
|
struct CameraData {
|
|
float4x4 Model;
|
|
float4x4 View;
|
|
float4x4 Projection;
|
|
};
|
|
|
|
struct VertexData {
|
|
float4 Position;
|
|
float2 UV0;
|
|
};
|
|
|
|
[[vk::binding(0, 0)]] ConstantBuffer<CameraData> Camera;
|
|
[[vk::binding(2, 0)]] StructuredBuffer<VertexData> Vertices;
|
|
|
|
VS_Output main(VS_Input StageInput) {
|
|
VS_Output output;
|
|
|
|
output.UV0 = Vertices[StageInput.VertexIndex].UV0;
|
|
|
|
float4 position = Vertices[StageInput.VertexIndex].Position;
|
|
|
|
output.VertexPosition = mul(Camera.Projection, mul(Camera.View, mul(Camera.Model, position)));
|
|
|
|
return output;
|
|
} |