File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -761,7 +761,7 @@ impl Global {
761
761
Err ( e) => break ' error e,
762
762
} ;
763
763
764
- let id = fid. assign ( Arc :: new ( layout) ) ;
764
+ let id = fid. assign ( layout) ;
765
765
api_log ! ( "Device::create_pipeline_layout -> {id:?}" ) ;
766
766
return ( id, None ) ;
767
767
} ;
Original file line number Diff line number Diff line change @@ -2484,7 +2484,8 @@ impl<A: HalApi> Device<A> {
2484
2484
pub ( crate ) fn create_pipeline_layout (
2485
2485
self : & Arc < Self > ,
2486
2486
desc : & binding_model:: ResolvedPipelineLayoutDescriptor < A > ,
2487
- ) -> Result < binding_model:: PipelineLayout < A > , binding_model:: CreatePipelineLayoutError > {
2487
+ ) -> Result < Arc < binding_model:: PipelineLayout < A > > , binding_model:: CreatePipelineLayoutError >
2488
+ {
2488
2489
use crate :: binding_model:: CreatePipelineLayoutError as Error ;
2489
2490
2490
2491
self . check_is_valid ( ) ?;
@@ -2576,13 +2577,17 @@ impl<A: HalApi> Device<A> {
2576
2577
2577
2578
drop ( raw_bind_group_layouts) ;
2578
2579
2579
- Ok ( binding_model:: PipelineLayout {
2580
+ let layout = binding_model:: PipelineLayout {
2580
2581
raw : Some ( raw) ,
2581
2582
device : self . clone ( ) ,
2582
2583
label : desc. label . to_string ( ) ,
2583
2584
bind_group_layouts,
2584
2585
push_constant_ranges : desc. push_constant_ranges . iter ( ) . cloned ( ) . collect ( ) ,
2585
- } )
2586
+ } ;
2587
+
2588
+ let layout = Arc :: new ( layout) ;
2589
+
2590
+ Ok ( layout)
2586
2591
}
2587
2592
2588
2593
pub ( crate ) fn derive_pipeline_layout (
@@ -2628,7 +2633,6 @@ impl<A: HalApi> Device<A> {
2628
2633
} ;
2629
2634
2630
2635
let layout = self . create_pipeline_layout ( & layout_desc) ?;
2631
- let layout = Arc :: new ( layout) ;
2632
2636
Ok ( layout)
2633
2637
}
2634
2638
You can’t perform that action at this time.
0 commit comments