mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
[rs] Add more context to errors originating in Passes and Encoders
This commit is contained in:
parent
ccc178a3d0
commit
a74546f974
@ -1373,6 +1373,7 @@ impl crate::Context for Context {
|
|||||||
wgc::gfx_select!(
|
wgc::gfx_select!(
|
||||||
encoder.id => global.command_encoder_run_compute_pass(encoder.id, pass)
|
encoder.id => global.command_encoder_run_compute_pass(encoder.id, pass)
|
||||||
)
|
)
|
||||||
|
.map_err(|err| err.with_context("In a ComputePass".to_string()))
|
||||||
.unwrap_error_sink(&encoder.error_sink, || ())
|
.unwrap_error_sink(&encoder.error_sink, || ())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1416,6 +1417,7 @@ impl crate::Context for Context {
|
|||||||
) {
|
) {
|
||||||
let global = &self.0;
|
let global = &self.0;
|
||||||
wgc::gfx_select!(encoder.id => global.command_encoder_run_render_pass(encoder.id, pass))
|
wgc::gfx_select!(encoder.id => global.command_encoder_run_render_pass(encoder.id, pass))
|
||||||
|
.map_err(|err| err.with_context("In a RenderPass".to_string()))
|
||||||
.unwrap_error_sink(&encoder.error_sink, || ())
|
.unwrap_error_sink(&encoder.error_sink, || ())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1423,6 +1425,7 @@ impl crate::Context for Context {
|
|||||||
let desc = wgt::CommandBufferDescriptor::default();
|
let desc = wgt::CommandBufferDescriptor::default();
|
||||||
let global = &self.0;
|
let global = &self.0;
|
||||||
wgc::gfx_select!(encoder.id => global.command_encoder_finish(encoder.id, &desc))
|
wgc::gfx_select!(encoder.id => global.command_encoder_finish(encoder.id, &desc))
|
||||||
|
.map_err(|err| err.with_context("In a CommandEncoder".to_string()))
|
||||||
.unwrap_error_sink(
|
.unwrap_error_sink(
|
||||||
&encoder.error_sink,
|
&encoder.error_sink,
|
||||||
|| wgc::gfx_select!( encoder.id => global.command_buffer_error(PhantomData)),
|
|| wgc::gfx_select!( encoder.id => global.command_buffer_error(PhantomData)),
|
||||||
@ -1461,6 +1464,7 @@ impl crate::Context for Context {
|
|||||||
},
|
},
|
||||||
PhantomData
|
PhantomData
|
||||||
))
|
))
|
||||||
|
.map_err(|err| err.with_context("In a RenderBundleEncoder".to_string()))
|
||||||
.unwrap_pretty()
|
.unwrap_pretty()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user