From 7f1ed0737e68de4b62694b2a94610c9683472728 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 21 May 2016 15:30:54 -0700 Subject: [PATCH 1/5] Fix depal/indexed rendering in core profile. Oops, this needs to be bound after we apply the texture. --- GPU/GLES/DrawEngineGLES.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/GPU/GLES/DrawEngineGLES.cpp b/GPU/GLES/DrawEngineGLES.cpp index f13b061dc0..0663d2d013 100644 --- a/GPU/GLES/DrawEngineGLES.cpp +++ b/GPU/GLES/DrawEngineGLES.cpp @@ -847,13 +847,6 @@ rotateVBO: prim = indexGen.Prim(); } - if (gstate_c.Supports(GPU_SUPPORTS_VAO) && vbo == 0) { - vbo = BindBuffer(decoded, dec_->GetDecVtxFmt().stride * indexGen.MaxIndex()); - if (useElements) { - ebo = BindElementBuffer(decIndex, sizeof(short) * indexGen.VertexCount()); - } - } - VERBOSE_LOG(G3D, "Flush prim %i! %i verts in one go", prim, vertexCount); bool hasColor = (lastVType_ & GE_VTYPE_COL_MASK) != GE_VTYPE_COL_NONE; if (gstate.isModeThrough()) { @@ -863,6 +856,14 @@ rotateVBO: } ApplyDrawStateLate(); + + if (gstate_c.Supports(GPU_SUPPORTS_VAO) && vbo == 0) { + vbo = BindBuffer(decoded, dec_->GetDecVtxFmt().stride * indexGen.MaxIndex()); + if (useElements) { + ebo = BindElementBuffer(decIndex, sizeof(short) * indexGen.VertexCount()); + } + } + LinkedShader *program = shaderManager_->ApplyFragmentShader(vsid, vshader, lastVType_, prim); SetupDecFmtForDraw(program, dec_->GetDecVtxFmt(), vbo ? 0 : decoded); From 3ba46a71af22b3de0c992848c5c6e1646b4daf38 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 21 May 2016 15:31:58 -0700 Subject: [PATCH 2/5] Properly reset back to GL_TEXTURE0 in bind color. --- GPU/GLES/Framebuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 1f09773f5e..8dad33f70d 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -882,7 +882,7 @@ void FramebufferManager::BindFramebufferColor(int stage, u32 fbRawAddress, Virtu } if (stage != GL_TEXTURE0) { - glActiveTexture(stage); + glActiveTexture(GL_TEXTURE0); } } From 2d53eb54563a474f90bbe5b790e9125c6f145dde Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 21 May 2016 15:40:58 -0700 Subject: [PATCH 3/5] Ensure we don't try to hash framebuffers. Let's keep when we do things consistent: measure alpha on apply always. --- GPU/Directx9/TextureCacheDX9.cpp | 35 ++++++++++++++----------------- GPU/GLES/TextureCache.cpp | 35 ++++++++++++++----------------- GPU/Vulkan/TextureCacheVulkan.cpp | 35 ++++++++++++++----------------- 3 files changed, 48 insertions(+), 57 deletions(-) diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index 5c0ba999fb..ebcb2f6e46 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -649,28 +649,9 @@ void TextureCacheDX9::SetTextureFramebuffer(TexCacheEntry *entry, VirtualFramebu framebuffer->usageFlags |= FB_USAGE_TEXTURE; bool useBufferedRendering = g_Config.iRenderingMode != FB_NON_BUFFERED_MODE; if (useBufferedRendering) { - const GEPaletteFormat clutFormat = gstate.getClutPaletteFormat(); const u64 cachekey = entry->CacheKey(); const auto &fbInfo = fbTexInfo_[cachekey]; - LPDIRECT3DPIXELSHADER9 pshader = nullptr; - if ((entry->status & TexCacheEntry::STATUS_DEPALETTIZE) && !g_Config.bDisableSlowFramebufEffects) { - pshader = depalShaderCache_->GetDepalettizePixelShader(clutFormat, framebuffer->drawnFormat); - } - if (pshader) { - const u32 bytesPerColor = clutFormat == GE_CMODE_32BIT_ABGR8888 ? sizeof(u32) : sizeof(u16); - const u32 clutTotalColors = clutMaxBytes_ / bytesPerColor; - - TexCacheEntry::Status alphaStatus = CheckAlpha(clutBuf_, getClutDestFormat(clutFormat), clutTotalColors, clutTotalColors, 1); - gstate_c.textureFullAlpha = alphaStatus == TexCacheEntry::STATUS_ALPHA_FULL; - gstate_c.textureSimpleAlpha = alphaStatus == TexCacheEntry::STATUS_ALPHA_SIMPLE; - } else { - entry->status &= ~TexCacheEntry::STATUS_DEPALETTIZE; - - gstate_c.textureFullAlpha = gstate.getTextureFormat() == GE_TFMT_5650; - gstate_c.textureSimpleAlpha = gstate_c.textureFullAlpha; - } - // Keep the framebuffer alive. framebuffer->last_frame_used = gpuStats.numFlips; @@ -694,6 +675,10 @@ void TextureCacheDX9::SetTextureFramebuffer(TexCacheEntry *entry, VirtualFramebu pD3Ddevice->SetTexture(0, NULL); gstate_c.needShaderTexClamp = false; } + + nextNeedsRehash_ = false; + nextNeedsChange_ = false; + nextNeedsRebuild_ = false; } void TextureCacheDX9::ApplyTexture() { @@ -911,8 +896,20 @@ void TextureCacheDX9::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFrame shaderApply.Shade(); fbo_bind_color_as_texture(depalFBO, 0); + + const u32 bytesPerColor = clutFormat == GE_CMODE_32BIT_ABGR8888 ? sizeof(u32) : sizeof(u16); + const u32 clutTotalColors = clutMaxBytes_ / bytesPerColor; + + TexCacheEntry::Status alphaStatus = CheckAlpha(clutBuf_, getClutDestFormat(clutFormat), clutTotalColors, clutTotalColors, 1); + gstate_c.textureFullAlpha = alphaStatus == TexCacheEntry::STATUS_ALPHA_FULL; + gstate_c.textureSimpleAlpha = alphaStatus == TexCacheEntry::STATUS_ALPHA_SIMPLE; } else { + entry->status &= ~TexCacheEntry::STATUS_DEPALETTIZE; + framebufferManager_->BindFramebufferColor(0, framebuffer, BINDFBCOLOR_MAY_COPY_WITH_UV | BINDFBCOLOR_APPLY_TEX_OFFSET); + + gstate_c.textureFullAlpha = gstate.getTextureFormat() == GE_TFMT_5650; + gstate_c.textureSimpleAlpha = gstate_c.textureFullAlpha; } framebufferManager_->RebindFramebuffer(); diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index e97e399775..ff281bc2d6 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -719,28 +719,9 @@ void TextureCache::SetTextureFramebuffer(TexCacheEntry *entry, VirtualFramebuffe framebuffer->usageFlags |= FB_USAGE_TEXTURE; bool useBufferedRendering = g_Config.iRenderingMode != FB_NON_BUFFERED_MODE; if (useBufferedRendering) { - const GEPaletteFormat clutFormat = gstate.getClutPaletteFormat(); const u64 cachekey = entry->CacheKey(); const auto &fbInfo = fbTexInfo_[cachekey]; - DepalShader *depal = nullptr; - if ((entry->status & TexCacheEntry::STATUS_DEPALETTIZE) && !g_Config.bDisableSlowFramebufEffects) { - depal = depalShaderCache_->GetDepalettizeShader(clutFormat, framebuffer->drawnFormat); - } - if (depal) { - const u32 bytesPerColor = clutFormat == GE_CMODE_32BIT_ABGR8888 ? sizeof(u32) : sizeof(u16); - const u32 clutTotalColors = clutMaxBytes_ / bytesPerColor; - - TexCacheEntry::Status alphaStatus = CheckAlpha(clutBuf_, getClutDestFormat(clutFormat), clutTotalColors, clutTotalColors, 1); - gstate_c.textureFullAlpha = alphaStatus == TexCacheEntry::STATUS_ALPHA_FULL; - gstate_c.textureSimpleAlpha = alphaStatus == TexCacheEntry::STATUS_ALPHA_SIMPLE; - } else { - entry->status &= ~TexCacheEntry::STATUS_DEPALETTIZE; - - gstate_c.textureFullAlpha = gstate.getTextureFormat() == GE_TFMT_5650; - gstate_c.textureSimpleAlpha = gstate_c.textureFullAlpha; - } - // Keep the framebuffer alive. framebuffer->last_frame_used = gpuStats.numFlips; @@ -763,6 +744,10 @@ void TextureCache::SetTextureFramebuffer(TexCacheEntry *entry, VirtualFramebuffe glBindTexture(GL_TEXTURE_2D, 0); gstate_c.needShaderTexClamp = false; } + + nextNeedsRehash_ = false; + nextNeedsChange_ = false; + nextNeedsRebuild_ = false; } void TextureCache::ApplyTexture() { @@ -985,8 +970,20 @@ void TextureCache::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFramebuf shaderApply.Shade(); fbo_bind_color_as_texture(depalFBO, 0); + + const u32 bytesPerColor = clutFormat == GE_CMODE_32BIT_ABGR8888 ? sizeof(u32) : sizeof(u16); + const u32 clutTotalColors = clutMaxBytes_ / bytesPerColor; + + TexCacheEntry::Status alphaStatus = CheckAlpha(clutBuf_, getClutDestFormat(clutFormat), clutTotalColors, clutTotalColors, 1); + gstate_c.textureFullAlpha = alphaStatus == TexCacheEntry::STATUS_ALPHA_FULL; + gstate_c.textureSimpleAlpha = alphaStatus == TexCacheEntry::STATUS_ALPHA_SIMPLE; } else { + entry->status &= ~TexCacheEntry::STATUS_DEPALETTIZE; + framebufferManager_->BindFramebufferColor(GL_TEXTURE0, gstate.getFrameBufRawAddress(), framebuffer, BINDFBCOLOR_MAY_COPY_WITH_UV | BINDFBCOLOR_APPLY_TEX_OFFSET); + + gstate_c.textureFullAlpha = gstate.getTextureFormat() == GE_TFMT_5650; + gstate_c.textureSimpleAlpha = gstate_c.textureFullAlpha; } framebufferManager_->RebindFramebuffer(); diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index d3bb0bc159..7ad675778c 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -659,28 +659,9 @@ void TextureCacheVulkan::SetTextureFramebuffer(TexCacheEntry *entry, VirtualFram framebuffer->usageFlags |= FB_USAGE_TEXTURE; bool useBufferedRendering = g_Config.iRenderingMode != FB_NON_BUFFERED_MODE; if (useBufferedRendering) { - const GEPaletteFormat clutFormat = gstate.getClutPaletteFormat(); const u64 cachekey = entry->CacheKey(); const auto &fbInfo = fbTexInfo_[cachekey]; - DepalShaderVulkan *depal = nullptr; - if ((entry->status & TexCacheEntry::STATUS_DEPALETTIZE) && !g_Config.bDisableSlowFramebufEffects) { - // depal = depalShaderCache_->GetDepalettizeShader(clutFormat, framebuffer->drawnFormat); - } - if (depal) { - const u32 bytesPerColor = clutFormat == GE_CMODE_32BIT_ABGR8888 ? sizeof(u32) : sizeof(u16); - const u32 clutTotalColors = clutMaxBytes_ / bytesPerColor; - - TexCacheEntry::Status alphaStatus = CheckAlpha(clutBuf_, getClutDestFormatVulkan(clutFormat), clutTotalColors, clutTotalColors, 1); - gstate_c.textureFullAlpha = alphaStatus == TexCacheEntry::STATUS_ALPHA_FULL; - gstate_c.textureSimpleAlpha = alphaStatus == TexCacheEntry::STATUS_ALPHA_SIMPLE; - } else { - entry->status &= ~TexCacheEntry::STATUS_DEPALETTIZE; - - gstate_c.textureFullAlpha = gstate.getTextureFormat() == GE_TFMT_5650; - gstate_c.textureSimpleAlpha = gstate_c.textureFullAlpha; - } - // Keep the framebuffer alive. framebuffer->last_frame_used = gpuStats.numFlips; @@ -702,6 +683,10 @@ void TextureCacheVulkan::SetTextureFramebuffer(TexCacheEntry *entry, VirtualFram } gstate_c.needShaderTexClamp = false; } + + nextNeedsRehash_ = false; + nextNeedsChange_ = false; + nextNeedsRebuild_ = false; } void TextureCacheVulkan::ApplyTexture(VulkanPushBuffer *uploadBuffer, VkImageView &imageView, VkSampler &sampler) { @@ -847,6 +832,18 @@ void TextureCacheVulkan::ApplyTextureFramebuffer(VkCommandBuffer cmd, TexCacheEn //depalFBO->EndPass(cmd); //depalFBO->TransitionToTexture(cmd); //imageView = depalFBO->GetColorImageView(); + + const u32 bytesPerColor = clutFormat == GE_CMODE_32BIT_ABGR8888 ? sizeof(u32) : sizeof(u16); + const u32 clutTotalColors = clutMaxBytes_ / bytesPerColor; + + TexCacheEntry::Status alphaStatus = CheckAlpha(clutBuf_, getClutDestFormatVulkan(clutFormat), clutTotalColors, clutTotalColors, 1); + gstate_c.textureFullAlpha = alphaStatus == TexCacheEntry::STATUS_ALPHA_FULL; + gstate_c.textureSimpleAlpha = alphaStatus == TexCacheEntry::STATUS_ALPHA_SIMPLE; + } else { + entry->status &= ~TexCacheEntry::STATUS_DEPALETTIZE; + + gstate_c.textureFullAlpha = gstate.getTextureFormat() == GE_TFMT_5650; + gstate_c.textureSimpleAlpha = gstate_c.textureFullAlpha; } /* From f16f163edffc9602383b23e318302d23a19470d3 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 21 May 2016 15:45:03 -0700 Subject: [PATCH 4/5] Remove duplicate override. This is the same function, it was meant to be refactored. --- GPU/Directx9/DrawEngineDX9.cpp | 10 ---------- GPU/Directx9/DrawEngineDX9.h | 2 -- GPU/Vulkan/DrawEngineVulkan.cpp | 10 ---------- GPU/Vulkan/DrawEngineVulkan.h | 2 -- 4 files changed, 24 deletions(-) diff --git a/GPU/Directx9/DrawEngineDX9.cpp b/GPU/Directx9/DrawEngineDX9.cpp index 5a312ce05b..d3b6a57cf0 100644 --- a/GPU/Directx9/DrawEngineDX9.cpp +++ b/GPU/Directx9/DrawEngineDX9.cpp @@ -244,16 +244,6 @@ IDirect3DVertexDeclaration9 *DrawEngineDX9::SetupDecFmtForDraw(VSShader *vshader } } -VertexDecoder *DrawEngineDX9::GetVertexDecoder(u32 vtype) { - auto iter = decoderMap_.find(vtype); - if (iter != decoderMap_.end()) - return iter->second; - VertexDecoder *dec = new VertexDecoder(); - dec->SetVertexType(vtype, decOptions_, decJitCache_); - decoderMap_[vtype] = dec; - return dec; -} - void DrawEngineDX9::SetupVertexDecoder(u32 vertType) { SetupVertexDecoderInternal(vertType); } diff --git a/GPU/Directx9/DrawEngineDX9.h b/GPU/Directx9/DrawEngineDX9.h index f98202f095..8f54c62877 100644 --- a/GPU/Directx9/DrawEngineDX9.h +++ b/GPU/Directx9/DrawEngineDX9.h @@ -201,8 +201,6 @@ private: ReliableHashType ComputeHash(); // Reads deferred vertex data. void MarkUnreliable(VertexArrayInfoDX9 *vai); - VertexDecoder *GetVertexDecoder(u32 vtype); - // Defer all vertex decoding to a Flush, so that we can hash and cache the // generated buffers without having to redecode them every time. struct DeferredDrawCall { diff --git a/GPU/Vulkan/DrawEngineVulkan.cpp b/GPU/Vulkan/DrawEngineVulkan.cpp index 95638f6247..e035101577 100644 --- a/GPU/Vulkan/DrawEngineVulkan.cpp +++ b/GPU/Vulkan/DrawEngineVulkan.cpp @@ -268,16 +268,6 @@ void DrawEngineVulkan::EndFrame() { curFrame_++; } -VertexDecoder *DrawEngineVulkan::GetVertexDecoder(u32 vtype) { - auto iter = decoderMap_.find(vtype); - if (iter != decoderMap_.end()) - return iter->second; - VertexDecoder *dec = new VertexDecoder(); - dec->SetVertexType(vtype, decOptions_, decJitCache_); - decoderMap_[vtype] = dec; - return dec; -} - void DrawEngineVulkan::SetupVertexDecoder(u32 vertType) { SetupVertexDecoderInternal(vertType); } diff --git a/GPU/Vulkan/DrawEngineVulkan.h b/GPU/Vulkan/DrawEngineVulkan.h index dbaf6f68b7..280555aed8 100644 --- a/GPU/Vulkan/DrawEngineVulkan.h +++ b/GPU/Vulkan/DrawEngineVulkan.h @@ -168,8 +168,6 @@ private: VkDescriptorSet GetDescriptorSet(VkImageView imageView, VkSampler sampler, VkBuffer base, VkBuffer light, VkBuffer bone); - VertexDecoder *GetVertexDecoder(u32 vtype); - VulkanContext *vulkan_; // We use a single descriptor set layout for all PSP draws. From f168978d3e0f148a65982c18baca140138cac5b9 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 21 May 2016 17:53:42 -0700 Subject: [PATCH 5/5] Properly set w/h on first use of a render-to-tex. We were getting the wrong w/h when it wasn't in the texture cache already. --- GPU/Directx9/TextureCacheDX9.cpp | 26 ++++++++++++++++---------- GPU/GLES/TextureCache.cpp | 26 ++++++++++++++++---------- GPU/Vulkan/TextureCacheVulkan.cpp | 26 ++++++++++++++++---------- 3 files changed, 48 insertions(+), 30 deletions(-) diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index ebcb2f6e46..b21f04d71f 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -1145,8 +1145,22 @@ void TextureCacheDX9::SetTexture(bool force) { gstate_c.curTextureWidth = w; gstate_c.curTextureHeight = h; + // Before we go reading the texture from memory, let's check for render-to-texture. + // We must do this early so we have the right w/h. + entry->framebuffer = 0; + for (size_t i = 0, n = fbCache_.size(); i < n; ++i) { + auto framebuffer = fbCache_[i]; + AttachFramebuffer(entry, framebuffer->fb_address, framebuffer); + } + + // If we ended up with a framebuffer, attach it - no texture decoding needed. + if (entry->framebuffer) { + SetTextureFramebuffer(entry, entry->framebuffer); + } + nextTexture_ = entry; - nextNeedsRehash_ = true; + nextNeedsRehash_ = entry->framebuffer == nullptr; + // We still need to rebuild, to allocate a texture. But we'll bail early. nextNeedsRebuild_= true; } @@ -1260,16 +1274,8 @@ void TextureCacheDX9::BuildTexture(TexCacheEntry *const entry, bool replaceImage // TODO: If a framebuffer is attached here, might end up with a bad entry.texture. // Should just always create one here or something (like GLES.) - // Before we go reading the texture from memory, let's check for render-to-texture. - entry->framebuffer = 0; - for (size_t i = 0, n = fbCache_.size(); i < n; ++i) { - auto framebuffer = fbCache_[i]; - AttachFramebuffer(entry, framebuffer->fb_address, framebuffer); - } - - // If we ended up with a framebuffer, attach it - no texture decoding needed. if (entry->framebuffer) { - SetTextureFramebuffer(entry, entry->framebuffer); + // Nothing else to do here. return; } diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index ff281bc2d6..dfd436e0f8 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -1247,8 +1247,22 @@ void TextureCache::SetTexture(bool force) { gstate_c.curTextureWidth = w; gstate_c.curTextureHeight = h; + // Before we go reading the texture from memory, let's check for render-to-texture. + // We must do this early so we have the right w/h. + entry->framebuffer = 0; + for (size_t i = 0, n = fbCache_.size(); i < n; ++i) { + auto framebuffer = fbCache_[i]; + AttachFramebuffer(entry, framebuffer->fb_address, framebuffer); + } + + // If we ended up with a framebuffer, attach it - no texture decoding needed. + if (entry->framebuffer) { + SetTextureFramebuffer(entry, entry->framebuffer); + } + nextTexture_ = entry; - nextNeedsRehash_ = true; + nextNeedsRehash_ = entry->framebuffer == nullptr; + // We still need to rebuild, to allocate a texture. But we'll bail early. nextNeedsRebuild_= true; } @@ -1364,16 +1378,8 @@ void TextureCache::BuildTexture(TexCacheEntry *const entry, bool replaceImages) entry->textureName = AllocTextureName(); } - // Before we go reading the texture from memory, let's check for render-to-texture. - entry->framebuffer = 0; - for (size_t i = 0, n = fbCache_.size(); i < n; ++i) { - auto framebuffer = fbCache_[i]; - AttachFramebuffer(entry, framebuffer->fb_address, framebuffer); - } - - // If we ended up with a framebuffer, attach it - no texture decoding needed. if (entry->framebuffer) { - SetTextureFramebuffer(entry, entry->framebuffer); + // Nothing else to do here. return; } diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index 7ad675778c..446290f917 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -1117,8 +1117,22 @@ void TextureCacheVulkan::SetTexture() { gstate_c.curTextureWidth = w; gstate_c.curTextureHeight = h; + // Before we go reading the texture from memory, let's check for render-to-texture. + // We must do this early so we have the right w/h. + entry->framebuffer = 0; + for (size_t i = 0, n = fbCache_.size(); i < n; ++i) { + auto framebuffer = fbCache_[i]; + AttachFramebuffer(entry, framebuffer->fb_address, framebuffer); + } + + // If we ended up with a framebuffer, attach it - no texture decoding needed. + if (entry->framebuffer) { + SetTextureFramebuffer(entry, entry->framebuffer); + } + nextTexture_ = entry; - nextNeedsRehash_ = true; + nextNeedsRehash_ = entry->framebuffer == nullptr; + // We still need to rebuild, to allocate a texture. But we'll bail early. nextNeedsRebuild_= true; } @@ -1222,16 +1236,8 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry,VulkanPushBuffe // For the estimate, we assume cluts always point to 8888 for simplicity. cacheSizeEstimate_ += EstimateTexMemoryUsage(entry); - // Before we go reading the texture from memory, let's check for render-to-texture. - entry->framebuffer = 0; - for (size_t i = 0, n = fbCache_.size(); i < n; ++i) { - auto framebuffer = fbCache_[i]; - AttachFramebuffer(entry, framebuffer->fb_address, framebuffer); - } - - // If we ended up with a framebuffer, attach it - no texture decoding needed. if (entry->framebuffer) { - SetTextureFramebuffer(entry, entry->framebuffer); + // Nothing else to do here. return; }