@@ -27,6 +27,7 @@ use crate::{
2727 device:: { DeviceError , WaitIdleError } ,
2828 get_lowest_common_denom,
2929 global:: Global ,
30+ hal_label,
3031 id:: { self , BlasId , QueueId } ,
3132 init_tracker:: { has_copy_partial_init_tracker_coverage, TextureInitRange } ,
3233 lock:: { rank, Mutex , MutexGuard , RwLock , RwLockWriteGuard } ,
@@ -57,6 +58,7 @@ impl Queue {
5758 pub ( crate ) fn new (
5859 device : Arc < Device > ,
5960 raw : Box < dyn hal:: DynQueue > ,
61+ instance_flags : wgt:: InstanceFlags ,
6062 ) -> Result < Self , DeviceError > {
6163 let pending_encoder = device
6264 . command_allocator
@@ -70,7 +72,7 @@ impl Queue {
7072 }
7173 } ;
7274
73- let mut pending_writes = PendingWrites :: new ( pending_encoder) ;
75+ let mut pending_writes = PendingWrites :: new ( pending_encoder, instance_flags ) ;
7476
7577 let zero_buffer = device. zero_buffer . as_ref ( ) ;
7678 pending_writes. activate ( ) ;
@@ -328,17 +330,22 @@ pub(crate) struct PendingWrites {
328330 dst_buffers : FastHashMap < TrackerIndex , Arc < Buffer > > ,
329331 dst_textures : FastHashMap < TrackerIndex , Arc < Texture > > ,
330332 copied_blas_s : FastHashMap < TrackerIndex , Arc < Blas > > ,
333+ instance_flags : wgt:: InstanceFlags ,
331334}
332335
333336impl PendingWrites {
334- pub fn new ( command_encoder : Box < dyn hal:: DynCommandEncoder > ) -> Self {
337+ pub fn new (
338+ command_encoder : Box < dyn hal:: DynCommandEncoder > ,
339+ instance_flags : wgt:: InstanceFlags ,
340+ ) -> Self {
335341 Self {
336342 command_encoder,
337343 is_recording : false ,
338344 temp_resources : Vec :: new ( ) ,
339345 dst_buffers : FastHashMap :: default ( ) ,
340346 dst_textures : FastHashMap :: default ( ) ,
341347 copied_blas_s : FastHashMap :: default ( ) ,
348+ instance_flags,
342349 }
343350 }
344351
@@ -423,7 +430,10 @@ impl PendingWrites {
423430 if !self . is_recording {
424431 unsafe {
425432 self . command_encoder
426- . begin_encoding ( Some ( "(wgpu internal) PendingWrites" ) )
433+ . begin_encoding ( hal_label (
434+ Some ( "(wgpu internal) PendingWrites" ) ,
435+ self . instance_flags ,
436+ ) )
427437 . unwrap ( ) ;
428438 }
429439 self . is_recording = true ;
@@ -816,6 +826,7 @@ impl Queue {
816826 & self . device . alignments ,
817827 self . device . zero_buffer . as_ref ( ) ,
818828 & snatch_guard,
829+ self . device . instance_flags ,
819830 )
820831 . map_err ( QueueWriteError :: from) ?;
821832 }
@@ -1068,6 +1079,7 @@ impl Queue {
10681079 & self . device . alignments ,
10691080 self . device . zero_buffer . as_ref ( ) ,
10701081 & self . device . snatchable_lock . read ( ) ,
1082+ self . device . instance_flags ,
10711083 )
10721084 . map_err ( QueueWriteError :: from) ?;
10731085 }
@@ -1221,7 +1233,10 @@ impl Queue {
12211233 } ;
12221234
12231235 // execute resource transitions
1224- if let Err ( e) = baked. encoder . open_pass ( Some ( "(wgpu internal) Transit" ) ) {
1236+ if let Err ( e) = baked. encoder . open_pass ( hal_label (
1237+ Some ( "(wgpu internal) Transit" ) ,
1238+ self . device . instance_flags ,
1239+ ) ) {
12251240 break ' error Err ( e. into ( ) ) ;
12261241 }
12271242
@@ -1256,8 +1271,10 @@ impl Queue {
12561271 // Note: we could technically do it after all of the command buffers,
12571272 // but here we have a command encoder by hand, so it's easier to use it.
12581273 if !used_surface_textures. is_empty ( ) {
1259- if let Err ( e) = baked. encoder . open_pass ( Some ( "(wgpu internal) Present" ) )
1260- {
1274+ if let Err ( e) = baked. encoder . open_pass ( hal_label (
1275+ Some ( "(wgpu internal) Present" ) ,
1276+ self . device . instance_flags ,
1277+ ) ) {
12611278 break ' error Err ( e. into ( ) ) ;
12621279 }
12631280 let texture_barriers = trackers
0 commit comments