mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-02-16 17:02:32 +00:00
Remove unnecessary mutability from ResourceMetadata field uses. (#3210)
This commit is contained in:
parent
18f3f5f6f0
commit
f41a1c294b
@ -537,11 +537,11 @@ impl<A: hub::HalApi> BufferTracker<A> {
|
||||
|
||||
unsafe {
|
||||
if self.metadata.owned.get(index).unwrap_unchecked() {
|
||||
let existing_epoch = self.metadata.epochs.get_unchecked_mut(index);
|
||||
let existing_ref_count = self.metadata.ref_counts.get_unchecked_mut(index);
|
||||
let existing_epoch = self.metadata.epochs.get_unchecked(index);
|
||||
let existing_ref_count = self.metadata.ref_counts.get_unchecked(index);
|
||||
|
||||
if *existing_epoch == epoch
|
||||
&& existing_ref_count.as_mut().unwrap_unchecked().load() == 1
|
||||
&& existing_ref_count.as_ref().unwrap_unchecked().load() == 1
|
||||
{
|
||||
self.metadata.reset(index);
|
||||
|
||||
|
@ -191,11 +191,11 @@ impl<A: hub::HalApi, T: hub::Resource, Id: TypedId> StatelessTracker<A, T, Id> {
|
||||
|
||||
unsafe {
|
||||
if self.metadata.owned.get(index).unwrap_unchecked() {
|
||||
let existing_epoch = self.metadata.epochs.get_unchecked_mut(index);
|
||||
let existing_ref_count = self.metadata.ref_counts.get_unchecked_mut(index);
|
||||
let existing_epoch = self.metadata.epochs.get_unchecked(index);
|
||||
let existing_ref_count = self.metadata.ref_counts.get_unchecked(index);
|
||||
|
||||
if *existing_epoch == epoch
|
||||
&& existing_ref_count.as_mut().unwrap_unchecked().load() == 1
|
||||
&& existing_ref_count.as_ref().unwrap_unchecked().load() == 1
|
||||
{
|
||||
self.metadata.reset(index);
|
||||
|
||||
|
@ -754,11 +754,11 @@ impl<A: hub::HalApi> TextureTracker<A> {
|
||||
|
||||
unsafe {
|
||||
if self.metadata.owned.get(index).unwrap_unchecked() {
|
||||
let existing_epoch = self.metadata.epochs.get_unchecked_mut(index);
|
||||
let existing_ref_count = self.metadata.ref_counts.get_unchecked_mut(index);
|
||||
let existing_epoch = self.metadata.epochs.get_unchecked(index);
|
||||
let existing_ref_count = self.metadata.ref_counts.get_unchecked(index);
|
||||
|
||||
if *existing_epoch == epoch
|
||||
&& existing_ref_count.as_mut().unwrap_unchecked().load() == 1
|
||||
&& existing_ref_count.as_ref().unwrap_unchecked().load() == 1
|
||||
{
|
||||
self.start_set.complex.remove(&index32);
|
||||
self.end_set.complex.remove(&index32);
|
||||
|
Loading…
Reference in New Issue
Block a user