Refactor triangle::Pipeline into prepare and render architecture

And get rid of the staging belt! 🎉
This commit is contained in:
Héctor Ramón Jiménez 2023-02-07 23:55:16 +01:00
parent 23ed352e83
commit b8c1809ea1
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
7 changed files with 358 additions and 291 deletions

View file

@ -1,5 +1,4 @@
use crate::buffer::Buffer;
use crate::Transformation;
use crate::{Buffer, Transformation};
use iced_graphics::layer;
use iced_native::Rectangle;
@ -228,7 +227,7 @@ impl Layer {
let instances = Buffer::new(
device,
"iced_wgpu::quad instance buffer",
MAX_INSTANCES,
INITIAL_INSTANCES,
wgpu::BufferUsages::VERTEX | wgpu::BufferUsages::COPY_DST,
);
@ -302,7 +301,7 @@ const QUAD_VERTS: [Vertex; 4] = [
},
];
const MAX_INSTANCES: usize = 100_000;
const INITIAL_INSTANCES: usize = 10_000;
#[repr(C)]
#[derive(Debug, Clone, Copy, Zeroable, Pod)]