summaryrefslogtreecommitdiffstats
path: root/wgpu/src/shader
diff options
context:
space:
mode:
Diffstat (limited to 'wgpu/src/shader')
-rw-r--r--wgpu/src/shader/geom2d.frag8
-rw-r--r--wgpu/src/shader/geom2d.frag.spvbin0 -> 372 bytes
-rw-r--r--wgpu/src/shader/geom2d.vert17
-rw-r--r--wgpu/src/shader/geom2d.vert.spvbin0 -> 1468 bytes
4 files changed, 25 insertions, 0 deletions
diff --git a/wgpu/src/shader/geom2d.frag b/wgpu/src/shader/geom2d.frag
new file mode 100644
index 00000000..e39c45e7
--- /dev/null
+++ b/wgpu/src/shader/geom2d.frag
@@ -0,0 +1,8 @@
+#version 450
+
+layout(location = 0) in vec4 i_Color;
+layout(location = 0) out vec4 o_Color;
+
+void main() {
+ o_Color = i_Color;
+}
diff --git a/wgpu/src/shader/geom2d.frag.spv b/wgpu/src/shader/geom2d.frag.spv
new file mode 100644
index 00000000..c0165bca
--- /dev/null
+++ b/wgpu/src/shader/geom2d.frag.spv
Binary files differ
diff --git a/wgpu/src/shader/geom2d.vert b/wgpu/src/shader/geom2d.vert
new file mode 100644
index 00000000..fd86ecd6
--- /dev/null
+++ b/wgpu/src/shader/geom2d.vert
@@ -0,0 +1,17 @@
+#version 450
+
+layout(location = 0) in vec2 i_Position;
+layout(location = 1) in vec4 i_Color;
+
+layout(location = 0) out vec4 o_Color;
+
+layout (set = 0, binding = 0) uniform Globals {
+ mat4 u_Transform;
+ float u_Scale;
+};
+
+void main() {
+ vec2 p_Position = i_Position * u_Scale;
+ gl_Position = u_Transform * vec4(p_Position, 0.0, 1.0);
+ o_Color = i_Color;
+}
diff --git a/wgpu/src/shader/geom2d.vert.spv b/wgpu/src/shader/geom2d.vert.spv
new file mode 100644
index 00000000..c15c7451
--- /dev/null
+++ b/wgpu/src/shader/geom2d.vert.spv
Binary files differ