@@ -30,7 +30,7 @@ use crate::{
30
30
31
31
use wgt:: { BufferAddress , TextureFormat } ;
32
32
33
- use super :: { ImplicitPipelineIds , UserClosures } ;
33
+ use super :: UserClosures ;
34
34
35
35
impl Global {
36
36
pub fn adapter_is_surface_supported (
@@ -1228,7 +1228,6 @@ impl Global {
1228
1228
device_id : DeviceId ,
1229
1229
desc : & pipeline:: RenderPipelineDescriptor ,
1230
1230
id_in : Option < id:: RenderPipelineId > ,
1231
- implicit_pipeline_ids : Option < ImplicitPipelineIds < ' _ > > ,
1232
1231
) -> (
1233
1232
id:: RenderPipelineId ,
1234
1233
Option < pipeline:: CreateRenderPipelineError > ,
@@ -1237,26 +1236,16 @@ impl Global {
1237
1236
1238
1237
let hub = & self . hub ;
1239
1238
1240
- let missing_implicit_pipeline_ids =
1241
- desc. layout . is_none ( ) && id_in. is_some ( ) && implicit_pipeline_ids. is_none ( ) ;
1242
-
1243
1239
let fid = hub. render_pipelines . prepare ( id_in) ;
1244
- let implicit_context = implicit_pipeline_ids. map ( |ipi| ipi. prepare ( hub) ) ;
1245
1240
1246
1241
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
-
1252
1242
let device = self . hub . devices . get ( device_id) ;
1253
1243
1254
1244
#[ cfg( feature = "trace" ) ]
1255
1245
if let Some ( ref mut trace) = * device. trace . lock ( ) {
1256
1246
trace. add ( trace:: Action :: CreateRenderPipeline {
1257
1247
id : fid. id ( ) ,
1258
1248
desc : desc. clone ( ) ,
1259
- implicit_context : implicit_context. clone ( ) ,
1260
1249
} ) ;
1261
1250
}
1262
1251
@@ -1357,40 +1346,6 @@ impl Global {
1357
1346
Err ( e) => break ' error e,
1358
1347
} ;
1359
1348
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
-
1394
1349
let id = fid. assign ( Fallible :: Valid ( pipeline) ) ;
1395
1350
api_log ! ( "Device::create_render_pipeline -> {id:?}" ) ;
1396
1351
@@ -1399,17 +1354,6 @@ impl Global {
1399
1354
1400
1355
let id = fid. assign ( Fallible :: Invalid ( Arc :: new ( desc. label . to_string ( ) ) ) ) ;
1401
1356
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
-
1413
1357
( id, Some ( error) )
1414
1358
}
1415
1359
@@ -1467,7 +1411,6 @@ impl Global {
1467
1411
device_id : DeviceId ,
1468
1412
desc : & pipeline:: ComputePipelineDescriptor ,
1469
1413
id_in : Option < id:: ComputePipelineId > ,
1470
- implicit_pipeline_ids : Option < ImplicitPipelineIds < ' _ > > ,
1471
1414
) -> (
1472
1415
id:: ComputePipelineId ,
1473
1416
Option < pipeline:: CreateComputePipelineError > ,
@@ -1476,26 +1419,16 @@ impl Global {
1476
1419
1477
1420
let hub = & self . hub ;
1478
1421
1479
- let missing_implicit_pipeline_ids =
1480
- desc. layout . is_none ( ) && id_in. is_some ( ) && implicit_pipeline_ids. is_none ( ) ;
1481
-
1482
1422
let fid = hub. compute_pipelines . prepare ( id_in) ;
1483
- let implicit_context = implicit_pipeline_ids. map ( |ipi| ipi. prepare ( hub) ) ;
1484
1423
1485
1424
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
-
1491
1425
let device = self . hub . devices . get ( device_id) ;
1492
1426
1493
1427
#[ cfg( feature = "trace" ) ]
1494
1428
if let Some ( ref mut trace) = * device. trace . lock ( ) {
1495
1429
trace. add ( trace:: Action :: CreateComputePipeline {
1496
1430
id : fid. id ( ) ,
1497
1431
desc : desc. clone ( ) ,
1498
- implicit_context : implicit_context. clone ( ) ,
1499
1432
} ) ;
1500
1433
}
1501
1434
@@ -1545,40 +1478,6 @@ impl Global {
1545
1478
Err ( e) => break ' error e,
1546
1479
} ;
1547
1480
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
-
1582
1481
let id = fid. assign ( Fallible :: Valid ( pipeline) ) ;
1583
1482
api_log ! ( "Device::create_compute_pipeline -> {id:?}" ) ;
1584
1483
@@ -1587,17 +1486,6 @@ impl Global {
1587
1486
1588
1487
let id = fid. assign ( Fallible :: Invalid ( Arc :: new ( desc. label . to_string ( ) ) ) ) ;
1589
1488
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
-
1601
1489
( id, Some ( error) )
1602
1490
}
1603
1491
0 commit comments