Repository navigation
iris-hostgl: what SGI's own IRIS GL needs from the guest library (generator hooks), and IMPACT's last two extensions - #249
Merged
Conversation
…m hooks for SGI's IRIS GL GL_SGIS_texture_border_clamp (its GL_CLAMP_TO_BORDER_SGIS is core GL_CLAMP_TO_BORDER) and GL_SGIX_texture_multi_buffer (a hint the guest library takes) join the extension list, so every extension IMPACT names is there but GL_SGIX_list_priority. The generator's guest hooks gain glReadPixels(GL_COLOR_INDEX) in index contexts, the multi-buffer hint, and lmcolor(LMC_COLOR) for SGI's IRIS GL (colour/normal last, a glBegin held to its first vertex, lighting back at glEnd). Encoders and the decoder are otherwise unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndex contexts The guest library encodes an index image itself (hgl_draw_index); the host's RGBA GL would turn it into index 0 through its pixel maps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SGI's IRIS GL (IGLOO) draws a triangle mesh as a GL_TRIANGLE_STRIP and asks SGI's libGL for each swaptmesh through glIglooInterfaceSGIX. The guest library does the swap by sending the older of the last two vertices again (hgl_tm in its glshim_rt.c); these hooks keep, inside a mesh, each vertex with the normal, colour and texture coordinate it was sent with, integers normalized as OpenGL does, and start each strip empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/glNormal hooks SGI's IRIS GL says itself which of a colour and a normal came last (glIglooInterfaceSGIX 0x81A1, COLORNORMAL), and IMPACT's libGL switches its lighting mode on that flag alone. The guest library now does the same, so the hooks that watched every glColor and glNormal go; IGLOO's own glColor calls (it sends the colour again when lmcolor changes) no longer count as the program's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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: what SGI's own IRIS GL needs from the guest library (generator hooks), and IMPACT's last two extensions
On IMPACT, SGI's IRIS GL (
libgl.so, "IGLOO") is built on OpenGL. The guest tools (v20261017-proto2) can now run it on host GL:hostgl programkeeps SGI'slibgl.soand gives it the host-GLlibGL.so. Most of that work is in the guest library. This PR has the IRIS side: the generator (tools/glshim.py) hooks the guest library's generated encoders call, and two extension names.The change
Two extension names.
GL_SGIS_texture_border_clampandGL_SGIX_texture_multi_bufferjoin the extension list.GL_CLAMP_TO_BORDER_SGISis coreGL_CLAMP_TO_BORDER.Every extension IMPACT's libGL names is now there except
GL_SGIX_list_priority.Guest hooks in the generator (
GUEST_HOOKS,GUEST_AFTER):glReadPixelsandglDrawPixelswithGL_COLOR_INDEXin colour-index contexts are encoded by the guest library itself. The host's RGBA GL would turn them into index 0 through its pixel maps.lmcolor(LMC_COLOR): aglBeginis held until its first vertex, and lighting is put back atglEnd. IGLOO says itself which of a colour and a normal came last (glIglooInterfaceSGIX0x81A1), as IMPACT's libGL uses it, so no hook watchesglColororglNormal.swaptmesh: IGLOO draws a mesh as aGL_TRIANGLE_STRIPand asks libGL for each swap. Inside a mesh, the hooks keep each vertex with its normal, colour and texture coordinate, so the library can send the older of the last two vertices again.The host's encoders and decoder are unchanged:
calls.rsregenerates identically. The guestglshim_gen.cthis generator writes is byte-for-byte the one in the guest tools release.Tests
cargo test --manifest-path iris-hostgl/Cargo.toml: 32 passed on macOS and on Linux (Debian 12 arm64, Mesa).tools/glshim.pyoutput:calls.rsunchanged; the guestglshim_gen.cidentical to guest-tools 89253f8's.hostglagainstsgiglon the same machine. These are the results of these hooks with the guest library:🤖 Generated with Claude Code