mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-06 11:57:09 +02:00
VideoCommon: Create AsyncRequests directly in MMU code to eliminate EFB-related functions in VideoBackendBase.
This commit is contained in:
parent
63b848ca93
commit
6c158ed590
@ -47,7 +47,9 @@
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#include "VideoCommon/VideoBackendBase.h"
|
||||
#include "VideoCommon/AsyncRequests.h"
|
||||
#include "VideoCommon/EFBInterface.h"
|
||||
#include "VideoCommon/Statistics.h"
|
||||
|
||||
namespace PowerPC
|
||||
{
|
||||
@ -109,12 +111,18 @@ static u32 EFB_Read(const u32 addr)
|
||||
}
|
||||
else if (addr & 0x00400000)
|
||||
{
|
||||
var = g_video_backend->Video_PeekEFBDepth(x, y);
|
||||
var = AsyncRequests::GetInstance()->PushBlockingEvent([&] {
|
||||
INCSTAT(g_stats.this_frame.num_efb_peeks);
|
||||
return g_efb_interface->PeekDepth(x, y);
|
||||
});
|
||||
DEBUG_LOG_FMT(MEMMAP, "EFB Z Read @ {}, {}\t= {:#010x}", x, y, var);
|
||||
}
|
||||
else
|
||||
{
|
||||
var = g_video_backend->Video_PeekEFBColor(x, y);
|
||||
var = AsyncRequests::GetInstance()->PushBlockingEvent([&] {
|
||||
INCSTAT(g_stats.this_frame.num_efb_peeks);
|
||||
return g_efb_interface->PeekColor(x, y);
|
||||
});
|
||||
DEBUG_LOG_FMT(MEMMAP, "EFB Color Read @ {}, {}\t= {:#010x}", x, y, var);
|
||||
}
|
||||
|
||||
@ -134,12 +142,18 @@ static void EFB_Write(u32 data, u32 addr)
|
||||
}
|
||||
else if (addr & 0x00400000)
|
||||
{
|
||||
g_video_backend->Video_PokeEFBDepth(x, y, data);
|
||||
AsyncRequests::GetInstance()->PushEvent([x, y, data] {
|
||||
INCSTAT(g_stats.this_frame.num_efb_pokes);
|
||||
g_efb_interface->PokeDepth(x, y, data);
|
||||
});
|
||||
DEBUG_LOG_FMT(MEMMAP, "EFB Z Write {:08x} @ {}, {}", data, x, y);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_video_backend->Video_PokeEFBColor(x, y, data);
|
||||
AsyncRequests::GetInstance()->PushEvent([x, y, data] {
|
||||
INCSTAT(g_stats.this_frame.num_efb_pokes);
|
||||
g_efb_interface->PokeColor(x, y, data);
|
||||
});
|
||||
DEBUG_LOG_FMT(MEMMAP, "EFB Color Write {:08x} @ {}, {}", data, x, y);
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "Core/CoreTiming.h"
|
||||
#include "Core/DolphinAnalytics.h"
|
||||
#include "Core/System.h"
|
||||
#include "VideoCommon/Statistics.h"
|
||||
|
||||
// TODO: ugly
|
||||
#ifdef _WIN32
|
||||
@ -105,38 +104,6 @@ void VideoBackendBase::Video_OutputXFB(u32 xfb_addr, u32 fb_width, u32 fb_stride
|
||||
}
|
||||
}
|
||||
|
||||
void VideoBackendBase::Video_PokeEFBColor(u32 x, u32 y, u32 data)
|
||||
{
|
||||
AsyncRequests::GetInstance()->PushEvent([x, y, data] {
|
||||
INCSTAT(g_stats.this_frame.num_efb_pokes);
|
||||
g_efb_interface->PokeColor(x, y, data);
|
||||
});
|
||||
}
|
||||
|
||||
void VideoBackendBase::Video_PokeEFBDepth(u32 x, u32 y, u32 data)
|
||||
{
|
||||
AsyncRequests::GetInstance()->PushEvent([x, y, data] {
|
||||
INCSTAT(g_stats.this_frame.num_efb_pokes);
|
||||
g_efb_interface->PokeDepth(x, y, data);
|
||||
});
|
||||
}
|
||||
|
||||
u32 VideoBackendBase::Video_PeekEFBColor(u32 x, u32 y)
|
||||
{
|
||||
return AsyncRequests::GetInstance()->PushBlockingEvent([&] {
|
||||
INCSTAT(g_stats.this_frame.num_efb_peeks);
|
||||
return g_efb_interface->PeekColor(x, y);
|
||||
});
|
||||
}
|
||||
|
||||
u32 VideoBackendBase::Video_PeekEFBDepth(u32 x, u32 y)
|
||||
{
|
||||
return AsyncRequests::GetInstance()->PushBlockingEvent([&] {
|
||||
INCSTAT(g_stats.this_frame.num_efb_peeks);
|
||||
return g_efb_interface->PeekDepth(x, y);
|
||||
});
|
||||
}
|
||||
|
||||
u32 VideoBackendBase::Video_GetQueryResult(PerfQueryType type)
|
||||
{
|
||||
if (!g_perf_query->ShouldEmulate())
|
||||
|
@ -50,12 +50,6 @@ public:
|
||||
|
||||
void Video_OutputXFB(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height, u64 ticks);
|
||||
|
||||
void Video_PokeEFBColor(u32 x, u32 y, u32 data);
|
||||
void Video_PokeEFBDepth(u32 x, u32 y, u32 data);
|
||||
|
||||
u32 Video_PeekEFBColor(u32 x, u32 y);
|
||||
u32 Video_PeekEFBDepth(u32 x, u32 y);
|
||||
|
||||
u32 Video_GetQueryResult(PerfQueryType type);
|
||||
u16 Video_GetBoundingBox(int index);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user