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

@ -125,9 +125,6 @@ pub fn main() {
let mut resized = false;
// Initialize staging belt
let mut staging_belt = wgpu::util::StagingBelt::new(5 * 1024);
// Initialize scene and GUI controls
let scene = Scene::new(&device, format);
let controls = Controls::new();
@ -252,7 +249,6 @@ pub fn main() {
backend.present(
&device,
&queue,
&mut staging_belt,
&mut encoder,
&view,
primitive,
@ -262,7 +258,6 @@ pub fn main() {
});
// Then we submit the work
staging_belt.finish();
queue.submit(Some(encoder.finish()));
frame.present();
@ -272,10 +267,6 @@ pub fn main() {
state.mouse_interaction(),
),
);
// And recall staging buffers
staging_belt.recall();
}
Err(error) => match error {
wgpu::SurfaceError::OutOfMemory => {