gfx-rs / gfx

[maintenance mode] A low-overhead Vulkan-like GPU API for Rust.
http://gfx-rs.github.io/
Apache License 2.0
5.35k stars 548 forks source link

Dynamic version detection for EGL #3591

Closed niklaskorz closed 3 years ago

niklaskorz commented 3 years ago

Fixes https://github.com/timothee-haudebourg/khronos-egl/issues/11 (is there an according issue in this repo?) PR checklist:

niklaskorz commented 3 years ago

Out of curiosity, why does gfx require EGL >= 1.4? All necessary functions (despite the ones used dynamically from 1.5) seem to exist on 1.2 as well. Then again, Android supports EGL 1.4 since Android 4.2, which has been released 2012, so I guess there's no value in supporting anything below (especially since those devices won't support GL ES 3 anyway).

kvark commented 3 years ago

@niklaskorz thank you for making this test and the PR! There is no particular reason we require EGL 1.4, the switch to EGL was done very recently, and I haven't done anything with it before, so it all could benefit from improvement :)

niklaskorz commented 3 years ago

Any reason this is a draft?

I'm still getting errors of EGL 1.5 symbols not being found in load_minimal, so I guess we'll have to wait for a reply from @timothee-haudebourg before undrafting

Gordon-F commented 3 years ago

@niklaskorz If I understand it right, OpenGL ES 3.0 context creation required EGL_KHR_create_context that been introduced only in EGL 1.4.

kvark commented 3 years ago

@niklaskorz If I understand it right, OpenGL ES 3.0 context creation required EGL_KHR_create_context that been introduced only in EGL 1.4.

Is this actually the case? Reading the spec (as well as multiple cases that can be found on the web) tells that:

EGL_CONTEXT_MAJOR_VERSION_KHR this token is an alias for EGL_CONTEXT_CLIENT_VERSION

So one can specify EGL_CONTEXT_CLIENT_VERSION to 3 (on EGL pre 1.4) for the same outcome, without requiring EGL_KHR_create_context.

niklaskorz commented 3 years ago

It's finally working on FireTV / Android <10! Now the only thing blocking this PR is https://github.com/timothee-haudebourg/khronos-egl/pull/12

https://user-images.githubusercontent.com/590517/104809623-e3c36b00-57ee-11eb-9f02-34a78d116f6e.mp4

niklaskorz commented 3 years ago

Please rebase and squash

Hm, I might have squashed too much, the PR diff looks weird now.

Edit: nevermind, forgot to rebase first, will do that in a moment Edit 2: all good now!

bors[bot] commented 3 years ago

Build succeeded: