@@ -147,6 +147,7 @@ pub struct WGPUComputePassEncoderImpl {
147
147
pub struct WGPUComputePipelineImpl {
148
148
context : Arc < Context > ,
149
149
id : id:: ComputePipelineId ,
150
+ error_sink : ErrorSink ,
150
151
}
151
152
impl Drop for WGPUComputePipelineImpl {
152
153
fn drop ( & mut self ) {
@@ -245,6 +246,7 @@ pub struct WGPURenderPassEncoderImpl {
245
246
pub struct WGPURenderPipelineImpl {
246
247
context : Arc < Context > ,
247
248
id : id:: RenderPipelineId ,
249
+ error_sink : ErrorSink ,
248
250
}
249
251
impl Drop for WGPURenderPipelineImpl {
250
252
fn drop ( & mut self ) {
@@ -1680,17 +1682,21 @@ pub unsafe extern "C" fn wgpuComputePipelineGetBindGroupLayout(
1680
1682
pipeline : native:: WGPUComputePipeline ,
1681
1683
group_index : u32 ,
1682
1684
) -> native:: WGPUBindGroupLayout {
1683
- let ( pipeline_id, context) = {
1685
+ let ( pipeline_id, context, error_sink ) = {
1684
1686
let pipeline = pipeline. as_ref ( ) . expect ( "invalid pipeline" ) ;
1685
- ( pipeline. id , & pipeline. context )
1687
+ ( pipeline. id , & pipeline. context , & pipeline . error_sink )
1686
1688
} ;
1687
1689
1688
1690
let ( bind_group_layout_id, error) = gfx_select ! ( pipeline_id => context. compute_pipeline_get_bind_group_layout( pipeline_id, group_index, ( ) ) ) ;
1689
1691
if let Some ( cause) = error {
1690
- panic ! (
1691
- "Error in wgpuComputePipelineGetBindGroupLayout: Error reflecting bind group {group_index}: {f}" ,
1692
- f = format_error( context, & cause)
1693
- ) ;
1692
+ handle_error (
1693
+ context,
1694
+ error_sink,
1695
+ cause,
1696
+ "" ,
1697
+ None ,
1698
+ "wgpuComputePipelineGetBindGroupLayout" ,
1699
+ )
1694
1700
}
1695
1701
1696
1702
Arc :: into_raw ( Arc :: new ( WGPUBindGroupLayoutImpl {
@@ -1945,6 +1951,7 @@ pub unsafe extern "C" fn wgpuDeviceCreateComputePipeline(
1945
1951
Arc :: into_raw ( Arc :: new ( WGPUComputePipelineImpl {
1946
1952
context : context. clone ( ) ,
1947
1953
id : compute_pipeline_id,
1954
+ error_sink : error_sink. clone ( ) ,
1948
1955
} ) )
1949
1956
}
1950
1957
@@ -2227,6 +2234,7 @@ pub unsafe extern "C" fn wgpuDeviceCreateRenderPipeline(
2227
2234
Arc :: into_raw ( Arc :: new ( WGPURenderPipelineImpl {
2228
2235
context : context. clone ( ) ,
2229
2236
id : render_pipeline_id,
2237
+ error_sink : error_sink. clone ( ) ,
2230
2238
} ) )
2231
2239
}
2232
2240
@@ -3500,17 +3508,24 @@ pub unsafe extern "C" fn wgpuRenderPipelineGetBindGroupLayout(
3500
3508
render_pipeline : native:: WGPURenderPipeline ,
3501
3509
group_index : u32 ,
3502
3510
) -> native:: WGPUBindGroupLayout {
3503
- let ( render_pipeline_id, context) = {
3511
+ let ( render_pipeline_id, context, error_sink ) = {
3504
3512
let render_pipeline = render_pipeline. as_ref ( ) . expect ( "invalid render pipeline" ) ;
3505
- ( render_pipeline. id , & render_pipeline. context )
3513
+ (
3514
+ render_pipeline. id ,
3515
+ & render_pipeline. context ,
3516
+ & render_pipeline. error_sink ,
3517
+ )
3506
3518
} ;
3507
-
3508
3519
let ( bind_group_layout_id, error) = gfx_select ! ( render_pipeline_id => context. render_pipeline_get_bind_group_layout( render_pipeline_id, group_index, ( ) ) ) ;
3509
3520
if let Some ( cause) = error {
3510
- panic ! (
3511
- "Error in wgpuRenderPipelineGetBindGroupLayout: Error reflecting bind group {group_index}: {f}" ,
3512
- f = format_error( context, & cause)
3513
- ) ;
3521
+ handle_error (
3522
+ context,
3523
+ error_sink,
3524
+ cause,
3525
+ "" ,
3526
+ None ,
3527
+ "wgpuRenderPipelineGetBindGroupLayout" ,
3528
+ )
3514
3529
}
3515
3530
3516
3531
Arc :: into_raw ( Arc :: new ( WGPUBindGroupLayoutImpl {
0 commit comments