From eaba4ac1dccf0d636e921480acb4c4f847f92580 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Wed, 12 Aug 2026 12:09:45 -0400 Subject: [PATCH] [Fix, Docs] (MG_Backend/DirectGLES): drain the attachment-format probe, and document the depth/stencil readback emulation switch --- MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp | 6 +++++- README.md | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp b/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp index 5de964f1..1cbf6658 100644 --- a/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp +++ b/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp @@ -6074,8 +6074,12 @@ namespace MobileGL::MG_Backend::DirectGLES { if (!isDefault) { // A real object: ask it directly. That answer is certainly blit-compatible, - // so it is used on its own. + // so it is used on its own. The query binds the attachment as GL_TEXTURE_2D, + // which an array or cube attachment refuses - it answers 0, the size-derived + // guesses below take over, and the refusal must not be left on the error + // queue for the caller's next glGetError to pick up as its own. const GLenum exact = ReplicateBlitImpl::QueryAttachmentSizedFormat(point); + ClearGLErrors(); if (exact != 0) { out->Push(exact); return true; diff --git a/README.md b/README.md index d0e3b08d..9b75e6dd 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,7 @@ MobileGL supports runtime configuration via environment variables. | `MOBILEGL_MAGMA_FRAMESINFLIGHT` | Set Magma frames in flight. | Integer `1`–`64` | `3` | | `MOBILEGL_AVOID_SAMPLER_MIPMAP_MIN_FILTER` | Avoid sampler mipmap minification filters. | `0`, `1` | `0` | | `MOBILEGL_COHERENT_AS_FLUSH` | Treat persistent `GL_MAP_FLUSH_EXPLICIT_BIT` maps as coherent (app-compat for engines like Flywheel that never flush them). | `0`, `1` | `0` | +| `MOBILEGL_ESPRYT_FORCE_DS_READBACK_EMULATION` | Always emulate depth/stencil `glReadPixels`/`glGetTexImage` by shader sampling on Espryt, instead of using the driver's own depth/stencil readback where it has one. | `0`, `1` | `0` | | `VK_ICD_FILENAMES` | Select the Vulkan ICD used by the Vulkan loader. | Path to an ICD JSON file | Loader default | ## License