diff options
| author | Vasco <[email protected]> | 2026-08-23 02:25:33 +0100 |
|---|---|---|
| committer | Vasco <[email protected]> | 2026-08-23 02:25:33 +0100 |
| commit | dc96fcd771bea09d726a760266739906e95c09a6 (patch) | |
| tree | 5af4d4d7660a90a04016fae4defec3c2a422477d /Rend/demos/teapot/shaders/basic.slang | |
Peak 0.1.1
Diffstat (limited to 'Rend/demos/teapot/shaders/basic.slang')
| -rw-r--r-- | Rend/demos/teapot/shaders/basic.slang | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Rend/demos/teapot/shaders/basic.slang b/Rend/demos/teapot/shaders/basic.slang new file mode 100644 index 0000000..cfbf48a --- /dev/null +++ b/Rend/demos/teapot/shaders/basic.slang @@ -0,0 +1,36 @@ +struct VSInput { + [[vk::location(0)]] float3 inPosition : POSITION; + [[vk::location(1)]] float2 uv : TEXCOORD0; +}; + +struct VSOutput { + float4 pos : SV_Position; + float3 color; + float2 uv; +}; + +struct PushConstants { + float4x4 ubo; +}; + +[[vk::binding(0, 0)]] ConstantBuffer<float4x4> ubos[3]; +[[vk::binding(1, 0)]] Sampler2D test[3]; + +[[vk::push_constant]] +PushConstants pc; + +[shader("vertex")] +VSOutput vertMain(VSInput input) { + VSOutput output; + + output.pos = mul(pc.ubo, float4(input.inPosition, 1.0)); + output.color = input.inPosition; + output.uv = input.uv; + return output; +} + +[shader("fragment")] +float4 fragMain(VSOutput vertIn) : SV_TARGET { + float4 col = test[0].Sample(vertIn.uv); + return float4(col.rgb, 1.0); +} |
