summaryrefslogtreecommitdiff
path: root/Fuse/demos/fuse.slang
diff options
context:
space:
mode:
authorVasco <[email protected]>2026-08-23 02:25:33 +0100
committerVasco <[email protected]>2026-08-23 02:25:33 +0100
commitdc96fcd771bea09d726a760266739906e95c09a6 (patch)
tree5af4d4d7660a90a04016fae4defec3c2a422477d /Fuse/demos/fuse.slang
Peak 0.1.1
Diffstat (limited to 'Fuse/demos/fuse.slang')
-rw-r--r--Fuse/demos/fuse.slang31
1 files changed, 31 insertions, 0 deletions
diff --git a/Fuse/demos/fuse.slang b/Fuse/demos/fuse.slang
new file mode 100644
index 0000000..837a3dc
--- /dev/null
+++ b/Fuse/demos/fuse.slang
@@ -0,0 +1,31 @@
+struct VertexInput {
+ [[vk::location(0)]] float2 pos : POSITION;
+ [[vk::location(1)]] float4 col : COLOR;
+};
+
+struct VertexOutput {
+ float4 col : COLOR;
+ float4 pos : SV_Position;
+};
+
+struct UBO {
+ float2 viewport;
+};
+
+[[vk::binding(0, 0)]]
+ConstantBuffer<UBO> ubo;
+
+[shader("vertex")]
+VertexOutput vertMain(VertexInput input)
+{
+ VertexOutput output;
+ output.col = input.col;
+ output.pos = float4(input.pos*2.0/ubo.viewport - 1.0, 0.0, 1.0);
+ return output;
+}
+
+[shader("fragment")]
+float4 fragMain(VertexOutput input) : SV_Target
+{
+ return input.col;
+}