Use a StagingBelt in iced_wgpu for regular buffer uploads

This commit is contained in:
Héctor Ramón Jiménez 2024-03-29 04:02:24 +01:00
parent 1df1cf82f4
commit 2bb53ad6e7
No known key found for this signature in database
GPG key ID: 4C07CEC81AFA161F
10 changed files with 113 additions and 41 deletions

View file

@ -40,11 +40,12 @@ impl Layer {
pub fn prepare(
&mut self,
device: &wgpu::Device,
queue: &wgpu::Queue,
encoder: &mut wgpu::CommandEncoder,
belt: &mut wgpu::util::StagingBelt,
instances: &[Solid],
) {
let _ = self.instances.resize(device, instances.len());
let _ = self.instances.write(queue, 0, instances);
let _ = self.instances.write(device, encoder, belt, 0, instances);
self.instance_count = instances.len();
}