aboutsummaryrefslogtreecommitdiff
path: root/Assets/Shaders/VkPipelineTest.slang
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-19 20:33:30 +0200
committerhachem <im@hachem.wtf>2026-08-19 20:33:30 +0200
commite3abaaf59777258ba06705135a0cafcb5918ad12 (patch)
tree889ab40dfc1967b38bcb5735e018d6b2c41d7390 /Assets/Shaders/VkPipelineTest.slang
parentf455eb427804866a5ce61ea3ea01715cb5ac9116 (diff)
[feat]: vulkan is going to be the end of me bro
Diffstat (limited to 'Assets/Shaders/VkPipelineTest.slang')
-rw-r--r--Assets/Shaders/VkPipelineTest.slang25
1 files changed, 25 insertions, 0 deletions
diff --git a/Assets/Shaders/VkPipelineTest.slang b/Assets/Shaders/VkPipelineTest.slang
new file mode 100644
index 0000000..f4d1897
--- /dev/null
+++ b/Assets/Shaders/VkPipelineTest.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);
+}