diff options
| author | hachem <im@hachem.wtf> | 2026-08-23 17:21:37 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-23 17:21:37 +0200 |
| commit | 3fd33ecff7472e4d6fc9e6b3905f56982e497ef2 (patch) | |
| tree | 66e5812f1a18b926e88a0dd549fe14e7c7327165 /assets/shaders/vk_pipeline_test.slang | |
| parent | e3aa33fc9a99d8b817bda42a567a4c347e18ab32 (diff) | |
[feat]: complete RHI api
Diffstat (limited to 'assets/shaders/vk_pipeline_test.slang')
| -rw-r--r-- | assets/shaders/vk_pipeline_test.slang | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/assets/shaders/vk_pipeline_test.slang b/assets/shaders/vk_pipeline_test.slang new file mode 100644 index 0000000..f4d1897 --- /dev/null +++ b/assets/shaders/vk_pipeline_test.slang @@ -0,0 +1,25 @@ +// Minimal shader used only to verify the Vulkan graphics-pipeline path (SPIR-V +// module -> pipeline -> draw -> read-back). Draws a full-screen gradient +// triangle from the vertex id, so it needs no vertex buffer, UBO, or sampler. + +struct VSOutput +{ + float4 position : SV_Position; + float3 color : COLOR0; +}; + +[shader("vertex")] +VSOutput vertexMain(uint vid : SV_VertexID) +{ + float2 p = float2(float((vid << 1) & 2), float(vid & 2)); + VSOutput output; + output.position = float4(p * 2.0 - 1.0, 0.0, 1.0); + output.color = float3(p, 0.5); + return output; +} + +[shader("fragment")] +float4 fragmentMain(VSOutput input) : SV_Target +{ + return float4(input.color, 1.0); +} |
