GL: Eliminiate most redundant state setting calls at draw time

This commit is contained in:
Connor McLaughlin
2019-10-04 22:10:43 +10:00
parent 8987fa93c2
commit 4fa79f1503
7 changed files with 118 additions and 52 deletions

View File

@ -388,8 +388,9 @@ bool SDLInterface::PassEventToImGui(const SDL_Event* event)
void SDLInterface::Render()
{
m_system->GetGPU()->ResetGraphicsAPIState();
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glDisable(GL_SCISSOR_TEST);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);
@ -405,6 +406,9 @@ void SDLInterface::Render()
ImGui_ImplOpenGL3_NewFrame();
ImGui::NewFrame();
GL::Program::ResetLastProgram();
m_system->GetGPU()->RestoreGraphicsAPIState();
}
static std::tuple<int, int, int, int> CalculateDrawRect(int window_width, int window_height, float display_ratio)