bevy_render: Pass RawDisplayHandle to wgpu for compositor-aware Instance creation - #25647
Open
AlexanderStein wants to merge 1 commit into
Open
bevy_render: Pass RawDisplayHandle to wgpu for compositor-aware Instance creation#25647AlexanderStein wants to merge 1 commit into
RawDisplayHandle to wgpu for compositor-aware Instance creation#25647AlexanderStein wants to merge 1 commit into
Conversation
…Instance` creation EGL backend requires for the wgpu instance creation that a display handle is already passed through. This is necessary to detect which compositor (X11 or wayland) is used. This is achieved by creating a RawDisplayHandle upfront and store it as a resource inside RawDisplayHandleWrapper.
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.
This is an AI-assisted (GPT-5.5) update to #20358
With gfx-rs/wgpu#8782 integrated in wgpu-30 this PR doesn't depend on external changes, but just bevy.
EGL backend requires for the wgpu instance creation that a display handle is already passed through. This is necessary to detect which compositor (X11 or wayland) is used.
This is achieved by creating a RawDisplayHandle upfront and store it as a resource inside RawDisplayHandleWrapper.
Objective
Render creation using EGL on Wayland already requires a display handle upon context creation.
Solution
Create that RawDisplayHandle early, store it as a resource and pass it during render creation.
Testing
Command for test:
Note:
--no-default-featuresis necessary because the3dfeature raises a different GLSL problem in wgpu unrelated to this issue.Before
The line
indicates there is already a problem which causes to create a native-render EGL surface:
After
The important line is
showing that initialization detected a Wayland platform for which a EGL surface can be created: