Split big Buffer writes into multiple chunks

This commit is contained in:
Héctor Ramón Jiménez 2024-03-29 14:29:31 +01:00
parent 0a97b9e37a
commit 5f1eb43161
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 38 additions and 9 deletions

View file

@ -1,3 +1,4 @@
use crate::buffer;
use crate::core::{Color, Size, Transformation};
use crate::graphics::backend;
use crate::graphics::color;
@ -66,7 +67,9 @@ impl Backend {
// TODO: Resize belt smartly (?)
// It would be great if the `StagingBelt` API exposed methods
// for introspection to detect when a resize may be worth it.
staging_belt: wgpu::util::StagingBelt::new(1024 * 100),
staging_belt: wgpu::util::StagingBelt::new(
buffer::MAX_WRITE_SIZE as u64,
),
}
}