Repository navigation
Rebasedlinuxhostgl - #224
Merged
Merged
Conversation
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]>
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.
No description provided.