- add GL debug group for the 2D drawer

- remove pointless opengl calls from effects that are doing nothing
This commit is contained in:
Magnus Norddahl 2018-06-30 15:41:12 +02:00
parent 723b18f2cd
commit ba09af7cbb
2 changed files with 5 additions and 0 deletions

View file

@ -833,6 +833,9 @@ void FGLRenderBuffers::CompileEffectShaders()
void FGLRenderBuffers::RenderEffect(const FString &name) void FGLRenderBuffers::RenderEffect(const FString &name)
{ {
if (hw_postprocess.Effects[name].Size() == 0)
return;
FGLDebug::PushGroup(name.GetChars()); FGLDebug::PushGroup(name.GetChars());
FGLPostProcessState savedState; FGLPostProcessState savedState;

View file

@ -401,6 +401,7 @@ CVAR(Bool, gl_aalines, false, CVAR_ARCHIVE)
void FGLRenderer::Draw2D(F2DDrawer *drawer) void FGLRenderer::Draw2D(F2DDrawer *drawer)
{ {
twoD.Clock(); twoD.Clock();
FGLDebug::PushGroup("Draw2D");
mBuffers->BindCurrentFB(); mBuffers->BindCurrentFB();
const auto &mScreenViewport = screen->mScreenViewport; const auto &mScreenViewport = screen->mScreenViewport;
glViewport(mScreenViewport.left, mScreenViewport.top, mScreenViewport.width, mScreenViewport.height); glViewport(mScreenViewport.left, mScreenViewport.top, mScreenViewport.width, mScreenViewport.height);
@ -543,5 +544,6 @@ void FGLRenderer::Draw2D(F2DDrawer *drawer)
gl_RenderState.ResetColor(); gl_RenderState.ResetColor();
gl_RenderState.Apply(); gl_RenderState.Apply();
delete vb; delete vb;
FGLDebug::PopGroup();
twoD.Unclock(); twoD.Unclock();
} }