Skip to content

Rebasedlinuxhostgl - #224

Merged
techomancer merged 3 commits into
mainfrom
rebasedlinuxhostgl
Oct 13, 2026
Merged

techomancer merged 3 commits into
mainfrom
rebasedlinuxhostgl

Conversation

@techomancer

Copy link
Copy Markdown
Owner

No description provided.

atomchild411 and others added 3 commits October 13, 2026 08:37
Headless contexts in the compatibility profile through EGL, with no
surface at all (EGL_KHR_surfaceless_context): every drawable is already a
framebuffer object. The display is Mesa's surfaceless platform where
there is one, else the first EGL device, else the default. libEGL is
opened at run time; the entry points the crate calls by name come from
libGL (glvnd). A swap reads back with glReadPixels: there is no
CPU-addressable surface yet.

Looking entry points up by name needs a table. glvnd and Mesa answer any
gl* name with a callable stub, so a missing function never comes back
null, and Exec::func relies on null to fall back from an SGI or EXT name
to the core one. avail.rs, generated from the pinned registry by
tools/gl_avail.py, says which version or extension provides each name;
the backend looks a name up only when the context has it.

On Linux arm64 C's char is unsigned, so the shader entry points take
c_char, not i8.

Tested on Debian 12 arm64 in Parallels (virgl, OpenGL 4.0 compatibility,
Mesa 22.3.6): the crate's 27 tests pass, and in an IP28 IRIX 6.5.22
guest glcheck passes with the reference checksum.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The names the crate uses for itself started at 0x7F000000 and counted
up. Apple's GL hands a program the lowest free name, so that was safe
there; Mesa hands out one above the highest in use, so after a name of
ours it gave the program the next one we were about to take, and the
two were bound to different targets. gltest's SGIS_texture_filter4,
SGIS_sharpen_texture and SGIS_detail_texture checks failed on Linux
with GL_INVALID_OPERATION (glBindTexture target mismatch).

Counting down from u32::MAX leaves Mesa no "one above", and it goes back
to the lowest free name. gltest now passes 167/167 for n32 and o32 on
Linux; nothing changes on the Mac.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
FEATURES.md, iris-gui-README.md, iris-gui's build-info line and TODO.md
said host GL was macOS only. CHANGELOG: the EGL backend, what building and
running it need, and how it was tested. rules/hostgl/linux-egl-and-mesa.md:
the stub-for-every-name problem and avail.rs, Mesa's texture names, c_char,
and what is linked versus opened. The registry README names gl_avail.py.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@techomancer
techomancer merged commit 6f9887b into main Oct 13, 2026
6 checks passed
@techomancer
techomancer deleted the rebasedlinuxhostgl branch October 13, 2026 15:58
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