Skip to content

Commit

Permalink
FramebufferManager: Fix invalid transitions for 1xIR in EFB cache
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Apr 28, 2019
1 parent 5399995 commit 53af27b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 1 addition & 6 deletions Source/Core/VideoCommon/FramebufferManager.cpp
Expand Up @@ -223,10 +223,7 @@ AbstractTexture* FramebufferManager::ResolveEFBColorTexture(const MathUtil::Rect
{
// Return the normal EFB texture if multisampling is off.
if (!IsEFBMultisampled())
{
m_efb_color_texture->FinishedRendering();
return m_efb_color_texture.get();
}

// It's not valid to resolve an out-of-range rectangle.
MathUtil::Rectangle<int> clamped_region = region;
Expand All @@ -246,10 +243,7 @@ AbstractTexture* FramebufferManager::ResolveEFBColorTexture(const MathUtil::Rect
AbstractTexture* FramebufferManager::ResolveEFBDepthTexture(const MathUtil::Rectangle<int>& region)
{
if (!IsEFBMultisampled())
{
m_efb_depth_texture->FinishedRendering();
return m_efb_depth_texture.get();
}

// It's not valid to resolve an out-of-range rectangle.
MathUtil::Rectangle<int> clamped_region = region;
Expand Down Expand Up @@ -566,6 +560,7 @@ void FramebufferManager::PopulateEFBCache(bool depth, u32 tile_index)
// Downsample from internal resolution to 1x.
// TODO: This won't produce correct results at IRs above 2x. More samples are required.
// This is the same issue as with EFB copies.
src_texture->FinishedRendering();
g_renderer->BeginUtilityDrawing();

const float rcp_src_width = 1.0f / m_efb_framebuffer->GetWidth();
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/VideoCommon/TextureCacheBase.cpp
Expand Up @@ -2186,6 +2186,7 @@ void TextureCacheBase::CopyEFBToCacheEntry(TCacheEntry* entry, bool is_depth_cop
is_depth_copy ? g_framebuffer_manager->ResolveEFBDepthTexture(framebuffer_rect) :
g_framebuffer_manager->ResolveEFBColorTexture(framebuffer_rect);

src_texture->FinishedRendering();
g_renderer->BeginUtilityDrawing();

// Fill uniform buffer.
Expand Down Expand Up @@ -2253,6 +2254,7 @@ void TextureCacheBase::CopyEFB(AbstractStagingTexture* dst, const EFBCopyParams&
params.depth ? g_framebuffer_manager->ResolveEFBDepthTexture(framebuffer_rect) :
g_framebuffer_manager->ResolveEFBColorTexture(framebuffer_rect);

src_texture->FinishedRendering();
g_renderer->BeginUtilityDrawing();

// Fill uniform buffer.
Expand Down

0 comments on commit 53af27b

Please sign in to comment.