VERY experimental Nintendo Switch 2 emulator
C++
Nvflinger: correct duplication.
Fernando Sahmkow40a5c7d39825
diff --git a/src/core/hle/service/nvdrv/core/nvmap.cpp b/src/core/hle/service/nvdrv/core/nvmap.cppindex dd30e156eb..f811b66a0d 100644--- a/src/core/hle/service/nvdrv/core/nvmap.cpp+++ b/src/core/hle/service/nvdrv/core/nvmap.cpp@@ -207,14 +207,14 @@ void NvMap::UnpinHandle(Handle::Id handle) {}}-void NvMap::DuplicateHandle(Handle::Id handle) {+void NvMap::DuplicateHandle(Handle::Id handle, bool internal_session) {auto handle_description{GetHandle(handle)};if (!handle_description) {LOG_CRITICAL(Service_NVDRV, "Unregistered handle!");return;}- auto result = handle_description->Duplicate(false);+ auto result = handle_description->Duplicate(internal_session);if (result != NvResult::Success) {LOG_CRITICAL(Service_NVDRV, "Could not duplicate handle!");}diff --git a/src/core/hle/service/nvdrv/core/nvmap.h b/src/core/hle/service/nvdrv/core/nvmap.hindex b6613a521e..ef2df3ad75 100644--- a/src/core/hle/service/nvdrv/core/nvmap.h+++ b/src/core/hle/service/nvdrv/core/nvmap.h@@ -165,7 +165,7 @@ public:/*** @brief Tries to duplicate a handle*/- void DuplicateHandle(Handle::Id handle);+ void DuplicateHandle(Handle::Id handle, bool internal_session = false);/*** @brief Tries to free a handle and remove a single dupediff --git a/src/core/hle/service/nvflinger/buffer_queue_consumer.cpp b/src/core/hle/service/nvflinger/buffer_queue_consumer.cppindex a0330ab4aa..1ce67c771c 100644--- a/src/core/hle/service/nvflinger/buffer_queue_consumer.cpp+++ b/src/core/hle/service/nvflinger/buffer_queue_consumer.cpp@@ -136,7 +136,7 @@ Status BufferQueueConsumer::ReleaseBuffer(s32 slot, u64 frame_number, const Fencslots[slot].buffer_state = BufferState::Free;- nvmap.FreeHandle(slots[slot].graphic_buffer->BufferId(), false);+ nvmap.FreeHandle(slots[slot].graphic_buffer->BufferId(), true);listener = core->connected_producer_listener;diff --git a/src/core/hle/service/nvflinger/buffer_queue_producer.cpp b/src/core/hle/service/nvflinger/buffer_queue_producer.cppindex a4e46964ce..d4ab23a108 100644--- a/src/core/hle/service/nvflinger/buffer_queue_producer.cpp+++ b/src/core/hle/service/nvflinger/buffer_queue_producer.cpp@@ -532,7 +532,7 @@ Status BufferQueueProducer::QueueBuffer(s32 slot, const QueueBufferInput& input,item.is_droppable = core->dequeue_buffer_cannot_block || async;item.swap_interval = swap_interval;- nvmap.DuplicateHandle(item.graphic_buffer->BufferId());+ nvmap.DuplicateHandle(item.graphic_buffer->BufferId(), true);sticky_transform = sticky_transform_;