diff --git a/wgpu-core/src/binding_model.rs b/wgpu-core/src/binding_model.rs index 7ad13e25e..a459dc0c0 100644 --- a/wgpu-core/src/binding_model.rs +++ b/wgpu-core/src/binding_model.rs @@ -1252,8 +1252,8 @@ pub struct BindGroup { pub(crate) label: String, pub(crate) tracking_data: TrackingData, pub(crate) used: BindGroupStates, - pub(crate) used_buffer_ranges: Vec, - pub(crate) used_texture_ranges: Vec, + pub(crate) buffer_init_actions: Vec, + pub(crate) texture_init_actions: Vec, /// INVARIANT: Sorted by binding index order. pub(crate) dynamic_binding_info: Vec, /// Actual binding sizes for buffers that don't have `min_binding_size` @@ -1279,10 +1279,10 @@ impl BindGroup { ) -> Result<&'a dyn hal::DynBindGroup, DestroyedResourceError> { // Clippy insist on writing it this way. The idea is to return None // if any of the raw buffer is not valid anymore. - for buffer in &self.used_buffer_ranges { + for buffer in &self.buffer_init_actions { buffer.buffer.try_raw(guard)?; } - for texture in &self.used_texture_ranges { + for texture in &self.texture_init_actions { texture.texture.try_raw(guard)?; } diff --git a/wgpu-core/src/command/bundle.rs b/wgpu-core/src/command/bundle.rs index 1a39a5173..4848427be 100644 --- a/wgpu-core/src/command/bundle.rs +++ b/wgpu-core/src/command/bundle.rs @@ -1499,9 +1499,9 @@ impl State { self.commands .extend(entries.map(|(i, bind_group, dynamic_offsets)| { self.buffer_memory_init_actions - .extend_from_slice(&bind_group.used_buffer_ranges); + .extend_from_slice(&bind_group.buffer_init_actions); self.texture_memory_init_actions - .extend_from_slice(&bind_group.used_texture_ranges); + .extend_from_slice(&bind_group.texture_init_actions); self.flat_dynamic_offsets.extend_from_slice(dynamic_offsets); diff --git a/wgpu-core/src/command/pass.rs b/wgpu-core/src/command/pass.rs index 67ba4ba6d..f977292b6 100644 --- a/wgpu-core/src/command/pass.rs +++ b/wgpu-core/src/command/pass.rs @@ -148,7 +148,7 @@ pub(super) fn flush_bindings_helper(state: &mut PassState) -> Result<(), Destroy for (i, bind_group, dynamic_offsets) in entries { state.base.buffer_memory_init_actions.extend( - bind_group.used_buffer_ranges.iter().filter_map(|action| { + bind_group.buffer_init_actions.iter().filter_map(|action| { action .buffer .initialization_status @@ -156,7 +156,7 @@ pub(super) fn flush_bindings_helper(state: &mut PassState) -> Result<(), Destroy .check_action(action) }), ); - for action in bind_group.used_texture_ranges.iter() { + for action in bind_group.texture_init_actions.iter() { state.pending_discard_init_fixups.extend( state .base diff --git a/wgpu-core/src/device/resource.rs b/wgpu-core/src/device/resource.rs index 729e16259..d08923140 100644 --- a/wgpu-core/src/device/resource.rs +++ b/wgpu-core/src/device/resource.rs @@ -2874,7 +2874,7 @@ impl Device { bb: &'a binding_model::ResolvedBufferBinding, binding: u32, decl: &wgt::BindGroupLayoutEntry, - used_buffer_ranges: &mut Vec, + buffer_init_actions: &mut Vec, dynamic_binding_info: &mut Vec, late_buffer_binding_sizes: &mut FastHashMap, used: &mut BindGroupStates, @@ -2999,7 +2999,7 @@ impl Device { binding_model::buffer_binding_type_bounds_check_alignment(&self.alignments, binding_ty); let visible_size = align_to(bind_size, bounds_check_alignment); - used_buffer_ranges.extend(buffer.initialization_status.read().create_action( + buffer_init_actions.extend(buffer.initialization_status.read().create_action( buffer, bb.offset..bb.offset + visible_size, MemoryInitKind::NeedsInitializedMemory, @@ -3063,7 +3063,7 @@ impl Device { decl: &wgt::BindGroupLayoutEntry, view: &'a Arc, used: &mut BindGroupStates, - used_texture_ranges: &mut Vec, + texture_init_actions: &mut Vec, snatch_guard: &'a SnatchGuard<'a>, ) -> Result, CreateBindGroupError> { view.same_device(self)?; @@ -3079,7 +3079,7 @@ impl Device { let texture = &view.parent; - used_texture_ranges.push(TextureInitTrackerAction { + texture_init_actions.push(TextureInitTrackerAction { texture: texture.clone(), range: TextureInitRange { mip_range: view.desc.range.mip_range(texture.desc.mip_level_count), @@ -3277,8 +3277,8 @@ impl Device { // fill out the descriptors let mut used = BindGroupStates::new(); - let mut used_buffer_ranges = Vec::new(); - let mut used_texture_ranges = Vec::new(); + let mut buffer_init_actions = Vec::new(); + let mut texture_init_actions = Vec::new(); let mut hal_entries = Vec::with_capacity(desc.entries.len()); let mut hal_buffers = Vec::new(); let mut hal_samplers = Vec::new(); @@ -3299,7 +3299,7 @@ impl Device { bb, binding, decl, - &mut used_buffer_ranges, + &mut buffer_init_actions, &mut dynamic_binding_info, &mut late_buffer_binding_sizes, &mut used, @@ -3320,7 +3320,7 @@ impl Device { bb, binding, decl, - &mut used_buffer_ranges, + &mut buffer_init_actions, &mut dynamic_binding_info, &mut late_buffer_binding_sizes, &mut used, @@ -3370,7 +3370,7 @@ impl Device { decl, view, &mut used, - &mut used_texture_ranges, + &mut texture_init_actions, &snatch_guard, )?; let res_index = hal_textures.len(); @@ -3389,7 +3389,7 @@ impl Device { decl, view, &mut used, - &mut used_texture_ranges, + &mut texture_init_actions, &snatch_guard, )?; @@ -3490,8 +3490,8 @@ impl Device { label: desc.label.to_string(), tracking_data: TrackingData::new(self.tracker_indices.bind_groups.clone()), used, - used_buffer_ranges, - used_texture_ranges, + buffer_init_actions, + texture_init_actions, dynamic_binding_info, late_buffer_binding_infos, }; @@ -3499,11 +3499,11 @@ impl Device { let bind_group = Arc::new(bind_group); let weak_ref = Arc::downgrade(&bind_group); - for range in &bind_group.used_texture_ranges { + for range in &bind_group.texture_init_actions { let mut bind_groups = range.texture.bind_groups.lock(); bind_groups.push(weak_ref.clone()); } - for range in &bind_group.used_buffer_ranges { + for range in &bind_group.buffer_init_actions { let mut bind_groups = range.buffer.bind_groups.lock(); bind_groups.push(weak_ref.clone()); }