early-access version 3548

This commit is contained in:
pineappleEA 2023-05-04 02:06:21 +02:00
parent f812cb181c
commit 987e92677f
6 changed files with 13 additions and 12 deletions

View file

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 3546. This is the source code for early-access 3548.
## Legal Notice ## Legal Notice

View file

@ -82,6 +82,7 @@ void MemoryManager::SetEntry(size_t position, MemoryManager::EntryType entry) {
} }
PTEKind MemoryManager::GetPageKind(GPUVAddr gpu_addr) const { PTEKind MemoryManager::GetPageKind(GPUVAddr gpu_addr) const {
std::unique_lock<std::mutex> lock(guard);
return kind_map.GetValueAt(gpu_addr); return kind_map.GetValueAt(gpu_addr);
} }
@ -160,7 +161,10 @@ GPUVAddr MemoryManager::BigPageTableOp(GPUVAddr gpu_addr, [[maybe_unused]] VAddr
} }
remaining_size -= big_page_size; remaining_size -= big_page_size;
} }
kind_map.Map(gpu_addr, gpu_addr + size, kind); {
std::unique_lock<std::mutex> lock(guard);
kind_map.Map(gpu_addr, gpu_addr + size, kind);
}
return gpu_addr; 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, GPUVAddr MemoryManager::Map(GPUVAddr gpu_addr, VAddr cpu_addr, std::size_t size, PTEKind kind,
bool is_big_pages) { bool is_big_pages) {
std::unique_lock<std::mutex> lock(guard);
if (is_big_pages) [[likely]] { if (is_big_pages) [[likely]] {
return BigPageTableOp<EntryType::Mapped>(gpu_addr, cpu_addr, size, kind); return BigPageTableOp<EntryType::Mapped>(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) { GPUVAddr MemoryManager::MapSparse(GPUVAddr gpu_addr, std::size_t size, bool is_big_pages) {
std::unique_lock<std::mutex> lock(guard);
if (is_big_pages) [[likely]] { if (is_big_pages) [[likely]] {
return BigPageTableOp<EntryType::Reserved>(gpu_addr, 0, size, PTEKind::INVALID); return BigPageTableOp<EntryType::Reserved>(gpu_addr, 0, size, PTEKind::INVALID);
} }
@ -189,7 +191,6 @@ void MemoryManager::Unmap(GPUVAddr gpu_addr, std::size_t size) {
if (size == 0) { if (size == 0) {
return; return;
} }
std::unique_lock<std::mutex> lock(guard);
GetSubmappedRangeImpl<false>(gpu_addr, size, page_stash); GetSubmappedRangeImpl<false>(gpu_addr, size, page_stash);
for (const auto& [map_addr, map_size] : page_stash) { for (const auto& [map_addr, map_size] : page_stash) {

View file

@ -241,7 +241,7 @@ public:
explicit RenderWidget(GRenderWindow* parent) : QWidget(parent), render_window(parent) { explicit RenderWidget(GRenderWindow* parent) : QWidget(parent), render_window(parent) {
setAttribute(Qt::WA_NativeWindow); setAttribute(Qt::WA_NativeWindow);
setAttribute(Qt::WA_PaintOnScreen); setAttribute(Qt::WA_PaintOnScreen);
if (YuzuQtCommon::GetWindowSystemType() == Core::Frontend::WindowSystemType::Wayland) { if (QtCommon::GetWindowSystemType() == Core::Frontend::WindowSystemType::Wayland) {
setAttribute(Qt::WA_DontCreateNativeAncestors); setAttribute(Qt::WA_DontCreateNativeAncestors);
} }
} }
@ -884,7 +884,7 @@ bool GRenderWindow::InitRenderTarget() {
} }
// Update the Window System information with the new render target // 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); child_widget->resize(Layout::ScreenUndocked::Width, Layout::ScreenUndocked::Height);
layout()->addWidget(child_widget); layout()->addWidget(child_widget);

View file

@ -507,7 +507,7 @@ void ConfigureGraphics::RetrieveVulkanDevices() try {
using namespace Vulkan; using namespace Vulkan;
auto* window = this->window()->windowHandle(); auto* window = this->window()->windowHandle();
auto wsi = YuzuQtCommon::GetWindowSystemInfo(window); auto wsi = QtCommon::GetWindowSystemInfo(window);
vk::InstanceDispatch dld; vk::InstanceDispatch dld;
const Common::DynamicLibrary library = OpenLibrary(); const Common::DynamicLibrary library = OpenLibrary();

View file

@ -12,7 +12,7 @@
#include <qpa/qplatformnativeinterface.h> #include <qpa/qplatformnativeinterface.h>
#endif #endif
namespace YuzuQtCommon { namespace QtCommon {
Core::Frontend::WindowSystemType GetWindowSystemType() { Core::Frontend::WindowSystemType GetWindowSystemType() {
// Determine WSI type based on Qt platform. // Determine WSI type based on Qt platform.
QString platform_name = QGuiApplication::platformName(); QString platform_name = QGuiApplication::platformName();
@ -52,4 +52,4 @@ Core::Frontend::EmuWindow::WindowSystemInfo GetWindowSystemInfo(QWindow* window)
return wsi; return wsi;
} }
} // namespace YuzuQtCommon } // namespace QtCommon

View file

@ -6,10 +6,10 @@
#include <QWindow> #include <QWindow>
#include "core/frontend/emu_window.h" #include "core/frontend/emu_window.h"
namespace YuzuQtCommon { namespace QtCommon {
Core::Frontend::WindowSystemType GetWindowSystemType(); Core::Frontend::WindowSystemType GetWindowSystemType();
Core::Frontend::EmuWindow::WindowSystemInfo GetWindowSystemInfo(QWindow* window); Core::Frontend::EmuWindow::WindowSystemInfo GetWindowSystemInfo(QWindow* window);
} // namespace YuzuQtCommon } // namespace QtCommon