From 987e92677f830772694f240b8f443aae4c5e3b3e Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Thu, 4 May 2023 02:06:21 +0200 Subject: [PATCH] early-access version 3548 --- README.md | 2 +- src/video_core/memory_manager.cpp | 9 +++++---- src/yuzu/bootmanager.cpp | 4 ++-- src/yuzu/configuration/configure_graphics.cpp | 2 +- src/yuzu/qt_common.cpp | 4 ++-- src/yuzu/qt_common.h | 4 ++-- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index afff2f870..cd3803c57 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3546. +This is the source code for early-access 3548. ## Legal Notice diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp index b40655c5d..5cdfd8ba4 100755 --- a/src/video_core/memory_manager.cpp +++ b/src/video_core/memory_manager.cpp @@ -82,6 +82,7 @@ void MemoryManager::SetEntry(size_t position, MemoryManager::EntryType entry) { } PTEKind MemoryManager::GetPageKind(GPUVAddr gpu_addr) const { + std::unique_lock lock(guard); return kind_map.GetValueAt(gpu_addr); } @@ -160,7 +161,10 @@ GPUVAddr MemoryManager::BigPageTableOp(GPUVAddr gpu_addr, [[maybe_unused]] VAddr } remaining_size -= big_page_size; } - kind_map.Map(gpu_addr, gpu_addr + size, kind); + { + std::unique_lock lock(guard); + kind_map.Map(gpu_addr, gpu_addr + size, kind); + } return gpu_addr; } @@ -170,7 +174,6 @@ void MemoryManager::BindRasterizer(VideoCore::RasterizerInterface* rasterizer_) GPUVAddr MemoryManager::Map(GPUVAddr gpu_addr, VAddr cpu_addr, std::size_t size, PTEKind kind, bool is_big_pages) { - std::unique_lock lock(guard); if (is_big_pages) [[likely]] { return BigPageTableOp(gpu_addr, cpu_addr, size, kind); } @@ -178,7 +181,6 @@ GPUVAddr MemoryManager::Map(GPUVAddr gpu_addr, VAddr cpu_addr, std::size_t size, } GPUVAddr MemoryManager::MapSparse(GPUVAddr gpu_addr, std::size_t size, bool is_big_pages) { - std::unique_lock lock(guard); if (is_big_pages) [[likely]] { return BigPageTableOp(gpu_addr, 0, size, PTEKind::INVALID); } @@ -189,7 +191,6 @@ void MemoryManager::Unmap(GPUVAddr gpu_addr, std::size_t size) { if (size == 0) { return; } - std::unique_lock lock(guard); GetSubmappedRangeImpl(gpu_addr, size, page_stash); for (const auto& [map_addr, map_size] : page_stash) { diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index cc4f5d941..20a0ea36e 100755 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -241,7 +241,7 @@ public: explicit RenderWidget(GRenderWindow* parent) : QWidget(parent), render_window(parent) { setAttribute(Qt::WA_NativeWindow); setAttribute(Qt::WA_PaintOnScreen); - if (YuzuQtCommon::GetWindowSystemType() == Core::Frontend::WindowSystemType::Wayland) { + if (QtCommon::GetWindowSystemType() == Core::Frontend::WindowSystemType::Wayland) { setAttribute(Qt::WA_DontCreateNativeAncestors); } } @@ -884,7 +884,7 @@ bool GRenderWindow::InitRenderTarget() { } // Update the Window System information with the new render target - window_info = YuzuQtCommon::GetWindowSystemInfo(child_widget->windowHandle()); + window_info = QtCommon::GetWindowSystemInfo(child_widget->windowHandle()); child_widget->resize(Layout::ScreenUndocked::Width, Layout::ScreenUndocked::Height); layout()->addWidget(child_widget); diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 75d4b5784..ea249e9bb 100755 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp @@ -507,7 +507,7 @@ void ConfigureGraphics::RetrieveVulkanDevices() try { using namespace Vulkan; auto* window = this->window()->windowHandle(); - auto wsi = YuzuQtCommon::GetWindowSystemInfo(window); + auto wsi = QtCommon::GetWindowSystemInfo(window); vk::InstanceDispatch dld; const Common::DynamicLibrary library = OpenLibrary(); diff --git a/src/yuzu/qt_common.cpp b/src/yuzu/qt_common.cpp index 1b533ee40..5ac9fe310 100755 --- a/src/yuzu/qt_common.cpp +++ b/src/yuzu/qt_common.cpp @@ -12,7 +12,7 @@ #include #endif -namespace YuzuQtCommon { +namespace QtCommon { Core::Frontend::WindowSystemType GetWindowSystemType() { // Determine WSI type based on Qt platform. QString platform_name = QGuiApplication::platformName(); @@ -52,4 +52,4 @@ Core::Frontend::EmuWindow::WindowSystemInfo GetWindowSystemInfo(QWindow* window) return wsi; } -} // namespace YuzuQtCommon +} // namespace QtCommon diff --git a/src/yuzu/qt_common.h b/src/yuzu/qt_common.h index b366adee6..9c63f08f3 100755 --- a/src/yuzu/qt_common.h +++ b/src/yuzu/qt_common.h @@ -6,10 +6,10 @@ #include #include "core/frontend/emu_window.h" -namespace YuzuQtCommon { +namespace QtCommon { Core::Frontend::WindowSystemType GetWindowSystemType(); Core::Frontend::EmuWindow::WindowSystemInfo GetWindowSystemInfo(QWindow* window); -} // namespace YuzuQtCommon +} // namespace QtCommon