Remove kinda-duplicate function.

This commit is contained in:
Henrik Rydgård committed 2023-02-24 23:54:04 +01:00
1 parent f5d844d282
commit 1b5148bb6c
10 files changed
+14 -32

No files matched your search

+4 -4
View File
@@ -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;
}
-1
View File
@@ -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;
+3 -9
View File
@@ -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) {
-1
View File
@@ -51,7 +51,6 @@ public:
void SetFramebufferManager(FramebufferManagerD3D11 *fbManager);
void ForgetLastTexture() override;
void InvalidateLastTexture() override;
bool GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level, bool *isFramebuffer) override;
+3 -3
View File
@@ -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) {
+1 -4
View File
@@ -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;
+3 -3
View File
@@ -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);
-3
View File
@@ -51,9 +51,6 @@ public:
void ForgetLastTexture() override {
lastBoundTexture = nullptr;
}
void InvalidateLastTexture() override {
lastBoundTexture = nullptr;
}
bool GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level, bool *isFramebuffer) override;
-2
View File
@@ -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) {
-2
View File
@@ -72,8 +72,6 @@ public:
}
void ForgetLastTexture() override {}
void InvalidateLastTexture() override {}
void NotifyConfigChanged() override;
void GetVulkanHandles(VkImageView &imageView, VkSampler &sampler) {