shaders: Implement HLSL for lessons 2-8

This commit is contained in:
2025-06-16 00:12:59 +10:00
parent cdf06bfa26
commit c0c55c06bb
16 changed files with 202 additions and 1 deletions

31
src/shaders/lesson2.hlsl Normal file
View File

@@ -0,0 +1,31 @@
/*
* SPDX-FileCopyrightText: (C) 2025 a dinosaur
* SPDX-License-Identifier: Zlib
*/
struct VertexInput
{
float3 position : TEXCOORD0;
};
cbuffer VertexUniform : register(b0, space1)
{
float4x4 viewproj : packoffset(c0);
};
struct Vertex2Pixel
{
float4 position : SV_Position;
};
Vertex2Pixel VertexMain(VertexInput input)
{
Vertex2Pixel output;
output.position = mul(viewproj, float4(input.position, 1.0));
return output;
}
half4 PixelMain(Vertex2Pixel input) : SV_Target0
{
return half4(1.0, 1.0, 1.0, 1.0);
}