30 lines
650 B
Plaintext
30 lines
650 B
Plaintext
#include "camera.slang"
|
|
|
|
[[vk_binding(0, 0)]] ConstantBuffer<camera_data> camera;
|
|
|
|
struct input_vertex
|
|
{
|
|
[[vk::location(0)]] float3 pos : POSITION;
|
|
[[vk::location(1)]] float3 col : COLOR;
|
|
};
|
|
|
|
struct post_transform_vertex {
|
|
float4 position : SV_Position;
|
|
float3 color : COLOR;
|
|
};
|
|
|
|
[shader("vertex")]
|
|
post_transform_vertex vert_main(input_vertex vertex) {
|
|
post_transform_vertex output;
|
|
|
|
output.position = mul(camera.projection, mul(camera.view, float4(vertex.pos, 1.0f)));
|
|
output.color = vertex.col;
|
|
|
|
return output;
|
|
}
|
|
|
|
[shader("fragment")]
|
|
float4 frag_main(post_transform_vertex input) : SV_Target {
|
|
return float4(input.color, 1.0f);
|
|
}
|