mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 13:27:41 -07:00
Revert "Lock the GPU3D state when rendering on the render thread or serializing it"
This reverts commit 2f49a551c1
.
This commit is contained in:
parent
2f49a551c1
commit
1977566a6d
@ -275,7 +275,6 @@ u32 RenderNumPolygons;
|
|||||||
u32 FlushRequest;
|
u32 FlushRequest;
|
||||||
u32 FlushAttributes;
|
u32 FlushAttributes;
|
||||||
|
|
||||||
Platform::Mutex* StateLock;
|
|
||||||
std::unique_ptr<GPU3D::Renderer3D> CurrentRenderer = {};
|
std::unique_ptr<GPU3D::Renderer3D> CurrentRenderer = {};
|
||||||
|
|
||||||
bool AbortFrame;
|
bool AbortFrame;
|
||||||
@ -295,22 +294,12 @@ void Vertex::DoSavestate(Savestate* file) noexcept
|
|||||||
|
|
||||||
bool Init()
|
bool Init()
|
||||||
{
|
{
|
||||||
if (StateLock)
|
|
||||||
{
|
|
||||||
Platform::Mutex_Free(StateLock);
|
|
||||||
}
|
|
||||||
StateLock = Platform::Mutex_Create();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeInit()
|
void DeInit()
|
||||||
{
|
{
|
||||||
CurrentRenderer = nullptr;
|
CurrentRenderer = nullptr;
|
||||||
if (StateLock)
|
|
||||||
{
|
|
||||||
Platform::Mutex_Free(StateLock);
|
|
||||||
StateLock = nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetRenderingState()
|
void ResetRenderingState()
|
||||||
@ -421,7 +410,6 @@ void DoSavestate(Savestate* file)
|
|||||||
if (softRenderer && softRenderer->IsThreaded())
|
if (softRenderer && softRenderer->IsThreaded())
|
||||||
{
|
{
|
||||||
softRenderer->SetupRenderThread();
|
softRenderer->SetupRenderThread();
|
||||||
Platform::Mutex_Lock(StateLock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CmdFIFO.DoSavestate(file);
|
CmdFIFO.DoSavestate(file);
|
||||||
@ -655,7 +643,6 @@ void DoSavestate(Savestate* file)
|
|||||||
file->Var32(&TexPalette);
|
file->Var32(&TexPalette);
|
||||||
if (softRenderer && softRenderer->IsThreaded())
|
if (softRenderer && softRenderer->IsThreaded())
|
||||||
{
|
{
|
||||||
Platform::Mutex_Unlock(StateLock);
|
|
||||||
softRenderer->EnableRenderThread();
|
softRenderer->EnableRenderThread();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1736,7 +1736,6 @@ void SoftRenderer::RestartFrame()
|
|||||||
EnableRenderThread();
|
EnableRenderThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern Platform::Mutex* StateLock;
|
|
||||||
void SoftRenderer::RenderThreadFunc()
|
void SoftRenderer::RenderThreadFunc()
|
||||||
{
|
{
|
||||||
for (;;)
|
for (;;)
|
||||||
@ -1751,10 +1750,8 @@ void SoftRenderer::RenderThreadFunc()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Platform::Mutex_Lock(StateLock);
|
|
||||||
ClearBuffers();
|
ClearBuffers();
|
||||||
RenderPolygons(true, &RenderPolygonRAM[0], RenderNumPolygons);
|
RenderPolygons(true, &RenderPolygonRAM[0], RenderNumPolygons);
|
||||||
Platform::Mutex_Unlock(StateLock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Platform::Semaphore_Post(Sema_RenderDone);
|
Platform::Semaphore_Post(Sema_RenderDone);
|
||||||
|
Loading…
Reference in New Issue
Block a user