- removed DFrameBuffer's locking mechanism.

In its current form this is quite useless. What's really needed is to require a lock on the RenderBuffer for the 3D scene, but since this is not needed for the 2D stuff anymore it can be done far simpler.
This commit is contained in:
Christoph Oelckers 2018-03-27 16:48:33 +02:00
parent c06ad5c59c
commit cff5f0e3c7
12 changed files with 5 additions and 98 deletions

View File

@ -738,22 +738,17 @@ void D_Display ()
}
setmodeneeded = false;
if (screen->Lock (false))
{
V_SetBorderNeedRefresh();
}
V_SetBorderNeedRefresh();
// [RH] Allow temporarily disabling wipes
if (NoWipe)
{
V_SetBorderNeedRefresh();
NoWipe--;
wipe = false;
wipegamestate = gamestate;
}
else if (gamestate != wipegamestate && gamestate != GS_FULLCONSOLE && gamestate != GS_TITLELEVEL)
{ // save the current screen if about to wipe
V_SetBorderNeedRefresh();
switch (wipegamestate)
{
default:
@ -992,7 +987,6 @@ void D_Display ()
void D_ErrorCleanup ()
{
savegamerestore = false;
screen->Unlock ();
bglobal.RemoveAllBots (true);
D_QuitNetGame ();
if (demorecording || demoplayback)

View File

@ -178,7 +178,6 @@ void OpenGLFrameBuffer::Update()
GLRenderer->Flush();
Swap();
Unlock();
CheckBench();
int initialWidth = IsFullscreen() ? VideoWidth : GetClientWidth();

View File

@ -1115,6 +1115,7 @@ int OpenGLSWFrameBuffer::GetPageCount()
//
//==========================================================================
#if 0
bool OpenGLSWFrameBuffer::Lock(bool buffered)
{
if (m_Lock++ > 0)
@ -1181,6 +1182,7 @@ void OpenGLSWFrameBuffer::Unlock()
}
}
}
#endif
//==========================================================================
//

View File

@ -33,8 +33,6 @@ public:
~OpenGLSWFrameBuffer();
virtual DCanvas *GetCanvas() { return RenderBuffer; }
bool Lock(bool buffered) override;
void Unlock() override;
void Update() override;
PalEntry *GetPalette() override;
void GetFlashedPalette(PalEntry palette[256]) override;

View File

@ -187,7 +187,6 @@ void OpenGLFrameBuffer::WipeEndScreen()
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
Unlock();
}
//==========================================================================
@ -208,8 +207,6 @@ bool OpenGLFrameBuffer::WipeDo(int ticks)
// Sanity checks.
if (wipestartscreen != nullptr && wipeendscreen != nullptr)
{
Lock(true);
gl_RenderState.EnableTexture(true);
gl_RenderState.EnableFog(false);
glDisable(GL_DEPTH_TEST);

View File

@ -374,9 +374,7 @@ namespace swrenderer
R_ExecuteSetViewSize(MainThread()->Viewport->viewpoint, MainThread()->Viewport->viewwindow);
float trueratio;
ActiveRatio(width, height, &trueratio);
screen->Lock(true);
viewport->SetViewport(MainThread(), width, height, trueratio);
screen->Unlock();
viewactive = savedviewactive;
}
@ -389,9 +387,7 @@ namespace swrenderer
int height = SCREENHEIGHT;
float trueratio;
ActiveRatio(width, height, &trueratio);
screen->Lock(true);
viewport->SetViewport(MainThread(), SCREENWIDTH, SCREENHEIGHT, trueratio);
screen->Unlock();
}
void RenderScene::Init()

View File

@ -108,8 +108,6 @@ public:
Height = height;
}
// These methods should never be called.
bool Lock(bool buffered) { DBGBREAK; return false; }
void Unlock() { DBGBREAK; }
void Update() { DBGBREAK; }
PalEntry *GetPalette() { DBGBREAK; return NULL; }
void GetFlashedPalette(PalEntry palette[256]) { DBGBREAK; }

View File

@ -296,8 +296,8 @@ public:
// Access control
virtual bool IsValid() = delete;
virtual bool Lock(bool buffered = true) = 0; // Returns true if the surface was lost since last time
virtual void Unlock() = 0;
virtual bool Lock(bool buffered = true) = delete; // Returns true if the surface was lost since last time
virtual void Unlock() = delete;
// Make the surface visible. Also implies Unlock().
virtual void Update () = 0;

View File

@ -913,53 +913,6 @@ bool D3DFB::IsFullscreen ()
return !Windowed;
}
//==========================================================================
//
// D3DFB :: Lock
//
//==========================================================================
bool D3DFB::Lock (bool buffered)
{
if (LockCount++ > 0)
{
return false;
}
assert (!In2D);
Accel2D = vid_hw2d;
#if 0
Buffer = MemBuffer;
#endif
return false;
}
//==========================================================================
//
// D3DFB :: Unlock
//
//==========================================================================
void D3DFB::Unlock ()
{
LOG1 ("Unlock <%d>\n", LockCount);
if (LockCount == 0)
{
return;
}
if (UpdatePending && LockCount == 1)
{
Update ();
}
else if (--LockCount == 0)
{
#if 0
Buffer = NULL;
#endif
}
}
//==========================================================================
//
// D3DFB :: Update

View File

@ -1166,29 +1166,6 @@ void Win32GLFrameBuffer::SetGammaTable(uint16_t *tbl)
//
//==========================================================================
bool Win32GLFrameBuffer::Lock(bool buffered)
{
m_Lock++;
//Buffer = MemBuffer;
return true;
}
bool Win32GLFrameBuffer::Lock ()
{
return Lock(false);
}
void Win32GLFrameBuffer::Unlock ()
{
m_Lock--;
}
//==========================================================================
//
//
//
//==========================================================================
bool Win32GLFrameBuffer::IsFullscreen()
{
return m_Fullscreen;

View File

@ -54,10 +54,6 @@ public:
int GetTrueHeight();
bool Lock(bool buffered);
bool Lock ();
void Unlock();
bool IsFullscreen();

View File

@ -28,9 +28,6 @@ public:
~D3DFB ();
virtual DCanvas *GetCanvas() { return RenderBuffer; }
bool Lock (bool buffered);
void Unlock ();
void Update ();
void Flip ();
PalEntry *GetPalette ();