Skip to content

Commit

Permalink
Fix re_renderer's wgpu error scopes not handling internal errors (#…
Browse files Browse the repository at this point in the history
…8473)

Wasn't exposed in earlier wgpu versions.
Usually not a problem, but when it is it's usually too late ;)
  • Loading branch information
Wumpf authored Dec 16, 2024
1 parent dd77aba commit a8ae6f5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions crates/viewer/re_renderer/src/error_handling/wgpu_error_scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl WgpuErrorScope {
pub fn start(device: &Arc<wgpu::Device>) -> Self {
device.push_error_scope(wgpu::ErrorFilter::Validation);
device.push_error_scope(wgpu::ErrorFilter::OutOfMemory);
// TODO(gfx-rs/wgpu#4866): Internal is missing!
device.push_error_scope(wgpu::ErrorFilter::Internal);
Self {
device: device.clone(),
open: true,
Expand All @@ -23,9 +23,13 @@ impl WgpuErrorScope {

pub fn end(
mut self,
) -> [impl std::future::Future<Output = Option<wgpu::Error>> + Send + 'static; 2] {
) -> [impl std::future::Future<Output = Option<wgpu::Error>> + Send + 'static; 3] {
self.open = false;
[self.device.pop_error_scope(), self.device.pop_error_scope()]
[
self.device.pop_error_scope(),
self.device.pop_error_scope(),
self.device.pop_error_scope(),
]
}
}

Expand All @@ -34,6 +38,7 @@ impl Drop for WgpuErrorScope {
if self.open {
drop(self.device.pop_error_scope());
drop(self.device.pop_error_scope());
drop(self.device.pop_error_scope());
}
}
}

0 comments on commit a8ae6f5

Please sign in to comment.