[wasm64] Fix reading/writing of gl attributes#21187
[wasm64] Fix reading/writing of gl attributes#21187sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
Conversation
58794a2 to
2cf0fd6
Compare
| #include <cmath> | ||
| #include <iostream> | ||
| #include <vector> | ||
| extern "C" { |
There was a problem hiding this comment.
A lot of these changes look unrelated?
There was a problem hiding this comment.
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.
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.
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.
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.
do we want to keep these printfs in the test?
There was a problem hiding this comment.
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