@@ -116,6 +116,24 @@ impl super::Device {
116
116
// maximum number of CBV/SRV/UAV descriptors in heap for Tier 1
117
117
let capacity_views = limits. max_non_sampler_bindings as u64 ;
118
118
119
+ let draw_mesh = if features
120
+ . features_wgpu
121
+ . contains ( wgt:: FeaturesWGPU :: EXPERIMENTAL_MESH_SHADER )
122
+ {
123
+ Some ( Self :: create_command_signature (
124
+ & raw ,
125
+ None ,
126
+ size_of :: < wgt:: DispatchIndirectArgs > ( ) ,
127
+ & [ Direct3D12 :: D3D12_INDIRECT_ARGUMENT_DESC {
128
+ Type : Direct3D12 :: D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH ,
129
+ ..Default :: default ( )
130
+ } ] ,
131
+ 0 ,
132
+ ) ?)
133
+ } else {
134
+ None
135
+ } ;
136
+
119
137
let shared = super :: DeviceShared {
120
138
adapter,
121
139
zero_buffer,
@@ -140,16 +158,7 @@ impl super::Device {
140
158
} ] ,
141
159
0 ,
142
160
) ?,
143
- draw_mesh : Self :: create_command_signature (
144
- & raw ,
145
- None ,
146
- size_of :: < wgt:: DispatchIndirectArgs > ( ) ,
147
- & [ Direct3D12 :: D3D12_INDIRECT_ARGUMENT_DESC {
148
- Type : Direct3D12 :: D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH ,
149
- ..Default :: default ( )
150
- } ] ,
151
- 0 ,
152
- ) ?,
161
+ draw_mesh,
153
162
dispatch : Self :: create_command_signature (
154
163
& raw ,
155
164
None ,
@@ -1371,47 +1380,58 @@ impl crate::Device for super::Device {
1371
1380
} ;
1372
1381
size_of_val ( & first_vertex) + size_of_val ( & first_instance) + size_of_val ( & other)
1373
1382
} ;
1374
- Some ( super :: CommandSignatures {
1375
- draw : Self :: create_command_signature (
1383
+
1384
+ let draw_mesh = if self
1385
+ . features
1386
+ . features_wgpu
1387
+ . contains ( wgt:: FeaturesWGPU :: EXPERIMENTAL_MESH_SHADER )
1388
+ {
1389
+ Some ( Self :: create_command_signature (
1376
1390
& self . raw ,
1377
1391
Some ( & raw ) ,
1378
- special_constant_buffer_args_len + size_of :: < wgt:: DrawIndirectArgs > ( ) ,
1392
+ special_constant_buffer_args_len + size_of :: < wgt:: DispatchIndirectArgs > ( ) ,
1379
1393
& [
1380
1394
constant_indirect_argument_desc,
1381
1395
Direct3D12 :: D3D12_INDIRECT_ARGUMENT_DESC {
1382
- Type : Direct3D12 :: D3D12_INDIRECT_ARGUMENT_TYPE_DRAW ,
1396
+ Type : Direct3D12 :: D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH ,
1383
1397
..Default :: default ( )
1384
1398
} ,
1385
1399
] ,
1386
1400
0 ,
1387
- ) ?,
1388
- draw_indexed : Self :: create_command_signature (
1401
+ ) ?)
1402
+ } else {
1403
+ None
1404
+ } ;
1405
+
1406
+ Some ( super :: CommandSignatures {
1407
+ draw : Self :: create_command_signature (
1389
1408
& self . raw ,
1390
1409
Some ( & raw ) ,
1391
- special_constant_buffer_args_len
1392
- + size_of :: < wgt:: DrawIndexedIndirectArgs > ( ) ,
1410
+ special_constant_buffer_args_len + size_of :: < wgt:: DrawIndirectArgs > ( ) ,
1393
1411
& [
1394
1412
constant_indirect_argument_desc,
1395
1413
Direct3D12 :: D3D12_INDIRECT_ARGUMENT_DESC {
1396
- Type : Direct3D12 :: D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED ,
1414
+ Type : Direct3D12 :: D3D12_INDIRECT_ARGUMENT_TYPE_DRAW ,
1397
1415
..Default :: default ( )
1398
1416
} ,
1399
1417
] ,
1400
1418
0 ,
1401
1419
) ?,
1402
- draw_mesh : Self :: create_command_signature (
1420
+ draw_indexed : Self :: create_command_signature (
1403
1421
& self . raw ,
1404
1422
Some ( & raw ) ,
1405
- special_constant_buffer_args_len + size_of :: < wgt:: DispatchIndirectArgs > ( ) ,
1423
+ special_constant_buffer_args_len
1424
+ + size_of :: < wgt:: DrawIndexedIndirectArgs > ( ) ,
1406
1425
& [
1407
1426
constant_indirect_argument_desc,
1408
1427
Direct3D12 :: D3D12_INDIRECT_ARGUMENT_DESC {
1409
- Type : Direct3D12 :: D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH ,
1428
+ Type : Direct3D12 :: D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED ,
1410
1429
..Default :: default ( )
1411
1430
} ,
1412
1431
] ,
1413
1432
0 ,
1414
1433
) ?,
1434
+ draw_mesh,
1415
1435
dispatch : Self :: create_command_signature (
1416
1436
& self . raw ,
1417
1437
Some ( & raw ) ,
0 commit comments