typed primitive buffers + macro for creation

This commit is contained in:
2025-08-21 19:37:50 -04:00
parent b7f83b58a9
commit bde929b05a
5 changed files with 190 additions and 105 deletions

View File

@@ -13,16 +13,18 @@ pub struct WindowUniform {
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub struct PrimitiveInstance {
pub region: UiRegion,
pub ptr: u32,
pub binding: u32,
pub idx: u32,
}
impl PrimitiveInstance {
const ATTRIBS: [VertexAttribute; 5] = wgpu::vertex_attr_array![
const ATTRIBS: [VertexAttribute; 6] = wgpu::vertex_attr_array![
0 => Float32x2,
1 => Float32x2,
2 => Float32x2,
3 => Float32x2,
4 => Uint32,
5 => Uint32,
];
pub fn desc() -> wgpu::VertexBufferLayout<'static> {