-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Include GL extension fliter/allowlist if and only if its needed #20955
Conversation
fb6e4e6
to
e6e3bf2
Compare
e6e3bf2
to
efd32bc
Compare
efd32bc
to
c92754d
Compare
I measured the code size impact of this change for codebases that call glGetString but don't call GetProcAddress as 858 bytes of JS or 356 compressed JS. @juj, f you think we need a switch to make this less conservative we could add one perhaps. |
c92754d
to
5ee269f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
5ee269f
to
53ce9c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't agree with this PR. We should not land this, see #20798 (comment) for rationale.
LGTM to land if there is an opt-out for developers who statically know their code will not cause problems.
Although, won't this still leave this code path unattended? emscripten/src/library_webgl.js Lines 1205 to 1215 in 53ce9c7
|
Ah yes, I misunderstood that point of that callsite and assumed it wanted the unfiltered list |
2b2dedc
to
33bb5d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getting a bit deep into things for me. Since Jukka will have to review anyway I will just defer to him. Few small comments though.
33bb5d9
to
65f964c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
304c744
to
9e3c841
Compare
Here we use the JS library dependency mechanism to include this code only when its needed. Sadly this will end up being preset in almost all GL-using programs because most of them will end up using `emscriptenWebGLGet` (e.g. any app that calls `glGetInteger`, `glGetString`, etc) Fixes: emscripten-core#20798
9e3c841
to
ce7fe78
Compare
Could this change have broken the ...maybe they are just missing in this list? emscripten/src/library_webgl.js Lines 140 to 183 in c4d76b8
PS: explicitly calling:
...also doesn't seem to make those extensions visible via |
That is probably the problem. I thought I checked that this list had all the extensions I expected it to have from https://registry.khronos.org/webgl/extensions/, but I may have forgotten to check the community approved extensions in addition to the ratified ones. |
It this PR in particular? I assume if there are issues with the contents of the list then #20802 would be the root cause. This PR was mostly refactoring. |
Right, I didn't check which PR this was. I think it must have been that one. |
Thanks for looking into this, and apologies too for identifying the wrong PR. |
Here we use the JS library dependency mechanism to include this code only when its needed.
Sadly this will end up being present in almost all GL-using programs because most of them will
end up using
emscriptenWebGLGet
(e.g. any app that callsglGetInteger
,glGetString
, etc).The code size impact of this change (for codebases that call glGetString but don't otherwise
call GetProcAddress is 858 bytes of JS or 356 compressed).
Fixes: #20798