mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-12-03 01:12:23 +00:00
- make gl_finishbeforeswap more useful by handling the case where it causes stalls on NVidia.
This commit is contained in:
parent
ad2993950a
commit
c5d75c18b4
2 changed files with 8 additions and 3 deletions
|
@ -91,6 +91,7 @@ extern bool r_showviewer;
|
||||||
DWORD gl_fixedcolormap;
|
DWORD gl_fixedcolormap;
|
||||||
area_t in_area;
|
area_t in_area;
|
||||||
TArray<BYTE> currentmapsection;
|
TArray<BYTE> currentmapsection;
|
||||||
|
int camtexcount;
|
||||||
|
|
||||||
void gl_ParseDefs();
|
void gl_ParseDefs();
|
||||||
|
|
||||||
|
@ -1356,6 +1357,7 @@ void FGLInterface::RenderTextureView (FCanvasTexture *tex, AActor *Viewpoint, in
|
||||||
}
|
}
|
||||||
|
|
||||||
tex->SetUpdated();
|
tex->SetUpdated();
|
||||||
|
camtexcount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -207,22 +207,25 @@ void OpenGLFrameBuffer::Update()
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
CVAR(Bool, gl_finishbeforeswap, false, 0);
|
CVAR(Bool, gl_finishbeforeswap, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
|
||||||
|
extern int camtexcount;
|
||||||
|
|
||||||
void OpenGLFrameBuffer::Swap()
|
void OpenGLFrameBuffer::Swap()
|
||||||
{
|
{
|
||||||
|
bool swapbefore = gl_finishbeforeswap && camtexcount == 0;
|
||||||
Finish.Reset();
|
Finish.Reset();
|
||||||
Finish.Clock();
|
Finish.Clock();
|
||||||
if (gl_finishbeforeswap) glFinish();
|
if (swapbefore) glFinish();
|
||||||
if (needsetgamma)
|
if (needsetgamma)
|
||||||
{
|
{
|
||||||
//DoSetGamma();
|
//DoSetGamma();
|
||||||
needsetgamma = false;
|
needsetgamma = false;
|
||||||
}
|
}
|
||||||
SwapBuffers();
|
SwapBuffers();
|
||||||
if (!gl_finishbeforeswap) glFinish();
|
if (!swapbefore) glFinish();
|
||||||
Finish.Unclock();
|
Finish.Unclock();
|
||||||
swapped = true;
|
swapped = true;
|
||||||
|
camtexcount = 0;
|
||||||
FHardwareTexture::UnbindAll();
|
FHardwareTexture::UnbindAll();
|
||||||
mDebug->Update();
|
mDebug->Update();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue