@@ -30,7 +30,7 @@ use crate::{
3030
3131use wgt:: { BufferAddress , TextureFormat } ;
3232
33- use super :: { ImplicitPipelineIds , UserClosures } ;
33+ use super :: UserClosures ;
3434
3535impl Global {
3636 pub fn adapter_is_surface_supported (
@@ -1228,7 +1228,6 @@ impl Global {
12281228 device_id : DeviceId ,
12291229 desc : & pipeline:: RenderPipelineDescriptor ,
12301230 id_in : Option < id:: RenderPipelineId > ,
1231- implicit_pipeline_ids : Option < ImplicitPipelineIds < ' _ > > ,
12321231 ) -> (
12331232 id:: RenderPipelineId ,
12341233 Option < pipeline:: CreateRenderPipelineError > ,
@@ -1237,26 +1236,16 @@ impl Global {
12371236
12381237 let hub = & self . hub ;
12391238
1240- let missing_implicit_pipeline_ids =
1241- desc. layout . is_none ( ) && id_in. is_some ( ) && implicit_pipeline_ids. is_none ( ) ;
1242-
12431239 let fid = hub. render_pipelines . prepare ( id_in) ;
1244- let implicit_context = implicit_pipeline_ids. map ( |ipi| ipi. prepare ( hub) ) ;
12451240
12461241 let error = ' error: {
1247- if missing_implicit_pipeline_ids {
1248- // TODO: categorize this error as API misuse
1249- break ' error pipeline:: ImplicitLayoutError :: MissingImplicitPipelineIds . into ( ) ;
1250- }
1251-
12521242 let device = self . hub . devices . get ( device_id) ;
12531243
12541244 #[ cfg( feature = "trace" ) ]
12551245 if let Some ( ref mut trace) = * device. trace . lock ( ) {
12561246 trace. add ( trace:: Action :: CreateRenderPipeline {
12571247 id : fid. id ( ) ,
12581248 desc : desc. clone ( ) ,
1259- implicit_context : implicit_context. clone ( ) ,
12601249 } ) ;
12611250 }
12621251
@@ -1357,40 +1346,6 @@ impl Global {
13571346 Err ( e) => break ' error e,
13581347 } ;
13591348
1360- if let Some ( ids) = implicit_context. as_ref ( ) {
1361- let group_count = pipeline. layout . bind_group_layouts . len ( ) ;
1362- if ids. group_ids . len ( ) < group_count {
1363- log:: error!(
1364- "Not enough bind group IDs ({}) specified for the implicit layout ({})" ,
1365- ids. group_ids. len( ) ,
1366- group_count
1367- ) ;
1368- // TODO: categorize this error as API misuse
1369- break ' error pipeline:: ImplicitLayoutError :: MissingIds ( group_count as _ )
1370- . into ( ) ;
1371- }
1372-
1373- let mut pipeline_layout_guard = hub. pipeline_layouts . write ( ) ;
1374- let mut bgl_guard = hub. bind_group_layouts . write ( ) ;
1375- pipeline_layout_guard. insert ( ids. root_id , Fallible :: Valid ( pipeline. layout . clone ( ) ) ) ;
1376- let mut group_ids = ids. group_ids . iter ( ) ;
1377- // NOTE: If the first iterator is longer than the second, the `.zip()` impl will still advance the
1378- // the first iterator before realizing that the second iterator has finished.
1379- // The `pipeline.layout.bind_group_layouts` iterator will always be shorter than `ids.group_ids`,
1380- // so using it as the first iterator for `.zip()` will work properly.
1381- for ( bgl, bgl_id) in pipeline
1382- . layout
1383- . bind_group_layouts
1384- . iter ( )
1385- . zip ( & mut group_ids)
1386- {
1387- bgl_guard. insert ( * bgl_id, Fallible :: Valid ( bgl. clone ( ) ) ) ;
1388- }
1389- for bgl_id in group_ids {
1390- bgl_guard. insert ( * bgl_id, Fallible :: Invalid ( Arc :: new ( String :: new ( ) ) ) ) ;
1391- }
1392- }
1393-
13941349 let id = fid. assign ( Fallible :: Valid ( pipeline) ) ;
13951350 api_log ! ( "Device::create_render_pipeline -> {id:?}" ) ;
13961351
@@ -1399,17 +1354,6 @@ impl Global {
13991354
14001355 let id = fid. assign ( Fallible :: Invalid ( Arc :: new ( desc. label . to_string ( ) ) ) ) ;
14011356
1402- // We also need to assign errors to the implicit pipeline layout and the
1403- // implicit bind group layouts.
1404- if let Some ( ids) = implicit_context {
1405- let mut pipeline_layout_guard = hub. pipeline_layouts . write ( ) ;
1406- let mut bgl_guard = hub. bind_group_layouts . write ( ) ;
1407- pipeline_layout_guard. insert ( ids. root_id , Fallible :: Invalid ( Arc :: new ( String :: new ( ) ) ) ) ;
1408- for bgl_id in ids. group_ids {
1409- bgl_guard. insert ( bgl_id, Fallible :: Invalid ( Arc :: new ( String :: new ( ) ) ) ) ;
1410- }
1411- }
1412-
14131357 ( id, Some ( error) )
14141358 }
14151359
@@ -1467,7 +1411,6 @@ impl Global {
14671411 device_id : DeviceId ,
14681412 desc : & pipeline:: ComputePipelineDescriptor ,
14691413 id_in : Option < id:: ComputePipelineId > ,
1470- implicit_pipeline_ids : Option < ImplicitPipelineIds < ' _ > > ,
14711414 ) -> (
14721415 id:: ComputePipelineId ,
14731416 Option < pipeline:: CreateComputePipelineError > ,
@@ -1476,26 +1419,16 @@ impl Global {
14761419
14771420 let hub = & self . hub ;
14781421
1479- let missing_implicit_pipeline_ids =
1480- desc. layout . is_none ( ) && id_in. is_some ( ) && implicit_pipeline_ids. is_none ( ) ;
1481-
14821422 let fid = hub. compute_pipelines . prepare ( id_in) ;
1483- let implicit_context = implicit_pipeline_ids. map ( |ipi| ipi. prepare ( hub) ) ;
14841423
14851424 let error = ' error: {
1486- if missing_implicit_pipeline_ids {
1487- // TODO: categorize this error as API misuse
1488- break ' error pipeline:: ImplicitLayoutError :: MissingImplicitPipelineIds . into ( ) ;
1489- }
1490-
14911425 let device = self . hub . devices . get ( device_id) ;
14921426
14931427 #[ cfg( feature = "trace" ) ]
14941428 if let Some ( ref mut trace) = * device. trace . lock ( ) {
14951429 trace. add ( trace:: Action :: CreateComputePipeline {
14961430 id : fid. id ( ) ,
14971431 desc : desc. clone ( ) ,
1498- implicit_context : implicit_context. clone ( ) ,
14991432 } ) ;
15001433 }
15011434
@@ -1545,40 +1478,6 @@ impl Global {
15451478 Err ( e) => break ' error e,
15461479 } ;
15471480
1548- if let Some ( ids) = implicit_context. as_ref ( ) {
1549- let group_count = pipeline. layout . bind_group_layouts . len ( ) ;
1550- if ids. group_ids . len ( ) < group_count {
1551- log:: error!(
1552- "Not enough bind group IDs ({}) specified for the implicit layout ({})" ,
1553- ids. group_ids. len( ) ,
1554- group_count
1555- ) ;
1556- // TODO: categorize this error as API misuse
1557- break ' error pipeline:: ImplicitLayoutError :: MissingIds ( group_count as _ )
1558- . into ( ) ;
1559- }
1560-
1561- let mut pipeline_layout_guard = hub. pipeline_layouts . write ( ) ;
1562- let mut bgl_guard = hub. bind_group_layouts . write ( ) ;
1563- pipeline_layout_guard. insert ( ids. root_id , Fallible :: Valid ( pipeline. layout . clone ( ) ) ) ;
1564- let mut group_ids = ids. group_ids . iter ( ) ;
1565- // NOTE: If the first iterator is longer than the second, the `.zip()` impl will still advance the
1566- // the first iterator before realizing that the second iterator has finished.
1567- // The `pipeline.layout.bind_group_layouts` iterator will always be shorter than `ids.group_ids`,
1568- // so using it as the first iterator for `.zip()` will work properly.
1569- for ( bgl, bgl_id) in pipeline
1570- . layout
1571- . bind_group_layouts
1572- . iter ( )
1573- . zip ( & mut group_ids)
1574- {
1575- bgl_guard. insert ( * bgl_id, Fallible :: Valid ( bgl. clone ( ) ) ) ;
1576- }
1577- for bgl_id in group_ids {
1578- bgl_guard. insert ( * bgl_id, Fallible :: Invalid ( Arc :: new ( String :: new ( ) ) ) ) ;
1579- }
1580- }
1581-
15821481 let id = fid. assign ( Fallible :: Valid ( pipeline) ) ;
15831482 api_log ! ( "Device::create_compute_pipeline -> {id:?}" ) ;
15841483
@@ -1587,17 +1486,6 @@ impl Global {
15871486
15881487 let id = fid. assign ( Fallible :: Invalid ( Arc :: new ( desc. label . to_string ( ) ) ) ) ;
15891488
1590- // We also need to assign errors to the implicit pipeline layout and the
1591- // implicit bind group layouts.
1592- if let Some ( ids) = implicit_context {
1593- let mut pipeline_layout_guard = hub. pipeline_layouts . write ( ) ;
1594- let mut bgl_guard = hub. bind_group_layouts . write ( ) ;
1595- pipeline_layout_guard. insert ( ids. root_id , Fallible :: Invalid ( Arc :: new ( String :: new ( ) ) ) ) ;
1596- for bgl_id in ids. group_ids {
1597- bgl_guard. insert ( bgl_id, Fallible :: Invalid ( Arc :: new ( String :: new ( ) ) ) ) ;
1598- }
1599- }
1600-
16011489 ( id, Some ( error) )
16021490 }
16031491
0 commit comments