Don't assert when using the old Ge debugger in OpenGL

This commit is contained in:
Henrik Rydgård 2025-01-05 09:28:34 +01:00
parent 8d6593b92b
commit b097a54ee0
3 changed files with 6 additions and 4 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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);