Skip to content

Conversation

@juj
Copy link
Collaborator

@juj juj commented Feb 4, 2019

Fix WebGL context attribute handling for enableExtensionsByDefault and explicitSwapControl, and work around Chrome behavior that it does not return powerPreference in context attributes.

CC @kainino0x and @kenrussell (and @jdashg ) : it looks like when one creates a WebGL context with context attributes powerPreference field set in Chrome, and then later calls

var attributes = context.getContextAttributes();

on the created context, the returned attributes object does not have that powerPreference field. I don't know what the spec says if it should be there, but looks like in Firefox the powerPreference field is present.

This PR makes Emscripten return "default" as powerPreference if browser did not provide it.

Also adds unrelated quote fixes for Closure compilation.

…d explicitSwapControl, and work around Chrome behavior that it does not return powerPreference in context attributes.
@juj juj added the GL label Feb 4, 2019
@juj juj mentioned this pull request Feb 4, 2019
@juj
Copy link
Collaborator Author

juj commented Feb 4, 2019

Looks like this gets CI green, landing so that other PRs can truck along.

@juj juj merged commit dcf6dff into emscripten-core:incoming Feb 4, 2019
@kenrussell
Copy link
Collaborator

Looks good. Sorry that Chrome doesn't support powerPreference yet. We have been aiming to handle it in a more automatic way but it keeps getting pushed back due to higher priority issues.

@juj
Copy link
Collaborator Author

juj commented Feb 4, 2019

Ohh, the missing return was because there's no powerPreference at all yet, that makes sense :) thought the issue was just that getContextAttributes() did not return whatever was added. No worries, good to hear!

@juj juj deleted the webgl_chrome_fix branch February 6, 2019 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants