Compare commits

..

1 Commits

Author SHA1 Message Date
lizzie 9b5cdd0b59 [deps] replace zlib with zlib-ng
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2026-07-03 17:49:46 +00:00
5 changed files with 31 additions and 29 deletions
+2 -3
View File
@@ -460,9 +460,8 @@ AddJsonPackage(nlohmann)
if (NOT YUZU_STATIC_ROOM)
# zlib
AddJsonPackage(zlib)
if (ZLIB_ADDED)
add_library(ZLIB::ZLIB ALIAS zlibstatic)
if (NOT TARGET ZLIB::ZLIB)
add_library(ZLIB::ZLIB ALIAS zlib-ng)
endif()
# Opus
+7 -7
View File
@@ -378,16 +378,16 @@
"version": "7.35.2"
},
"zlib": {
"hash": "16fea4df307a68cf0035858abe2fd550250618a97590e202037acd18a666f57afc10f8836cbbd472d54a0e76539d0e558cb26f059d53de52ff90634bbf4f47d4",
"min_version": "1.2",
"hash": "e2057c764f1d5aaee738edee7e977182c5b097e3c95489dcd8de813f237d92a05daaa86d68d44b331d9fec5d1802586a8f6cfb658ba849874aaa14e72a8107f5",
"options": [
"ZLIB_BUILD_SHARED OFF",
"ZLIB_INSTALL OFF"
"ZLIB_COMPAT ON",
"ZLIB_ALIASES ON",
"BUILD_SHARED_LIBS OFF"
],
"package": "ZLIB",
"repo": "madler/zlib",
"tag": "v%VERSION%",
"version": "1.3.2"
"repo": "zlib-ng/zlib-ng",
"tag": "%VERSION%",
"version": "2.3.3"
},
"zstd": {
"find_args": "MODULE",
+2 -1
View File
@@ -162,7 +162,8 @@ bool ArmNce::HandleGuestAccessFault(GuestContext* guest_ctx, void* raw_info, voi
// Try to handle an invalid access.
// TODO: handle accesses which split a page?
const Common::ProcessAddress addr = u64(info->si_addr) & ~Memory::YUZU_PAGEMASK;
const Common::ProcessAddress addr =
(reinterpret_cast<u64>(info->si_addr) & ~Memory::YUZU_PAGEMASK);
auto& memory = guest_ctx->parent->m_running_thread->GetOwnerProcess()->GetMemory();
if (memory.InvalidateNCE(addr, Memory::YUZU_PAGESIZE)) {
// We handled the access successfully and are returning to guest code.
+19 -17
View File
@@ -737,9 +737,10 @@ struct Memory::Impl {
PAddr last_address;
};
void InvalidateGPUMemory(u8* p, size_t size, bool flush) {
void InvalidateGPUMemory(u8* p, size_t size) {
constexpr size_t sys_core = Core::Hardware::NUM_CPU_CORES - 1;
const size_t core = (std::min)(system.GetCurrentHostThreadID(), sys_core); // any other calls threads go to syscore.
const size_t core = (std::min)(system.GetCurrentHostThreadID(),
sys_core); // any other calls threads go to syscore.
if (!gpu_device_memory) [[unlikely]] {
gpu_device_memory = &system.Host1x().MemoryManager();
}
@@ -753,12 +754,8 @@ struct Memory::Impl {
}
};
auto& gpu = system.GPU();
gpu_device_memory->ApplyOpOnPointer(p, scratch_buffers[core], [&](DAddr addr) {
if (flush) {
void(gpu.OnCPURead(addr, size));
}
gpu.InvalidateRegion(addr, size);
});
gpu_device_memory->ApplyOpOnPointer(
p, scratch_buffers[core], [&](DAddr address) { gpu.InvalidateRegion(address, size); });
}
Core::System& system;
@@ -962,22 +959,27 @@ void Memory::MarkRegionDebug(Common::ProcessAddress vaddr, u64 size, bool debug)
}
bool Memory::InvalidateNCE(Common::ProcessAddress vaddr, size_t size) {
bool mapped = true;
bool rasterizer = false;
u8* const ptr = impl->GetPointerImpl(GetInteger(vaddr), [&] {
LOG_ERROR(HW_Memory, "Unmapped InvalidateNCE for {} bytes @ {:#x}", size, GetInteger(vaddr));
mapped = false;
}, [&] {
rasterizer = true;
});
[[maybe_unused]] bool mapped = true;
[[maybe_unused]] bool rasterizer = false;
u8* const ptr = impl->GetPointerImpl(
GetInteger(vaddr),
[&] {
LOG_ERROR(HW_Memory, "Unmapped InvalidateNCE for {} bytes @ {:#x}", size,
GetInteger(vaddr));
mapped = false;
},
[&] { rasterizer = true; });
if (rasterizer) {
impl->InvalidateGPUMemory(ptr, size, true);
impl->InvalidateGPUMemory(ptr, size);
}
#ifdef __ANDROID__
if (!rasterizer && mapped) {
impl->host_buffer->DeferredMapSeparateHeap(GetInteger(vaddr));
}
#endif
return mapped && ptr != nullptr;
}
+1 -1
View File
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project