spans now good (other than direction) + refactor

This commit is contained in:
2025-08-11 02:24:27 -04:00
parent 132113f09e
commit 95a07786bb
22 changed files with 545 additions and 371 deletions

27
src/render/primitive.rs Normal file
View File

@@ -0,0 +1,27 @@
use crate::Color;
pub use super::data::PrimitiveInstance;
#[derive(Default)]
pub struct Primitives {
pub instances: Vec<PrimitiveInstance>,
pub data: Vec<u32>,
}
/// NOTE: Self must have at least u32 alignment
pub trait PrimitiveData: bytemuck::Pod {
const DISCRIM: u32;
}
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub struct RoundedRectData {
pub color: Color<u8>,
pub radius: f32,
pub thickness: f32,
pub inner_radius: f32,
}
impl PrimitiveData for RoundedRectData {
const DISCRIM: u32 = 0;
}