ogl: reset api state for blitting

glBlitFramebuffer depends on scissior test and color mask. It isn't documented well,
but it does. So we have to reset the apistate before using it.
In this way, there isn't any benefit of glBlitFramebuffer, glDrawArray would be better :-(
This commit is contained in:
degasus 2013-08-26 22:18:00 +02:00
parent 15df7b3445
commit 93f9f23576
2 changed files with 12 additions and 0 deletions

View File

@ -435,6 +435,8 @@ void XFBSource::DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight)
void XFBSource::CopyEFB(float Gamma)
{
g_renderer->ResetAPIState();
// Copy EFB data to XFB and restore render target again
glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetEFBFramebuffer());
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, FramebufferManager::GetXFBFramebuffer());
@ -451,6 +453,8 @@ void XFBSource::CopyEFB(float Gamma)
// Return to EFB.
FramebufferManager::SetFramebuffer(0);
g_renderer->RestoreAPIState();
}

View File

@ -958,9 +958,13 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
{
if (s_MSAASamples > 1)
{
g_renderer->ResetAPIState();
// Resolve our rectangle.
FramebufferManager::GetEFBDepthTexture(efbPixelRc);
glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetResolvedFramebuffer());
g_renderer->RestoreAPIState();
}
u32* depthMap = new u32[targetPixelRcWidth * targetPixelRcHeight];
@ -1007,9 +1011,13 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
{
if (s_MSAASamples > 1)
{
g_renderer->ResetAPIState();
// Resolve our rectangle.
FramebufferManager::GetEFBColorTexture(efbPixelRc);
glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetResolvedFramebuffer());
g_renderer->RestoreAPIState();
}
u32* colorMap = new u32[targetPixelRcWidth * targetPixelRcHeight];