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

Support creating offscreen contexts using ANGLE #140

Merged
merged 2 commits into from Jul 10, 2019
Merged

Support creating offscreen contexts using ANGLE #140

merged 2 commits into from Jul 10, 2019

Conversation

@jdm
Copy link
Member

jdm commented Jul 10, 2019

This ensures that the GL functions are loaded from the appropriate DLL when EGL is in use, and that the right formats are selected based on GL/GLES rather than hardcoded by platform.

@jdm jdm force-pushed the win-webgl branch 3 times, most recently from bfa17ff to 4e55828 Jul 10, 2019
@jdm jdm force-pushed the win-webgl branch from 4e55828 to 8970633 Jul 10, 2019
Copy link
Member

asajeffrey left a comment

LGTM, not sue why we're passing API types by reference rather than by value, but that's just a matter of taste.

@@ -35,16 +35,16 @@ impl<Native> GLContext<Native>
api_version: GLVersion,
shared_with: Option<&Native::Handle>)
-> Result<Self, &'static str> {
Self::create_shared_with_dispatcher(api_type, api_version, shared_with, None)
Self::create_shared_with_dispatcher(&api_type, api_version, shared_with, None)

This comment has been minimized.

Copy link
@asajeffrey

asajeffrey Jul 10, 2019

Member

Nit: not sure it's worth making a reference here, copying a GlType shouldn't be that expensive?

This comment has been minimized.

Copy link
@jdm

jdm Jul 10, 2019

Author Member

Before gleam 0.6.18 the GlType type did not derive Copy.

// On OpenGLES 2 detect via extensions if the GPU supports RGB8 and RGBA8 renderbuffer/texture storage formats.
// GL_ARM_rgba8 extension is similar to OES_rgb8_rgba8, but only exposes RGBA8.
let has_rgb8 = api_version.major_version() >= 3 || extensions.iter().any(|s| s == "GL_OES_rgb8_rgba8");
let has_rgba8 = has_rgb8 || extensions.iter().any(|s| s == "GL_ARM_rgba8");

This comment has been minimized.

Copy link
@asajeffrey

asajeffrey Jul 10, 2019

Member

Gosh this is annoying code, not much we can do about it though!

@jdm
Copy link
Member Author

jdm commented Jul 10, 2019

@bors-servo r=asajeffrey

@jdm jdm merged commit 71b3537 into master Jul 10, 2019
4 checks passed
4 checks passed
Travis CI - Branch Build Passed
Details
Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.