[Fix] (MG_Backend): GetTexImage level-range check was off-by-one (max level is inclusive; single-level textures asserted on level 0), demoted to logged skip; advertise GL_ARB_texture_storage_multisample (entry points already implemented - unadvertised extension left null glw pointers and CTS framebuffer_blit jumped to address 0)

This commit is contained in:
2026-07-16 03:06:03 -04:00
parent 0b94e02de5
commit 176d130f09
3 changed files with 10 additions and 9 deletions
@@ -3450,14 +3450,13 @@ namespace MobileGL::MG_Backend::DirectGLES {
auto* textureMipmapObject = static_cast<MG_State::GLState::TextureObjectMipmap*>(textureObject.get());
auto& levelRange = textureMipmapObject->GetLevelRange();
MGLOG_D("GetTexImage: mipmap level range = [%d, %d)", levelRange.x(), levelRange.y());
MGLOG_D("GetTexImage: mipmap level range = [%d, %d]", levelRange.x(), levelRange.y());
if (level < levelRange.x() || level >= levelRange.y()) {
MGLOG_E("GetTexImage: Requested level %d out of range", level);
MOBILEGL_ASSERT(false,
"GetTexImage: Requested level %d is out of range "
"(base level %d, max level %d).",
level, levelRange.x(), levelRange.y());
// levelRange.y() is GL_TEXTURE_MAX_LEVEL, an inclusive level index — a single-level
// texture has range [0, 0] and level 0 must be readable.
if (static_cast<Uint>(level) < levelRange.x() || static_cast<Uint>(level) > levelRange.y()) {
MGLOG_E("GetTexImage: Requested level %d is out of range (base level %u, max level %u), skipping readback",
level, levelRange.x(), levelRange.y());
return;
}