summaryrefslogtreecommitdiff
path: root/Fuse/demos/fuse.slang
diff options
context:
space:
mode:
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;
+}