give texture cache exception handler priority over tls exception handler

This commit is contained in:
georgemoralis 2024-04-29 19:26:35 +03:00
parent 25c04ad42f
commit 0727775c88
1 changed files with 6 additions and 7 deletions

View File

@ -48,9 +48,9 @@ LONG WINAPI GuestFaultSignalHandler(EXCEPTION_POINTERS* pExp) noexcept {
if (info[0] == 1) { // Write violation if (info[0] == 1) { // Write violation
g_texture_cache->OnCpuWrite(info[1]); g_texture_cache->OnCpuWrite(info[1]);
return EXCEPTION_CONTINUE_EXECUTION; return EXCEPTION_CONTINUE_EXECUTION;
} else { } /* else {
UNREACHABLE(); UNREACHABLE();
} }*/
} }
return EXCEPTION_CONTINUE_SEARCH; // pass further return EXCEPTION_CONTINUE_SEARCH; // pass further
} }
@ -59,9 +59,8 @@ LONG WINAPI GuestFaultSignalHandler(EXCEPTION_POINTERS* pExp) noexcept {
static constexpr u64 StreamBufferSize = 128_MB; static constexpr u64 StreamBufferSize = 128_MB;
TextureCache::TextureCache(const Vulkan::Instance& instance_, Vulkan::Scheduler& scheduler_) TextureCache::TextureCache(const Vulkan::Instance& instance_, Vulkan::Scheduler& scheduler_)
: instance{instance_}, scheduler{scheduler_}, staging{instance, scheduler, : instance{instance_}, scheduler{scheduler_},
vk::BufferUsageFlagBits::eTransferSrc, staging{instance, scheduler, vk::BufferUsageFlagBits::eTransferSrc, StreamBufferSize,
StreamBufferSize,
Vulkan::BufferType::Upload} { Vulkan::BufferType::Upload} {
#ifndef _WIN64 #ifndef _WIN64
@ -77,7 +76,7 @@ TextureCache::TextureCache(const Vulkan::Instance& instance_, Vulkan::Scheduler&
guest_access_fault.sa_mask = signal_mask; guest_access_fault.sa_mask = signal_mask;
sigaction(SIGSEGV, &guest_access_fault, nullptr); sigaction(SIGSEGV, &guest_access_fault, nullptr);
#else #else
veh_handle = AddVectoredExceptionHandler(0, GuestFaultSignalHandler); veh_handle = AddVectoredExceptionHandler(1, GuestFaultSignalHandler);
ASSERT_MSG(veh_handle, "Failed to register an exception handler"); ASSERT_MSG(veh_handle, "Failed to register an exception handler");
#endif #endif
g_texture_cache = this; g_texture_cache = this;