Compare commits

..

11 Commits

Author SHA1 Message Date
PavelBARABANOV 283935dc7c h 2026-09-06 00:44:22 +02:00
PavelBARABANOV fc97a59d2c Bruno FIX OVERLAY 2.0 2026-09-06 00:44:22 +02:00
PavelBARABANOV b4a92a5db8 Brubo patch 2026-09-06 00:44:22 +02:00
PavelBARABANOV cd9c750545 find? 2026-09-06 00:44:22 +02:00
PavelBARABANOV 9858c9d346 add ColorOpaqueBlackRgba32 2026-09-06 00:44:22 +02:00
PavelBARABANOV 70e274fe5f return ClearAppletCaptureBuffer etc. 2026-09-06 00:44:22 +02:00
PavelBARABANOV 55546f2481 ac3 again 2026-09-06 00:44:22 +02:00
PavelBARABANOV 870dd5e175 headers 2026-09-06 00:44:22 +02:00
PavelBARABANOV 398f202891 for convenience 2026-09-06 00:44:22 +02:00
PavelBARABANOV 645938daf3 or 2026-09-06 00:44:22 +02:00
PavelBARABANOV 9d975c5870 return SetLayerZIndex(layer_id, 100000) 2026-09-06 00:44:22 +02:00
3 changed files with 6 additions and 27 deletions
+1
View File
@@ -117,6 +117,7 @@ template <typename T>
static void GetFuncAddress(Common::DynamicLibrary& dll, const char* name, T& pfn) {
if (!dll.GetSymbol(name, &pfn)) {
LOG_CRITICAL(HW_Memory, "Failed to load {}", name);
throw std::bad_alloc{};
}
}
@@ -81,12 +81,12 @@ Result DisplayLayerManager::CreateManagedDisplayLayer(u64* out_layer_id) {
(void)m_manager_display_service->SetLayerBlending(m_blending_enabled, *out_layer_id);
if (m_applet_id == AppletId::OverlayDisplay) {
(void)m_manager_display_service->SetLayerZIndex(Overlay, *out_layer_id);
(void)m_display_service->GetContainer()->SetLayerIsOverlay(*out_layer_id, true);
} else {
(void)m_manager_display_service->SetLayerZIndex(Foreground, *out_layer_id);
}
}
m_display_service->GetContainer()->SetLayerZIndex(*out_layer_id, true);
m_managed_display_layers.emplace(*out_layer_id);
R_SUCCEED();
@@ -126,15 +126,16 @@ Result DisplayLayerManager::IsSystemBufferSharingEnabled() {
// Ensure the overlay layer is visible
m_manager_display_service->SetLayerVisibility(m_visible, m_system_shared_layer_id);
(void)m_display_service->GetContainer()->SetLayerStackMask(m_system_shared_layer_id,
this->GetLayerStackMask());
m_manager_display_service->SetLayerBlending(m_blending_enabled, m_system_shared_layer_id);
(void)m_manager_display_service->SetLayerBlending(m_blending_enabled, m_system_shared_layer_id);
s32 initial_z = Foreground;
if (m_applet_id == AppletId::OverlayDisplay) {
initial_z = Overlay;
(void)m_manager_display_service->SetLayerZIndex(initial_z, m_system_shared_layer_id);
(void)m_display_service->GetContainer()->SetLayerIsOverlay(m_system_shared_layer_id, true);
}
m_manager_display_service->SetLayerZIndex(initial_z, m_system_shared_layer_id);
m_display_service->GetContainer()->SetLayerZIndex(m_system_shared_layer_id, true);
m_managed_display_layers.emplace(m_system_shared_layer_id);
R_SUCCEED();
}
@@ -300,28 +300,6 @@ Result SharedBufferManager::CreateSession(Kernel::KProcess* owner_process, u64*
}
}
// Claim a presentation slot range.
u32 slot_base = 0;
std::array<bool, SharedBufferMaxSessions> in_use{};
for (const auto& [existing_aruid, existing] : m_sessions) {
const u32 index = existing.presentation_slot_base / SharedBufferSlotsPerSession;
if (index < in_use.size())
in_use[index] = true;
}
u32 index = 0;
while (index < in_use.size() && in_use[index])
index++;
if (index >= in_use.size()) {
LOG_ERROR(Service_VI, "Out of shared buffer presentation slots ({} sessions)", SharedBufferMaxSessions);
R_THROW(VI::ResultOperationFailed);
}
slot_base = index * SharedBufferSlotsPerSession;
// Map into process.
Common::ProcessAddress map_address{};
R_TRY(MapSharedBufferIntoProcessAddressSpace(std::addressof(map_address), m_buffer_page_group,
@@ -330,7 +308,6 @@ Result SharedBufferManager::CreateSession(Kernel::KProcess* owner_process, u64*
// Create new session.
auto [it, was_emplaced] = m_sessions.emplace(aruid, SharedBufferSession{});
auto& session = it->second;
session.presentation_slot_base = slot_base;
auto& container = m_nvdrv->GetContainer();
session.session_id = container.OpenSession(owner_process);