[Fix] (texture): map GL_DEPTH_COMPONENT32 to GL_DEPTH_COMPONENT32F for GLES - #49
Open
ryanmurf wants to merge 1 commit into
Open
[Fix] (texture): map GL_DEPTH_COMPONENT32 to GL_DEPTH_COMPONENT32F for GLES#49ryanmurf wants to merge 1 commit into
ryanmurf wants to merge 1 commit into
Conversation
…r GLES Minecraft 26.x (GlDevice.createTexture) allocates its main depth texture with internalformat GL_DEPTH_COMPONENT32 (0x81A7) and type GL_FLOAT. GLES 3.x has no GL_DEPTH_COMPONENT32; the allocation fails and the game cannot create its framebuffer. Map it to the sized GL_DEPTH_COMPONENT32F (forcing type GL_FLOAT) and treat it as a depth format in is_depth_format().
This was referenced Jul 30, 2026
Author
|
On-device confirmation: with this fix (plus #50 making the layer actually active on Apple), Minecraft 26.1.2's depth attachment allocates fine and the game renders correctly / is fully playable on iPad Pro (M1, iPadOS 26.5) via Amethyst. Tested build: AngelAuraMC/Amethyst-iOS#293. |
Member
|
This is a too-wide fix. 32F (8-bit exp + 24-bit fract) has less precision than 32 in near-zero range. This can cause problems with shadows of some shaderpacks. Don’t put this format conversion/substitution here as it will affect globally. (Potentially breaking rendering of certain shaders) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Maps the desktop-GL internal format
GL_DEPTH_COMPONENT32(0x81A7) toGL_DEPTH_COMPONENT32Fininternal_convert(), and adds it tois_depth_format(). Without this, Minecraft 26.x cannot allocate its main depth texture through MobileGlues.Why
Minecraft 26.x (
GlDevice.createTexturein the new blaze3d GL device) allocates its depth attachment with:GL_DEPTH_COMPONENT32is a desktop GL sized format that does not exist in GLES 3.x, so the call fails (GL_INVALID_ENUM/GL_INVALID_OPERATIONdepending on driver) and the game bails out during framebuffer creation. The closest GLES 3.0 sized depth format isGL_DEPTH_COMPONENT32F, which requirestype = GL_FLOAT— the type Minecraft already passes; the conversion forces it regardless for safety.Found while getting Minecraft 26.1.2 running in Amethyst (PojavLauncher iOS successor), but the format mapping applies to any platform where MobileGlues backs a desktop-GL app.
Testing
GL_DEPTH_COMPONENT24path).