mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 15:31:17 +01:00
Merge pull request #4132 from lioncash/enum-fifo
Fifo: Make SyncGPUReason an enum class
This commit is contained in:
commit
10d20d47aa
@ -238,7 +238,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
|
|||||||
MMIO::DirectRead<u16>(MMIO::Utils::HighPart(&fifo.CPReadWriteDistance)),
|
MMIO::DirectRead<u16>(MMIO::Utils::HighPart(&fifo.CPReadWriteDistance)),
|
||||||
MMIO::ComplexWrite<u16>([](u32, u16 val) {
|
MMIO::ComplexWrite<u16>([](u32, u16 val) {
|
||||||
WriteHigh(fifo.CPReadWriteDistance, val);
|
WriteHigh(fifo.CPReadWriteDistance, val);
|
||||||
Fifo::SyncGPU(Fifo::SYNC_GPU_OTHER);
|
Fifo::SyncGPU(Fifo::SyncGPUReason::Other);
|
||||||
if (fifo.CPReadWriteDistance == 0)
|
if (fifo.CPReadWriteDistance == 0)
|
||||||
{
|
{
|
||||||
GPFifo::ResetGatherPipe();
|
GPFifo::ResetGatherPipe();
|
||||||
|
@ -92,7 +92,7 @@ void PauseAndLock(bool doLock, bool unpauseOnUnlock)
|
|||||||
{
|
{
|
||||||
if (doLock)
|
if (doLock)
|
||||||
{
|
{
|
||||||
SyncGPU(SYNC_GPU_OTHER);
|
SyncGPU(SyncGPUReason::Other);
|
||||||
EmulatorState(false);
|
EmulatorState(false);
|
||||||
FlushGpu();
|
FlushGpu();
|
||||||
}
|
}
|
||||||
@ -199,7 +199,7 @@ void PushFifoAuxBuffer(void* ptr, size_t size)
|
|||||||
{
|
{
|
||||||
if (size > (size_t)(s_fifo_aux_data + FIFO_SIZE - s_fifo_aux_write_ptr))
|
if (size > (size_t)(s_fifo_aux_data + FIFO_SIZE - s_fifo_aux_write_ptr))
|
||||||
{
|
{
|
||||||
SyncGPU(SYNC_GPU_AUX_SPACE, /* may_move_read_ptr */ false);
|
SyncGPU(SyncGPUReason::AuxSpace, /* may_move_read_ptr */ false);
|
||||||
if (!s_gpu_mainloop.IsRunning())
|
if (!s_gpu_mainloop.IsRunning())
|
||||||
{
|
{
|
||||||
// GPU is shutting down
|
// GPU is shutting down
|
||||||
@ -255,7 +255,7 @@ static void ReadDataFromFifoOnCPU(u32 readPtr)
|
|||||||
{
|
{
|
||||||
// We can't wrap around while the GPU is working on the data.
|
// We can't wrap around while the GPU is working on the data.
|
||||||
// This should be very rare due to the reset in SyncGPU.
|
// This should be very rare due to the reset in SyncGPU.
|
||||||
SyncGPU(SYNC_GPU_WRAPAROUND);
|
SyncGPU(SyncGPUReason::Wraparound);
|
||||||
if (!s_gpu_mainloop.IsRunning())
|
if (!s_gpu_mainloop.IsRunning())
|
||||||
{
|
{
|
||||||
// GPU is shutting down, so the next asserts may fail
|
// GPU is shutting down, so the next asserts may fail
|
||||||
|
@ -20,15 +20,15 @@ void UpdateWantDeterminism(bool want);
|
|||||||
bool UseDeterministicGPUThread();
|
bool UseDeterministicGPUThread();
|
||||||
|
|
||||||
// Used for diagnostics.
|
// Used for diagnostics.
|
||||||
enum SyncGPUReason
|
enum class SyncGPUReason
|
||||||
{
|
{
|
||||||
SYNC_GPU_OTHER,
|
Other,
|
||||||
SYNC_GPU_WRAPAROUND,
|
Wraparound,
|
||||||
SYNC_GPU_EFB_POKE,
|
EFBPoke,
|
||||||
SYNC_GPU_PERFQUERY,
|
PerfQuery,
|
||||||
SYNC_GPU_BBOX,
|
BBox,
|
||||||
SYNC_GPU_SWAP,
|
Swap,
|
||||||
SYNC_GPU_AUX_SPACE,
|
AuxSpace,
|
||||||
};
|
};
|
||||||
// In deterministic GPU thread mode this waits for the GPU to be done with pending work.
|
// In deterministic GPU thread mode this waits for the GPU to be done with pending work.
|
||||||
void SyncGPU(SyncGPUReason reason, bool may_move_read_ptr = true);
|
void SyncGPU(SyncGPUReason reason, bool may_move_read_ptr = true);
|
||||||
|
@ -51,7 +51,7 @@ void VideoBackendBase::Video_BeginField(u32 xfbAddr, u32 fbWidth, u32 fbStride,
|
|||||||
{
|
{
|
||||||
if (m_initialized && g_ActiveConfig.bUseXFB && g_renderer)
|
if (m_initialized && g_ActiveConfig.bUseXFB && g_renderer)
|
||||||
{
|
{
|
||||||
Fifo::SyncGPU(Fifo::SYNC_GPU_SWAP);
|
Fifo::SyncGPU(Fifo::SyncGPUReason::Swap);
|
||||||
|
|
||||||
AsyncRequests::Event e;
|
AsyncRequests::Event e;
|
||||||
e.time = 0;
|
e.time = 0;
|
||||||
@ -106,7 +106,7 @@ u32 VideoBackendBase::Video_GetQueryResult(PerfQueryType type)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Fifo::SyncGPU(Fifo::SYNC_GPU_PERFQUERY);
|
Fifo::SyncGPU(Fifo::SyncGPUReason::PerfQuery);
|
||||||
|
|
||||||
AsyncRequests::Event e;
|
AsyncRequests::Event e;
|
||||||
e.time = 0;
|
e.time = 0;
|
||||||
@ -133,7 +133,7 @@ u16 VideoBackendBase::Video_GetBoundingBox(int index)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Fifo::SyncGPU(Fifo::SYNC_GPU_BBOX);
|
Fifo::SyncGPU(Fifo::SyncGPUReason::BBox);
|
||||||
|
|
||||||
AsyncRequests::Event e;
|
AsyncRequests::Event e;
|
||||||
u16 result;
|
u16 result;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user