diff --git a/core/src/render/mod.rs b/core/src/render/mod.rs index a5e985c..b2f425b 100644 --- a/core/src/render/mod.rs +++ b/core/src/render/mod.rs @@ -295,7 +295,7 @@ impl UiRenderNode { ty: BindingType::Buffer { ty: BufferBindingType::Uniform, has_dynamic_offset: false, - min_binding_size: None, + min_binding_size: BufferSize::new(size_of::() as u64), }, count: None, }, @@ -305,7 +305,7 @@ impl UiRenderNode { ty: BindingType::Buffer { ty: BufferBindingType::Storage { read_only: true }, has_dynamic_offset: false, - min_binding_size: None, + min_binding_size: BufferSize::new(size_of::() as u64), }, count: None, }, @@ -362,8 +362,9 @@ impl UiRenderNode { }) } - /// Layout for a list of one primitive's data. Stating the size rather than - /// leaving it `None` is what moves the check off every draw. + /// Layout for a list of one primitive's data. Every size in the ui is + /// stated, so "is the buffer big enough for one entry?" is answered when + /// the bind group is made; a `None` size is wgpu's to check on every draw. fn data_layout(device: &Device, stride: u64) -> BindGroupLayout { device.create_bind_group_layout(&BindGroupLayoutDescriptor { entries: &[BindGroupLayoutEntry { @@ -372,7 +373,7 @@ impl UiRenderNode { ty: BindingType::Buffer { ty: BufferBindingType::Storage { read_only: true }, has_dynamic_offset: false, - min_binding_size: std::num::NonZero::new(stride), + min_binding_size: BufferSize::new(stride), }, count: None, }],