LATX, fix: Add missing EGL and GL proc-address wrappers - #399
Merged
LaurenIsACoder merged 1 commit intoAug 15, 2026
Merged
Conversation
Bridge eglQueryDeviceBinaryEXT in both the direct EGL table and the shared GL proc-address table. Add the OpenGL and OpenGL ES entry points exposed by the Linux Mesa stack, plus platform-neutral EXT mesh and framebuffer-layer entry points missing from Box64. Existing ARB/EXT alias fallback continues to cover unsuffixed core names. Signed-off-by: Hanlu Li <heuleehanlu@gmail.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.
Background
KZT allows an x86 guest to use the native host EGL and OpenGL libraries.
Normal exported functions can be wrapped when the library is loaded, but many
EGL and OpenGL extension functions are obtained dynamically through
eglGetProcAddress()orglXGetProcAddress().The dynamic path is:
Passing through
libEGL.so.1is therefore not sufficient by itself. A nativeLoongArch function pointer cannot be called directly by x86 guest code; LAT
must know its arguments and return type before it can create the bridge.
Problem
The host EGL implementation returned a valid pointer for
eglQueryDeviceBinaryEXT, but LAT had no wrapper entry describing thefunction.
eglGetProcAddress()could find the native function, but LAT could not createa safe guest-callable bridge. This made the function unavailable to the guest
even though the host EGL implementation advertised the extension, causing
Wine graphics initialization to fail with KZT enabled.
The missing component was not
libEGL.so.1itself. It was the ABI descriptionrequired to bridge a function discovered dynamically at runtime.
Change
eglQueryDeviceBinaryEXTto both the direct EGL wrapper table and theshared EGL/GL proc-address table.
proc-address wrapper table.
points missing from both LAT and the Box64 reference table.
ARB/EXTalias fallback where it already resolvesan equivalent entry point.
The Khronos registries are treated as the API authority. Box64 is used only as
a cross-check; a difference from Box64 is not automatically treated as a LAT
defect.
Scope
This PR targets a Linux host running x86 Linux applications and Windows
applications through Wine.
Android-specific and unsupported mobile-platform interfaces are excluded.
Wayland EGL interoperability functions are also excluded because they require
Wayland object conversion, not only function signatures.
Validation
latx-x86_64build: PASSARB/EXTfallback
interfaces outside the current wrapper-family scope
git diff --check: PASS