Skip to content

iris-hostgl: what SGI's own IRIS GL needs from the guest library (generator hooks), and IMPACT's last two extensions - #249

Merged
techomancer merged 4 commits into
techomancer:mainfrom
atomchild411:hostgl-igloo-hooks
Oct 17, 2026
Merged

techomancer merged 4 commits into
techomancer:mainfrom
atomchild411:hostgl-igloo-hooks

Conversation

@atomchild411

Copy link
Copy Markdown
Collaborator

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 program keeps SGI's libgl.so and gives it the host-GL libGL.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_clamp and GL_SGIX_texture_multi_buffer join the extension list.

    • The first's GL_CLAMP_TO_BORDER_SGIS is core GL_CLAMP_TO_BORDER.
    • The second is a hint the guest library takes itself.

    Every extension IMPACT's libGL names is now there except GL_SGIX_list_priority.

  • Guest hooks in the generator (GUEST_HOOKS, GUEST_AFTER):

    • glReadPixels and glDrawPixels with GL_COLOR_INDEX in 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.
    • The texture multi-buffer hint is taken by the guest library.
    • lmcolor(LMC_COLOR): a glBegin is held until its first vertex, and lighting is put back at glEnd. IGLOO says itself which of a colour and a normal came last (glIglooInterfaceSGIX 0x81A1), as IMPACT's libGL uses it, so no hook watches glColor or glNormal.
    • swaptmesh: IGLOO draws a mesh as a GL_TRIANGLE_STRIP and 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.rs regenerates identically. The guest glshim_gen.c this generator writes is byte-for-byte the one in the guest tools release.

Tests

🤖 Generated with Claude Code

atomchild411 and others added 4 commits October 17, 2026 12:59
…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>
@techomancer
techomancer merged commit b615195 into techomancer:main Oct 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants