2020-08-21 13:37:05 +02:00
|
|
|
// Copyright 2020 Sascha Willems
|
|
|
|
|
|
|
|
|
|
struct VSInput
|
|
|
|
|
{
|
|
|
|
|
[[vk::location(0)]] float4 Pos : POSITION0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct RenderPassUBO
|
|
|
|
|
{
|
|
|
|
|
float4x4 projection;
|
|
|
|
|
float4x4 view;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
cbuffer renderPassUBO : register(b0) { RenderPassUBO renderPassUBO; }
|
|
|
|
|
|
2020-08-21 17:27:54 +02:00
|
|
|
struct PushConsts {
|
|
|
|
|
float4x4 model;
|
|
|
|
|
float4 color;
|
2020-08-21 13:37:05 +02:00
|
|
|
};
|
2020-08-21 17:27:54 +02:00
|
|
|
[[vk::push_constant]] PushConsts pushConsts;
|
2020-08-21 13:37:05 +02:00
|
|
|
|
|
|
|
|
struct VSOutput
|
|
|
|
|
{
|
|
|
|
|
float4 Pos : SV_POSITION;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
VSOutput main(VSInput input)
|
|
|
|
|
{
|
|
|
|
|
VSOutput output = (VSOutput)0;
|
2020-08-21 17:27:54 +02:00
|
|
|
output.Pos = mul(renderPassUBO.projection, mul(renderPassUBO.view, mul(pushConsts.model, input.Pos)));
|
2020-08-21 13:37:05 +02:00
|
|
|
return output;
|
|
|
|
|
}
|