Added slang shaders for pipeline samples

This commit is contained in:
Sascha Willems 2025-05-18 11:38:10 +02:00
parent b81e9d9654
commit d8c8630654
4 changed files with 299 additions and 0 deletions

View file

@ -0,0 +1,40 @@
/* Copyright (c) 2025, Sascha Willems
*
* SPDX-License-Identifier: MIT
*
*/
struct VSInput
{
float4 Pos;
float2 UV;
float3 Color;
};
struct VSOutput
{
float4 Pos : SV_POSITION;
float3 Color;
};
struct UBO
{
float4x4 projection;
float4x4 model;
};
ConstantBuffer<UBO> ubo;
[shader("vertex")]
VSOutput vertexMain(VSInput input)
{
VSOutput output;
output.Color = input.Color;
output.Pos = mul(ubo.projection, mul(ubo.model, input.Pos));
return output;
}
[shader("fragment")]
float4 fragmentMain(VSOutput input)
{
return float4(input.Color * 1.5, 1);
}