git.lucas.co / cce-display-manager
login greeter
git clone https://git.lucas.co/cce-display-manager.git

commit0abf04b702fb0311da788413af7a420d544d513b
parent706d679f89
authorLucas Galante <[email protected]>
date2026-06-05 20:13
refactor: update Vertex attributes to include clip_circle

 Makefile    | 14 ++++++++++++++
 src/main.rs | 16 +++++++++-------
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4748829
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,14 @@
+.PHONY: build install run clean
+
+build:
+	cargo build --release
+
+install: build
+	mkdir -p ~/.local/bin
+	install -m 755 target/release/clear-display-manager ~/.local/bin/clear-display-manager
+
+run:
+	cargo run
+
+clean:
+	cargo clean
diff --git a/src/main.rs b/src/main.rs
index db8014c..eb6be46 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -40,12 +40,14 @@ use clear_ui::widget::{
 struct Vertex {
     position: [f32; 2],
     color: [f32; 4],
+    clip_circle: [f32; 3],
 }
 
 impl Vertex {
-    const ATTRIBS: [wgpu::VertexAttribute; 2] = wgpu::vertex_attr_array![
+    const ATTRIBS: [wgpu::VertexAttribute; 3] = wgpu::vertex_attr_array![
         0 => Float32x2,
         1 => Float32x4,
+        2 => Float32x3,
     ];
 
     fn desc() -> wgpu::VertexBufferLayout<'static> {
@@ -68,12 +70,12 @@ fn quad_vertices(
     let y1 = 1.0 - ((y + h) / surface_h) * 2.0;
 
     [
-        Vertex { position: [x0, y0], color },
-        Vertex { position: [x1, y0], color },
-        Vertex { position: [x0, y1], color },
-        Vertex { position: [x1, y0], color },
-        Vertex { position: [x1, y1], color },
-        Vertex { position: [x0, y1], color },
+        Vertex { position: [x0, y0], color, clip_circle: [0.0; 3] },
+        Vertex { position: [x1, y0], color, clip_circle: [0.0; 3] },
+        Vertex { position: [x0, y1], color, clip_circle: [0.0; 3] },
+        Vertex { position: [x1, y0], color, clip_circle: [0.0; 3] },
+        Vertex { position: [x1, y1], color, clip_circle: [0.0; 3] },
+        Vertex { position: [x0, y1], color, clip_circle: [0.0; 3] },
     ]
 }