Permalink
Browse files

Merge pull request #11322 from unknownbrackets/texcache

GPU: Fix texture handling on framebuf detach
  • Loading branch information...
hrydgard committed Aug 25, 2018
2 parents 569c073 + 3f48e44 commit 3c99d16da7aca36de197907e3d693772322e2933
Showing with 4 additions and 0 deletions.
  1. +3 −0 GPU/Common/TextureCacheCommon.cpp
  2. +1 −0 ext/native/thin3d/GLRenderManager.cpp
@@ -713,6 +713,9 @@ void TextureCacheCommon::DetachFramebuffer(TexCacheEntry *entry, u32 address, Vi
const u64 cachekey = entry->CacheKey();
cacheSizeEstimate_ += EstimateTexMemoryUsage(entry);
entry->framebuffer = nullptr;
// Force the hash to change in case we had one before.
// Otherwise we never recreate the texture.
entry->hash ^= 1;
fbTexInfo_.erase(cachekey);
host->GPUNotifyTextureAttachment(entry->addr);
}
@@ -345,6 +345,7 @@ bool GLRenderManager::CopyFramebufferToMemorySync(GLRFramebuffer *src, int aspec
}
void GLRenderManager::CopyImageToMemorySync(GLRTexture *texture, int mipLevel, int x, int y, int w, int h, Draw::DataFormat destFormat, uint8_t *pixels, int pixelStride) {
_assert_(texture);
GLRStep *step = new GLRStep{ GLRStepType::READBACK_IMAGE };
step->readback_image.texture = texture;
step->readback_image.mipLevel = mipLevel;

0 comments on commit 3c99d16

Please sign in to comment.