Repository navigation
iris-hostgl, mgras: colour-index windows' frames composited as indices - #247
Merged
Merged
Conversation
atomchild411
force-pushed
the
hostgl-index-frames
branch
2 times, most recently
from
October 17, 2026 22:53
6f21061 to
91eb964
Compare
A colour-index window (IRIS GL's usual kind: flight's main window, every overlay and pop-up window) reached the screen only through the guest: it read each frame back, turned it into indices on the emulated CPU and put it to the X server. SGI's IRIS GL (IGLOO) running on host OpenGL showed flight's full-screen 8-bit window at a frame every few seconds. OP_SWAP's seventh slot gains bit 2, a colour-index window's frame, and bit 3, an overlay window's. Such a frame goes to the display now, through the new Display::present_index_at (default: not taken, so the guest puts it up as before). On IMPACT, disp::composite_index writes each pixel's index -- red byte, then green's low nibble, as the host draws index contexts -- where the board keeps that window's indices: the low 8 or 12 main planes by the window ID's display mode, the high 12 when the ID shows buffer B, or the overlay planes, for the colour map to show. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rs it index_window_did took the commonest colour-index (or overlay) window ID in the window's rectangle. Just after a window is mapped its ID may not be in the VC3's tables yet, and the commonest one around is then another window's: the frame went into that, the program was told it was shown, and gltest's overlay check read back 0s about one run in three. The ID must now cover three quarters of the samples on the screen, or the frame goes back to the program to put up itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A host from before colour-index frames (bits 2 and 3 of OP_SWAP's seventh slot) composites such a frame's encoded RGBA as colours and answers that it is on the screen: on upstream IRIS the guest library's overlay and colour-index windows read back 0 (gltest's overlay checks, irisgltest's overlay window). OP_INDEX_FRAMES (0x1_0013) answers 1 here; a host without it answers EINVAL, and the library has the frame handed back and puts it up itself, as before. Test: index_frames_are_asked_for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
atomchild411
force-pushed
the
hostgl-index-frames
branch
from
October 17, 2026 23:00
91eb964 to
248ac50
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, mgras: colour-index windows' frames composited as indices
Under host GL, a colour-index window reached the screen only through the guest. This is IRIS GL's usual kind of window: flight's main window, and every overlay and pop-up window. The guest library read each frame back, turned it into indices on the emulated CPU, and put it to the X server with
XPutImage. SGI's IRIS GL running on host OpenGL showed flight's full-screen 8-bit window at a frame every few seconds.The change
New OP_SWAP bits. OP_SWAP's seventh slot gains bit 2 (a colour-index window's frame) and bit 3 (an overlay window's). Such a frame goes to the display through a new
Display::present_index_at. Its default is "not taken", so the guest puts the frame up as before on any display that doesn't implement it.On IMPACT,
disp::composite_indexwrites each pixel's index where the board keeps that window's indices:The colour map then shows them as on the board. The index comes from red's byte and green's low nibble, which is how the host draws index contexts.
Only where the window ID covers it. The frame is composited only where its window's ID covers at least three quarters of the window's samples on screen; otherwise it goes back to the guest. Just after a window is mapped, its ID may not be in the VC3's tables yet. Taking the commonest ID around then wrote into another window, and gltest's overlay check read 0s about one run in three.
OP_INDEX_FRAMES(0x1_0013) answers 1, so a library can ask first. On an IRIS without this change it gets EINVAL and keeps putting colour-index frames up itself. Without the probe, such a host would composite the encoded RGBA as colours and report the frame as shown.This touches
src/dev/mgras/disp.rsandmod.rs(no overlap with #241), plusiris-hostcall'sDisplaytrait andiris-hostgl.Tests
Unit test:
index_frames_are_asked_for.cargo test --manifest-path iris-hostgl/Cargo.toml: 33 passed on macOS.cargo test --lib mgras(featureshostgl,jitv2,tcache,lightning,rex-jit,gr4-jit): 177 passed, on this branch with iris-hostgl: flush presents don't wait, and come at most once a frame #248 on top.On IRIX 6.5.22m, Indigo2 Max IMPACT, macOS host, with the guest tools release v20261017-proto2 (atomchild411/iris-guest-tools), which asks with
OP_INDEX_FRAMES:gltestall ok (n32, o32), including its overlay checks;irisgltest's colour-index and overlay windows read back their indices: "1000 in the rectangle, 7 around it", "index 3 in the overlay";The same release on upstream IRIS without this change asks, gets EINVAL, and passes the same checks the old way.
On Linux (Debian 12 arm64 VM, Mesa 22.3.6), with this branch and the flush-presents one on top:
cargo test --manifest-path iris-hostgl/Cargo.toml: 33 passed;gltestall ok (n32, o32),glcheckPASSED;irisgltest's colour-index and overlay windows read back their indices.SGI's own IRIS GL on a Linux host also needs iris-hostgl: SGI_color_matrix's state on a host without a colour matrix (Linux) #246, which fixes a crash that exists without these changes too.
🤖 Generated with Claude Code