mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
OGL: Invalidate tracked state when calling ResetAPIState()
Due to the current design, any of the GL state can be mutated after calling this function, so we can't assume that the tracked state will match if we call SetPipeline() after ResetAPIState().
This commit is contained in:
@ -357,7 +357,10 @@ Renderer::Renderer(std::unique_ptr<GLContext> main_gl_context)
|
||||
: ::Renderer(static_cast<int>(std::max(main_gl_context->GetBackBufferWidth(), 1u)),
|
||||
static_cast<int>(std::max(main_gl_context->GetBackBufferHeight(), 1u)),
|
||||
AbstractTextureFormat::RGBA8),
|
||||
m_main_gl_context(std::move(main_gl_context))
|
||||
m_main_gl_context(std::move(main_gl_context)),
|
||||
m_current_rasterization_state(RenderState::GetInvalidRasterizationState()),
|
||||
m_current_depth_state(RenderState::GetInvalidDepthState()),
|
||||
m_current_blend_state(RenderState::GetInvalidBlendingState())
|
||||
{
|
||||
bool bSuccess = true;
|
||||
|
||||
@ -1585,6 +1588,9 @@ void Renderer::ResetAPIState()
|
||||
}
|
||||
glDepthMask(GL_FALSE);
|
||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
m_current_rasterization_state = RenderState::GetInvalidRasterizationState();
|
||||
m_current_depth_state = RenderState::GetInvalidDepthState();
|
||||
m_current_blend_state = RenderState::GetInvalidBlendingState();
|
||||
}
|
||||
|
||||
void Renderer::RestoreAPIState()
|
||||
@ -1603,10 +1609,6 @@ void Renderer::RestoreAPIState()
|
||||
}
|
||||
BPFunctions::SetScissor();
|
||||
BPFunctions::SetViewport();
|
||||
|
||||
ApplyRasterizationState(m_current_rasterization_state, true);
|
||||
ApplyDepthState(m_current_depth_state, true);
|
||||
ApplyBlendingState(m_current_blend_state, true);
|
||||
}
|
||||
|
||||
void Renderer::ApplyRasterizationState(const RasterizationState state, bool force)
|
||||
|
Reference in New Issue
Block a user