Skip to content

Commit

Permalink
Fix hot_reload when debug layers are enabled
Browse files Browse the repository at this point in the history
Both blit and debug pipelines need to be recompiled when the engine gets
recreated.
  • Loading branch information
armansito committed Jun 5, 2024
1 parent 82162f4 commit b22b633
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions vello/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,12 +462,26 @@ impl Renderer {
let mut engine = WgpuEngine::new(self.options.use_cpu);
// We choose not to initialise these shaders in parallel, to ensure the error scope works correctly
let shaders = shaders::full_shaders(device, &mut engine, &self.options)?;
let blit = self
.options
.surface_format
.map(|surface_format| BlitPipeline::new(device, surface_format, &mut engine));
#[cfg(feature = "debug_layers")]
let debug = self
.options
.surface_format
.map(|format| debug::DebugLayers::new(device, format, &mut engine));
let error = device.pop_error_scope().await;
if let Some(error) = error {
return Err(error.into());
}
self.engine = engine;
self.shaders = shaders;
self.blit = blit;
#[cfg(feature = "debug_layers")]
{
self.debug = debug;
}
Ok(())
}

Expand Down

0 comments on commit b22b633

Please sign in to comment.