From 64c56315793d2b6dbf7a55f99d4bcc51929f03cb Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 4 Jan 2020 00:45:06 -0500 Subject: service: vi: Implement CloseLayer. - Needed for Undertale. --- src/core/hle/service/nvflinger/nvflinger.cpp | 6 ++++++ src/core/hle/service/nvflinger/nvflinger.h | 3 +++ 2 files changed, 9 insertions(+) (limited to 'src/core/hle/service/nvflinger') diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index 52623cf89..a58ea9c59 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp @@ -88,6 +88,12 @@ std::optional NVFlinger::CreateLayer(u64 display_id) { return layer_id; } +void NVFlinger::CloseLayer(u64 layer_id) { + for (auto& display : displays) { + display.CloseLayer(layer_id); + } +} + std::optional NVFlinger::FindBufferQueueId(u64 display_id, u64 layer_id) const { const auto* const layer = FindLayer(display_id, layer_id); diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h index e3cc14bdc..57a21f33b 100644 --- a/src/core/hle/service/nvflinger/nvflinger.h +++ b/src/core/hle/service/nvflinger/nvflinger.h @@ -54,6 +54,9 @@ public: /// If an invalid display ID is specified, then an empty optional is returned. std::optional CreateLayer(u64 display_id); + /// Closes a layer on all displays for the given layer ID. + void CloseLayer(u64 layer_id); + /// Finds the buffer queue ID of the specified layer in the specified display. /// /// If an invalid display ID or layer ID is provided, then an empty optional is returned. -- cgit v1.2.3