Skip to content

Commit

Permalink
FramebufferManager: Don't discard in ReinterpretPixelData
Browse files Browse the repository at this point in the history
This was causing the depth buffer to be discarded as well, which
has an effect on mobiles (doesn't get loaded into tile memory).

If we find this is hindering performance (remember, the EFB is
only a 640x528 texture), it may be worth changing the interface to
support discarding only the colour buffer.
  • Loading branch information
stenzek committed Mar 16, 2019
1 parent 861fc42 commit 8aa0ea1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Source/Core/VideoCommon/FramebufferManager.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -277,9 +277,12 @@ bool FramebufferManager::ReinterpretPixelData(EFBReinterpretType convtype)
return false; return false;


// Draw to the secondary framebuffer. // Draw to the secondary framebuffer.
// We don't discard here because discarding the framebuffer also throws away the depth
// buffer, which we want to preserve. If we find this to be hindering performance in the
// future (e.g. on mobile/tilers), it may be worth discarding only the color buffer.
m_efb_color_texture->FinishedRendering(); m_efb_color_texture->FinishedRendering();
g_renderer->BeginUtilityDrawing(); g_renderer->BeginUtilityDrawing();
g_renderer->SetAndDiscardFramebuffer(m_efb_convert_framebuffer.get()); g_renderer->SetFramebuffer(m_efb_convert_framebuffer.get());
g_renderer->SetViewportAndScissor(m_efb_framebuffer->GetRect()); g_renderer->SetViewportAndScissor(m_efb_framebuffer->GetRect());
g_renderer->SetPipeline(m_format_conversion_pipelines[static_cast<u32>(convtype)].get()); g_renderer->SetPipeline(m_format_conversion_pipelines[static_cast<u32>(convtype)].get());
g_renderer->SetTexture(0, m_efb_color_texture.get()); g_renderer->SetTexture(0, m_efb_color_texture.get());
Expand Down

0 comments on commit 8aa0ea1

Please sign in to comment.