Skip to content

Commit 0acce78

Browse files
fixup! chore: naively set warn(unsafe_op_in_unsafe_fn) in wgpu-core
1 parent 75e791d commit 0acce78

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

wgpu-core/src/track/buffer.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -713,16 +713,19 @@ unsafe fn insert<A: hub::HalApi>(
713713

714714
log::trace!("\tbuf {index}: insert {new_start_state:?}..{new_end_state:?}");
715715

716-
if let Some(&mut ref mut start_state) = start_states {
717-
unsafe { *start_state.get_unchecked_mut(index) = new_start_state };
718-
}
719-
unsafe { *current_states.get_unchecked_mut(index) = new_end_state };
716+
unsafe {
717+
if let Some(&mut ref mut start_state) = start_states {
718+
*start_state.get_unchecked_mut(index) = new_start_state;
719+
}
720+
*current_states.get_unchecked_mut(index) = new_end_state;
720721

721-
let (epoch, ref_count) = unsafe { metadata_provider.get_own(life_guard, index) };
722+
let (epoch, ref_count) = metadata_provider.get_own(life_guard, index);
722723

723-
resource_metadata.owned.set(index, true);
724-
unsafe { *resource_metadata.epochs.get_unchecked_mut(index) = epoch };
725-
unsafe { *resource_metadata.ref_counts.get_unchecked_mut(index) = Some(ref_count) };
724+
resource_metadata.owned.set(index, true);
725+
726+
*resource_metadata.epochs.get_unchecked_mut(index) = epoch;
727+
*resource_metadata.ref_counts.get_unchecked_mut(index) = Some(ref_count);
728+
}
726729
}
727730

728731
#[inline(always)]

wgpu-core/src/track/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,11 +609,11 @@ impl<A: hub::HalApi> UsageScope<A> {
609609
textures: &hub::Storage<resource::Texture<A>, id::TextureId>,
610610
bind_group: &BindGroupStates<A>,
611611
) -> Result<(), UsageConflict> {
612-
unsafe { self.buffers.merge_bind_group(&bind_group.buffers)? };
613612
unsafe {
613+
self.buffers.merge_bind_group(&bind_group.buffers)?;
614614
self.textures
615-
.merge_bind_group(textures, &bind_group.textures)?
616-
};
615+
.merge_bind_group(textures, &bind_group.textures)?;
616+
}
617617

618618
Ok(())
619619
}

0 commit comments

Comments
 (0)