-
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
[wasm64] Fix reading/writing of gl attributes #21187
Conversation
58794a2
to
2cf0fd6
Compare
@@ -9,10 +9,9 @@ | |||
#include <cmath> | |||
#include <iostream> | |||
#include <vector> | |||
extern "C" { |
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.
A lot of these changes look unrelated?
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.
Yeah, I just cleaned up the test a little while I was working on it.
c8381c5
to
136a725
Compare
Sorry I had another change mixed up in here.. fixed now. Looking into avoiding the size regression somehow. |
src/library_html5_webgl.js
Outdated
HEAP8[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.antialias }}})] = | ||
HEAP8[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.premultipliedAlpha }}})] = | ||
HEAP8[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.majorVersion }}})] = | ||
HEAP8[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.enableExtensionsByDefault }}})] = 1; |
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 just way to set the low bit of each of these 32-bit values. We set the whole struct to 1 above.. then set these individual fields to 1.
Its a bit of a hack but it avoid the shift (which is the problem.
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.
Ah I see. This seems kind of fragile though, like it could easily get switched back. maybe it should at least have a comment.
src/library_html5_webgl.js
Outdated
HEAP8[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.antialias }}})] = | ||
HEAP8[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.premultipliedAlpha }}})] = | ||
HEAP8[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.majorVersion }}})] = | ||
HEAP8[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.enableExtensionsByDefault }}})] = 1; |
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.
Ah I see. This seems kind of fragile though, like it could easily get switched back. maybe it should at least have a comment.
e7ab4e3
to
1e40e2d
Compare
1e40e2d
to
56bb605
Compare
static void glut_draw_callback(void) { | ||
printf("glut_draw_callback\n"); |
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.
do we want to keep these printfs in the test?
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.
Sure, I think it better overall to have more print statements in the test.
Still not ready to land this until I can figure out how to avoid the size regression. |
Closing in favor of #21228 |
See #21177