From b097a54ee05e8da30ba7b4513717f3efa6ea0800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 5 Jan 2025 09:28:34 +0100 Subject: [PATCH] Don't assert when using the old Ge debugger in OpenGL --- GPU/Common/TextureCacheCommon.cpp | 6 ++++-- GPU/Common/TextureCacheCommon.h | 2 +- GPU/GLES/TextureCacheGLES.cpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index 2d28cef187..2af43a2ee3 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -2080,7 +2080,7 @@ CheckAlphaResult TextureCacheCommon::ReadIndexedTex(u8 *out, int outPitch, int l } } -void TextureCacheCommon::ApplyTexture() { +void TextureCacheCommon::ApplyTexture(bool doBind) { TexCacheEntry *entry = nextTexture_; if (!entry) { // Maybe we bound a framebuffer? @@ -2161,7 +2161,9 @@ void TextureCacheCommon::ApplyTexture() { gstate_c.SetTextureIsBGRA(false); } else { entry->lastFrame = gpuStats.numFlips; - BindTexture(entry); + if (doBind) { + BindTexture(entry); + } gstate_c.SetTextureFullAlpha(entry->GetAlphaStatus() == TexCacheEntry::STATUS_ALPHA_FULL); gstate_c.SetTextureIs3D((entry->status & TexCacheEntry::STATUS_3D) != 0); gstate_c.SetTextureIsArray(false); diff --git a/GPU/Common/TextureCacheCommon.h b/GPU/Common/TextureCacheCommon.h index 48fc25dd54..2283b2eef4 100644 --- a/GPU/Common/TextureCacheCommon.h +++ b/GPU/Common/TextureCacheCommon.h @@ -349,7 +349,7 @@ public: shaderManager_ = sm; } - void ApplyTexture(); + void ApplyTexture(bool doBind = true); bool SetOffsetTexture(u32 yOffset); void Invalidate(u32 addr, int size, GPUInvalidationType type); void InvalidateAll(GPUInvalidationType type); diff --git a/GPU/GLES/TextureCacheGLES.cpp b/GPU/GLES/TextureCacheGLES.cpp index 7cb60f8a9e..6e7cdb5270 100644 --- a/GPU/GLES/TextureCacheGLES.cpp +++ b/GPU/GLES/TextureCacheGLES.cpp @@ -386,7 +386,7 @@ bool TextureCacheGLES::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level, TexCacheEntry *entry = nextTexture_; // We might need a render pass to set the sampling params, unfortunately. Otherwise BuildTexture may crash. framebufferManagerGL_->RebindFramebuffer("RebindFramebuffer - GetCurrentTextureDebug"); - ApplyTexture(); + ApplyTexture(false); GLRenderManager *renderManager = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);