Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for creating glutin EGL displays on Windows using Angle #1611

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

tronical
Copy link
Contributor

Angle provides libEGL.dll, which glutin loads. The only change necessary is to get the platform display via EGL_PLATFORM_ANGLE_ANGLE and treating it as a legacy display.

Fixes #1508

  • Tested on all platforms changed
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality

Copy link
Member

@kchibisov kchibisov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

It's sort of weird that Windows EGL was simply forgotten in the display creation, since I don't see any method touching RWHND for it...

glutin/src/api/egl/display.rs Outdated Show resolved Hide resolved
glutin/src/api/egl/display.rs Outdated Show resolved Hide resolved
glutin_egl_sys/src/lib.rs Show resolved Hide resolved
glutin/src/api/egl/display.rs Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@tronical
Copy link
Contributor Author

I'll push fixes to the review comments as follow-up patches. In the event that this finds approval in the end, I'd squash them into one, if that's okay.

Copy link
Member

@kchibisov kchibisov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition, could you post the screenshot of default example running on ANGLE (want to see output of example), so I could see how it works, given that I can't test it.

glutin/src/display.rs Outdated Show resolved Hide resolved
glutin/src/api/egl/display.rs Show resolved Hide resolved
@tronical
Copy link
Contributor Author

Proof ;)

Screenshot 2023-06-29 at 17 05 22

@kchibisov
Copy link
Member

@tronical oh, could it work in qemu setup or only vmware specific? Or where you using gpu passthrough for that?

@tronical
Copy link
Contributor Author

@tronical oh, could it work in qemu setup or only vmware specific? Or where you using gpu passthrough for that?

I'm using VMware's D3D drivers, those I think do pass-through to some extent. But in principle this should work absolutely anywhere, as D3D comes with the WARP software renderer. I think/hope that Angle falls back to selecting that if no other was found. Otherwise the angle extensions also allow to explicitly select a warp D3D device. This could be an interesting glutin API extension in the future.

Toolkits that use Warp often have some environment variable that allows users to explicitly opt into using warp.

Copy link
Member

@kchibisov kchibisov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good after cargo +nightly fmt.

@tronical
Copy link
Contributor Author

Formatting fixed and squashed.

Angle provides libEGL.dll, which glutin loads. The only change necessary
is to get the platform display via EGL_PLATFORM_ANGLE_ANGLE and treating it
as a legacy display.

Fixes #1508
@kchibisov kchibisov merged commit 5cfcb76 into rust-windowing:master Jun 29, 2023
43 checks passed
@kchibisov
Copy link
Member

Thanks!

@tronical tronical deleted the simon/angle-upstream branch June 29, 2023 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

ANGLE support
2 participants