Compare commits

..

1 Commits

Author SHA1 Message Date
xbzk 427a59a272 [video_core] buffer cache readback for nce invalidations 2026-09-26 20:20:47 -03:00
10 changed files with 60 additions and 20 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ static std::mutex vector_regions_mutex {};
// Workaround for handling non-commited memory accessed by Dynarmic; usually result of an error
static LONG WINAPI FakePageFaultHandler(PEXCEPTION_POINTERS info) {
DWORD code = info->ExceptionRecord->ExceptionCode;
u64 exception_addr = u64(info->ExceptionRecord->ExceptionInformation[1]);
u64 exception_addr = reinterpret_cast<u64>(info->ExceptionRecord->ExceptionInformation[1]);
if (code != EXCEPTION_ACCESS_VIOLATION || info->ExceptionRecord->ExceptionInformation[0] == 1) {
// Not our problem
+1 -1
View File
@@ -94,7 +94,7 @@ LaunchParams ParseLaunchParams(Core::System& system, int argc, char *argv[], wch
break;
case 'u': {
// Launch game with a specific user
bool argument_ok = bool(isdigit(optarg[0]));
bool argument_ok = isdigit(optarg[0]);
p.selected_user = atoi(optarg);
if (!argument_ok) {
// try to look it up by username, only finds the first username that matches.
+1 -1
View File
@@ -757,7 +757,7 @@ struct Memory::Impl {
};
auto& gpu = system.GPU();
gpu_device_memory->ApplyOpOnPointer(
p, scratch_buffers[core], [&](DAddr address) { gpu.InvalidateRegion(address, size); });
p, scratch_buffers[core], [&](DAddr address) { gpu.InvalidateRegion(address, size, true); });
}
Core::System& system;
@@ -406,8 +406,10 @@ int RegAlloc::RealizeReadWriteImpl(const IR::Value& read_value, const IR::Inst*
} else if constexpr (kind == HostLoc::Kind::Fpr) {
LoadCopyInto(read_value, oaknut::QReg{write_loc});
return write_loc;
} else if constexpr (kind == HostLoc::Kind::Flags) {
ASSERT(false && "Incorrect function for ReadWrite of flags");
} else {
UNREACHABLE(); // kind == HostLoc::Kind::Flags
UNREACHABLE();
}
}
+36 -3
View File
@@ -72,6 +72,40 @@ void Block::Reset(LocationDescriptor location_) noexcept {
ASSERT(instructions.size() == 0);
}
static std::string TerminalToString(const Term::Terminal& terminal_variant) noexcept {
// struct : boost::static_visitor<std::string> {
// std::string operator()(const std::monostate&) const {
// return "<invalid>";
// }
// std::string operator()(const Term::ReturnToDispatch&) const {
// return "ReturnToDispatch{}";
// }
// std::string operator()(const Term::LinkBlock& terminal) const {
// return fmt::format("LinkBlock{{{}}}", terminal.next);
// }
// std::string operator()(const Term::LinkBlockFast& terminal) const {
// return fmt::format("LinkBlockFast{{{}}}", terminal.next);
// }
// std::string operator()(const Term::PopRSBHint&) const {
// return "PopRSBHint{}";
// }
// std::string operator()(const Term::FastDispatchHint&) const {
// return "FastDispatchHint{}";
// }
// std::string operator()(const Term::If& terminal) const {
// return fmt::format("If{{{}, {}, {}}}", A64::CondToString(terminal.if_), TerminalToString(terminal.then_), TerminalToString(terminal.else_));
// }
// std::string operator()(const Term::CheckBit& terminal) const {
// return fmt::format("CheckBit{{{}, {}}}", TerminalToString(terminal.then_), TerminalToString(terminal.else_));
// }
// std::string operator()(const Term::CheckHalt& terminal) const {
// return fmt::format("CheckHalt{{{}}}", TerminalToString(terminal.else_));
// }
// } visitor;
// return boost::apply_visitor(visitor, terminal_variant);
return "";
}
std::string DumpBlock(const IR::Block& block) noexcept {
std::string ret = fmt::format("Block: location={}-{}\n", block.Location(), block.EndLocation())
+ fmt::format("cycles={}", block.CycleCount())
@@ -140,9 +174,8 @@ std::string DumpBlock(const IR::Block& block) noexcept {
ret += fmt::format(" (uses: {})", inst.UseCount()) + '\n';
}
return ret + "terminal = " + [](const Term::Terminal&) -> std::string {
return "";
}(block.GetTerminal()) + '\n';
ret += "terminal = " + TerminalToString(block.GetTerminal()) + '\n';
return ret;
}
} // namespace Dynarmic::IR
+1 -3
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 2023 yuzu Emulator Project
@@ -6,8 +6,6 @@
#pragma once
#include <cstddef>
#include <vector>
#include "common/bit_field.h"
#include "common/common_funcs.h"
#include "common/common_types.h"
+13 -3
View File
@@ -226,7 +226,17 @@ struct GPU::Impl {
}
/// Notify rasterizer that any caches of the specified region should be invalidated
void InvalidateRegion(DAddr addr, u64 size) {
void InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes) {
VideoCore::RasterizerInterface* rasterizer = renderer->ReadRasterizer();
if (preserve_gpu_writes && rasterizer->MustFlushRegion(addr, size, VideoCommon::CacheType::BufferCache)) {
const u64 fence = RequestSyncOperation([rasterizer, addr, size] {
rasterizer->FlushRegion(addr, size, VideoCommon::CacheType::BufferCache);
rasterizer->OnCacheInvalidation(addr, size);
});
gpu_thread.TickGPU(is_async);
WaitForSyncOperation(fence);
return;
}
gpu_thread.InvalidateRegion(addr, size);
}
@@ -518,8 +528,8 @@ void GPU::FlushRegion(DAddr addr, u64 size) {
impl->FlushRegion(addr, size);
}
void GPU::InvalidateRegion(DAddr addr, u64 size) {
impl->InvalidateRegion(addr, size);
void GPU::InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes) {
impl->InvalidateRegion(addr, size, preserve_gpu_writes);
}
bool GPU::OnCPUWrite(DAddr addr, u64 size) {
+1 -1
View File
@@ -248,7 +248,7 @@ public:
void FlushRegion(DAddr addr, u64 size);
/// Notify rasterizer that any caches of the specified region should be invalidated
void InvalidateRegion(DAddr addr, u64 size);
void InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes = false);
/// Notify rasterizer that CPU is trying to write this area. It returns true if the area is
/// sensible, false otherwise, addr and size must be a valid combination
+2 -6
View File
@@ -209,6 +209,8 @@ add_executable(yuzu
util/overlay_dialog.ui
util/sequence_dialog/sequence_dialog.cpp
util/sequence_dialog/sequence_dialog.h
util/url_request_interceptor.cpp
util/url_request_interceptor.h
util/util.cpp
util/util.h
@@ -239,12 +241,6 @@ add_executable(yuzu
set_target_properties(yuzu PROPERTIES OUTPUT_NAME "eden")
if (YUZU_USE_QT_WEB_ENGINE)
target_sources(yuzu PRIVATE
util/url_request_interceptor.cpp
util/url_request_interceptor.h)
endif()
if (YUZU_CRASH_DUMPS)
target_sources(yuzu PRIVATE
breakpad.cpp
+1
View File
@@ -232,6 +232,7 @@
<property name="title">
<string>&amp;Help</string>
</property>
<addaction name="action_Report_Compatibility"/>
<addaction name="action_Open_Mods_Page"/>
<addaction name="action_Open_UserHandbook"/>
<addaction name="separator"/>