diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index e6c29e8264..6178df18b8 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -817,7 +817,7 @@ void TextureCacheCommon::HandleTextureChange(TexCacheEntry *const entry, const c gpuStats.numTextureInvalidations++; DEBUG_LOG(G3D, "Texture different or overwritten, reloading at %08x: %s", entry->addr, reason); if (doDelete) { - InvalidateLastTexture(); + ForgetLastTexture(); ReleaseTexture(entry, true); entry->status &= ~TexCacheEntry::STATUS_IS_SCALED; } @@ -1990,7 +1990,7 @@ void TextureCacheCommon::ApplyTexture() { TexCacheEntry *entry = nextTexture_; if (!entry) { // Maybe we bound a framebuffer? - InvalidateLastTexture(); + ForgetLastTexture(); if (failedTexture_) { // Backends should handle this by binding a black texture with 0 alpha. BindTexture(nullptr); @@ -2050,7 +2050,7 @@ void TextureCacheCommon::ApplyTexture() { if (nextNeedsRebuild_) { _assert_(!entry->texturePtr); BuildTexture(entry); - InvalidateLastTexture(); + ForgetLastTexture(); } if (entry->status & TexCacheEntry::STATUS_CLUT_GPU) { @@ -2205,7 +2205,7 @@ void TextureCacheCommon::ApplyTextureFramebuffer(VirtualFramebuffer *framebuffer gstate_c.SetTextureFullAlpha(alphaStatus == CHECKALPHA_FULL); draw_->Invalidate(InvalidationFlags::CACHED_RENDER_STATE); - InvalidateLastTexture(); + ForgetLastTexture(); return; } diff --git a/GPU/Common/TextureCacheCommon.h b/GPU/Common/TextureCacheCommon.h index 6d3fcd604f..f85e09b9a4 100644 --- a/GPU/Common/TextureCacheCommon.h +++ b/GPU/Common/TextureCacheCommon.h @@ -329,7 +329,6 @@ public: TextureShaderCache *GetTextureShaderCache() { return textureShaderCache_; } virtual void ForgetLastTexture() = 0; - virtual void InvalidateLastTexture() = 0; virtual void Clear(bool delete_them); virtual void NotifyConfigChanged(); virtual void ApplySamplingParams(const SamplerCacheKey &key) = 0; diff --git a/GPU/D3D11/TextureCacheD3D11.cpp b/GPU/D3D11/TextureCacheD3D11.cpp index 31433016ee..c8d6b9194a 100644 --- a/GPU/D3D11/TextureCacheD3D11.cpp +++ b/GPU/D3D11/TextureCacheD3D11.cpp @@ -179,20 +179,16 @@ void TextureCacheD3D11::ReleaseTexture(TexCacheEntry *entry, bool delete_them) { } void TextureCacheD3D11::ForgetLastTexture() { - InvalidateLastTexture(); + lastBoundTexture = INVALID_TEX; ID3D11ShaderResourceView *nullTex[4]{}; context_->PSSetShaderResources(0, 4, nullTex); } -void TextureCacheD3D11::InvalidateLastTexture() { - lastBoundTexture = INVALID_TEX; -} - void TextureCacheD3D11::StartFrame() { TextureCacheCommon::StartFrame(); - InvalidateLastTexture(); + lastBoundTexture = INVALID_TEX; timesInvalidatedAllThisFrame_ = 0; replacementTimeThisFrame_ = 0.0; @@ -268,9 +264,7 @@ void TextureCacheD3D11::ApplySamplingParams(const SamplerCacheKey &key) { } void TextureCacheD3D11::Unbind() { - ID3D11ShaderResourceView *nullView = nullptr; - context_->PSSetShaderResources(0, 1, &nullView); - InvalidateLastTexture(); + ForgetLastTexture(); } void TextureCacheD3D11::BindAsClutTexture(Draw::Texture *tex, bool smooth) { diff --git a/GPU/D3D11/TextureCacheD3D11.h b/GPU/D3D11/TextureCacheD3D11.h index 20d84d6d48..4cb01375ff 100644 --- a/GPU/D3D11/TextureCacheD3D11.h +++ b/GPU/D3D11/TextureCacheD3D11.h @@ -51,7 +51,6 @@ public: void SetFramebufferManager(FramebufferManagerD3D11 *fbManager); void ForgetLastTexture() override; - void InvalidateLastTexture() override; bool GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level, bool *isFramebuffer) override; diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index 591dc3f85c..d615c4e330 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -111,7 +111,7 @@ void TextureCacheDX9::ReleaseTexture(TexCacheEntry *entry, bool delete_them) { } } -void TextureCacheDX9::InvalidateLastTexture() { +void TextureCacheDX9::ForgetLastTexture() { lastBoundTexture = INVALID_TEX; } @@ -154,7 +154,7 @@ void TextureCacheDX9::ApplySamplingParams(const SamplerCacheKey &key) { void TextureCacheDX9::StartFrame() { TextureCacheCommon::StartFrame(); - InvalidateLastTexture(); + lastBoundTexture = nullptr; timesInvalidatedAllThisFrame_ = 0; replacementTimeThisFrame_ = 0.0; @@ -229,7 +229,7 @@ void TextureCacheDX9::BindTexture(TexCacheEntry *entry) { void TextureCacheDX9::Unbind() { device_->SetTexture(0, nullptr); - InvalidateLastTexture(); + ForgetLastTexture(); } void TextureCacheDX9::BindAsClutTexture(Draw::Texture *tex, bool smooth) { diff --git a/GPU/Directx9/TextureCacheDX9.h b/GPU/Directx9/TextureCacheDX9.h index 23c2e0163b..0080fbdef3 100644 --- a/GPU/Directx9/TextureCacheDX9.h +++ b/GPU/Directx9/TextureCacheDX9.h @@ -38,10 +38,7 @@ public: void SetFramebufferManager(FramebufferManagerDX9 *fbManager); - void ForgetLastTexture() override { - InvalidateLastTexture(); - } - void InvalidateLastTexture() override; + void ForgetLastTexture() override; bool GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level, bool *isFramebuffer) override; diff --git a/GPU/GLES/TextureCacheGLES.cpp b/GPU/GLES/TextureCacheGLES.cpp index 36ce7837d9..c4ed59221d 100644 --- a/GPU/GLES/TextureCacheGLES.cpp +++ b/GPU/GLES/TextureCacheGLES.cpp @@ -143,7 +143,7 @@ static void ConvertColors(void *dstBuf, const void *srcBuf, Draw::DataFormat dst void TextureCacheGLES::StartFrame() { TextureCacheCommon::StartFrame(); - InvalidateLastTexture(); + ForgetLastTexture(); timesInvalidatedAllThisFrame_ = 0; replacementTimeThisFrame_ = 0.0; @@ -234,7 +234,7 @@ void TextureCacheGLES::BindTexture(TexCacheEntry *entry) { void TextureCacheGLES::Unbind() { render_->BindTexture(TEX_SLOT_PSP_TEXTURE, nullptr); - InvalidateLastTexture(); + ForgetLastTexture(); } void TextureCacheGLES::BindAsClutTexture(Draw::Texture *tex, bool smooth) { @@ -385,7 +385,7 @@ Draw::DataFormat TextureCacheGLES::GetDestFormat(GETextureFormat format, GEPalet } bool TextureCacheGLES::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level, bool *isFramebuffer) { - InvalidateLastTexture(); + ForgetLastTexture(); SetTexture(); if (!nextTexture_) { return GetCurrentFramebufferTextureDebug(buffer, isFramebuffer); diff --git a/GPU/GLES/TextureCacheGLES.h b/GPU/GLES/TextureCacheGLES.h index 8f9517371b..2546c605b9 100644 --- a/GPU/GLES/TextureCacheGLES.h +++ b/GPU/GLES/TextureCacheGLES.h @@ -51,9 +51,6 @@ public: void ForgetLastTexture() override { lastBoundTexture = nullptr; } - void InvalidateLastTexture() override { - lastBoundTexture = nullptr; - } bool GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level, bool *isFramebuffer) override; diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index 1e43f8d355..349d608c3a 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -329,7 +329,6 @@ static const VkFilter MagFiltVK[2] = { void TextureCacheVulkan::StartFrame() { TextureCacheCommon::StartFrame(); - InvalidateLastTexture(); textureShaderCache_->Decimate(); timesInvalidatedAllThisFrame_ = 0; @@ -419,7 +418,6 @@ void TextureCacheVulkan::ApplySamplingParams(const SamplerCacheKey &key) { void TextureCacheVulkan::Unbind() { imageView_ = VK_NULL_HANDLE; curSampler_ = VK_NULL_HANDLE; - InvalidateLastTexture(); } void TextureCacheVulkan::BindAsClutTexture(Draw::Texture *tex, bool smooth) { diff --git a/GPU/Vulkan/TextureCacheVulkan.h b/GPU/Vulkan/TextureCacheVulkan.h index 2c16d02a03..3654101b90 100644 --- a/GPU/Vulkan/TextureCacheVulkan.h +++ b/GPU/Vulkan/TextureCacheVulkan.h @@ -72,8 +72,6 @@ public: } void ForgetLastTexture() override {} - void InvalidateLastTexture() override {} - void NotifyConfigChanged() override; void GetVulkanHandles(VkImageView &imageView, VkSampler &sampler) {