Repository navigation
iris-hostgl: a texture's internal format is answered as the program gave it - #245
Merged
techomancer merged 1 commit intoOct 17, 2026
Merged
Conversation
…ave it glGetTexLevelParameteriv(GL_TEXTURE_INTERNAL_FORMAT) answered with the sized format the Mac chose -- GL_RGBA8 for GL_RGBA -- where IRIX's libGL (and Mesa) answer with what the program asked for. Cosmo Player probes texture sizes with GL_PROXY_TEXTURE_2D and compares that answer with the format it asked for; on the Mac's it took every size to be refused and shrank every texture to 1x1, so LivingO2 (the O2 demos, VRML in Netscape) drew each texture as one texel: the monitor's screen dark, the desk flat orange, the logos solid rectangles. The executor keeps the internal format each glTexImage1D/2D/3D and glCopyTexImage1D/2D gave, by texture, target and level (a proxy's under texture 0), and answers with it while the host has an image there; a refused proxy (0) is left alone. Generated by tools/glshim.py. Test: texture_internal_format_is_answered_as_the_program_gave_it (fails without). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
atomchild411
force-pushed
the
hostgl-tex-internal-format
branch
from
October 17, 2026 22:47
33ff6ca to
bbe813e
Compare
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.
iris-hostgl: a texture's internal format is answered as the program gave it
glGetTexLevelParameteriv(..., GL_TEXTURE_INTERNAL_FORMAT, ...)answered with the sized format the host chose. On a Mac that isGL_RGBA8for a texture givenGL_RGBA. IRIX's libGL, like Mesa, answers with the format the program asked for.What it broke
Cosmo Player (VRML in Netscape: LivingO2 in the O2 demos, and any VRML world) probes which texture sizes work with
GL_PROXY_TEXTURE_2D. It compares the internal format the proxy answers with the one it asked for, and took the Mac's answer as "refused". It then shrank every texture to 1x1, so every textured surface drew in one texel's colour:A GL call trace shows the difference:
GL_RGBAand Cosmo uploads 15 textures at up to 512x512.GL_RGBA8, and every upload was 1x1.The change
glTexImage1D/2D/3DandglCopyTexImage1D/2Dgave, by texture, target and level. A proxy's is kept under texture 0.glGetTexLevelParameter{i,f}v(GL_TEXTURE_INTERNAL_FORMAT)answers with it while the host has an image there.The calls are generated (
tools/glshim.py), andcalls.rsis regenerated from it.Tests
texture_internal_format_is_answered_as_the_program_gave_itchecks aGL_RGBAproxy and a texture given GL 1.0's3. It fails on macOS without the change. On Linux it passes either way, since Mesa already answers what was asked.cargo test --manifest-path iris-hostgl/Cargo.toml: 33 passed on macOS and on Linux (Debian 12 arm64, Mesa). macOS on upstream c0597bd, Linux on 6b3263f (the one commit between them is a publishing script). CI does not build host GL.🤖 Generated with Claude Code