VERY experimental Nintendo Switch 2 emulator
C++
hle: nvflinger: buffer_queue_core: StillTracking: Take const reference.
bunneie941573bb78c
diff --git a/src/core/hle/service/nvflinger/buffer_queue_consumer.cpp b/src/core/hle/service/nvflinger/buffer_queue_consumer.cppindex 5184d876a9..cf12ccefff 100644--- a/src/core/hle/service/nvflinger/buffer_queue_consumer.cpp+++ b/src/core/hle/service/nvflinger/buffer_queue_consumer.cpp@@ -74,7 +74,7 @@ Status BufferQueueConsumer::AcquireBuffer(BufferItem* out_buffer,LOG_DEBUG(Service_NVFlinger, "drop desire={} expect={} size={}", desired_present,expected_present.count(), core->queue.size());- if (core->StillTracking(&*front)) {+ if (core->StillTracking(*front)) {// Front buffer is still in mSlots, so mark the slot as freeslots[front->slot].buffer_state = BufferState::Free;core->free_buffers.push_back(front->slot);@@ -110,7 +110,7 @@ Status BufferQueueConsumer::AcquireBuffer(BufferItem* out_buffer,LOG_DEBUG(Service_NVFlinger, "acquiring slot={}", slot);// If the front buffer is still being tracked, update its slot state- if (core->StillTracking(&*front)) {+ if (core->StillTracking(*front)) {slots[slot].acquire_called = true;slots[slot].needs_cleanup_on_release = false;slots[slot].buffer_state = BufferState::Acquired;diff --git a/src/core/hle/service/nvflinger/buffer_queue_core.cpp b/src/core/hle/service/nvflinger/buffer_queue_core.cppindex 4a26d2fdcb..3f1ce78b0c 100644--- a/src/core/hle/service/nvflinger/buffer_queue_core.cpp+++ b/src/core/hle/service/nvflinger/buffer_queue_core.cpp@@ -116,10 +116,10 @@ void BufferQueueCore::FreeAllBuffersLocked() {}}-bool BufferQueueCore::StillTracking(const BufferItem* item) const {- const BufferSlot& slot = slots[item->slot];+bool BufferQueueCore::StillTracking(const BufferItem& item) const {+ const BufferSlot& slot = slots[item.slot];- return (slot.graphic_buffer != nullptr) && (item->graphic_buffer == slot.graphic_buffer);+ return (slot.graphic_buffer != nullptr) && (item.graphic_buffer == slot.graphic_buffer);}void BufferQueueCore::WaitWhileAllocatingLocked() const {diff --git a/src/core/hle/service/nvflinger/buffer_queue_core.h b/src/core/hle/service/nvflinger/buffer_queue_core.hindex 252a36350f..ad10b4c3c2 100644--- a/src/core/hle/service/nvflinger/buffer_queue_core.h+++ b/src/core/hle/service/nvflinger/buffer_queue_core.h@@ -45,7 +45,7 @@ private:s32 GetPreallocatedBufferCountLocked() const;void FreeBufferLocked(s32 slot);void FreeAllBuffersLocked();- bool StillTracking(const BufferItem* item) const;+ bool StillTracking(const BufferItem& item) const;void WaitWhileAllocatingLocked() const;private:diff --git a/src/core/hle/service/nvflinger/buffer_queue_producer.cpp b/src/core/hle/service/nvflinger/buffer_queue_producer.cppindex 2f7e9dcfca..eba486754b 100644--- a/src/core/hle/service/nvflinger/buffer_queue_producer.cpp+++ b/src/core/hle/service/nvflinger/buffer_queue_producer.cpp@@ -554,7 +554,7 @@ Status BufferQueueProducer::QueueBuffer(s32 slot, const QueueBufferInput& input,if (front->is_droppable) {// If the front queued buffer is still being tracked, we first// mark it as freed- if (core->StillTracking(&*front)) {+ if (core->StillTracking(*front)) {slots[front->slot].buffer_state = BufferState::Free;core->free_buffers.push_front(front->slot);}