-
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
Point SDL2 port at upstream #15452
Point SDL2 port at upstream #15452
Conversation
Very exciting! I guess this means we can/should archive the https://github.com/emscripten-ports/SDL2 repository? The codesize failures should go away with a rebase. test_webgl_context_attributes looks like maybe a real failure? |
@@ -110,7 +110,5 @@ int main(int argc, char* argv[]) { | |||
|
|||
glDeleteTextures(1, &texture); | |||
|
|||
SDL_Quit(); |
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.
Why remove these calls/
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.
Otherwise all windows get destroyed and the tests fail because the canvas is gone (well, 0x0).
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.
So have these tests been failing forever?
Can we perhaps land all these test fixes separately (first), since they seem independent of the SDL2 update?
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.
I think these were passing with the old version, so something may have changed there. I can split the test fixes out though.
(The testfullscreen one has likely been failing for a while.)
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.
I did slightly worry that we have a behavioral change here? My understanding is that switching to upstream SDL would essentially be a no-op but this seem to contradict that.
Can you explain a little more what you mean by "tests fail because the canvas is gone (well, 0x0)."? Is this test run as part of CI? i.e. would reverting this part of the change cause CI to fail?
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.
I see, thanks for clarifying. Makes sense. Could you replace these with a comment maybe // Exiting without calling SDL_Quit so the test framework can the canvas data
(or something like that.. I'm not sure I have the working corret.
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, some of the other tests already have something like that:
emscripten/tests/sdl2glshader.c
Line 169 in df034c9
// Don't quit - we need to reftest the canvas! SDL_Quit(); |
Must have been missed in these ones due to the missing SDL_Init
and the bug in quit... will update
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.
Maybe also a good idea to add a changlog entry for this? Both in general for the change to use latest upstream, and specifically for this noticeable issue.
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.
Ooh, yeah +4 SDL releases is probably worth a changelog entry! I'll try to come up with something...
(note that the issue here is only noticeable if you don't call SDL_Init
but do call SDL_Quit
... otherwise it happened a few updates ago)
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.
I see, thanks! Yeah, I guess the breaking change here is not that important to mention then. But the +4 versions is 😄 Any positive highlights that people might notice could also be worth mentioning briefly in the log.
@@ -136,7 +136,7 @@ int main() { | |||
/* SDL 1 limits which events can be used here. | |||
* Click and mouseup don't work. | |||
*/ | |||
if (emscripten_set_mouseup_callback(NULL, NULL, 1, mouseup) != EMSCRIPTEN_RESULT_SUCCESS) { | |||
if (emscripten_set_mouseup_callback("#canvas", NULL, 1, mouseup) != EMSCRIPTEN_RESULT_SUCCESS) { | |||
printf("Couldn't to set mouse callback. Test failed.\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.
Add return 1;
here?
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.
Done.
tools/ports/sdl2.py
Outdated
TAG = 'version_24' | ||
HASH = '5a8181acdcce29cdda7e7a4cc876602740f5b9deebd366ecec71ae15c4bbf1f352da4dd0e3c5e0ba8160709dda0270566d64a6cd3892da894463ecf8502836aa' | ||
SUBDIR = 'SDL2-' + TAG | ||
TAG = '5b646cd19e36e02c658fcbf792721b5bdce8491f' |
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.
Is there some tag we could use here? I wonder if upstream could mind tagging a release so that we could point to something here?
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.
Hmm, there will be a tag when 2.01.8 releases. Until then there isn't a released version with all the downstream changes. (Mostly missing timers without threads)
EDIT: might need to change this anyway, the config.h needs a fix.
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.
OK, sgtm to use the raw hash for now then. Perhaps add a TODO to update to 2.01.8 once it is released?
b0d2127
to
e6928b1
Compare
Ah, I didn't see that that test had a SDL2 variant. I'll go see what's going on there... |
Seemed to be some conflict between the GL context the test was creating and the one SDL was creating internally for its renderer (probably the fact that they end up being the same context). Since that test was only using GL and none of the SDL render APIs, I just removed the call to |
5d6ddcc
to
cb97752
Compare
238471b
to
5fd9b83
Compare
2.0.18 has been released now, so updated to use the tag. Also rebased. |
This destroys the window on newer SDL, causing the tests to fail as the rendered result is gone.
Seems some state from the renderer is causing the context created later to not draw anything. This test doesn't use the renderer API anyway, so remove it.
d969171
to
7ea9bff
Compare
@Daft-Freak I am very excited about this change. Do you have any update on when this can be merged and deployed? |
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. Looks like the there is conflict that needs resolving but otherwise I think we can land.
Thank you everybody for working on this! @kripken Can we pull this change yet somehow, or do we have to wait for the next official release build to update our EMSDK? |
You can try it now by installing |
Everything should be there now. This is also an update from 2.0.10 to 2.0.17 git from this morning.
Required some minor test updates, looks like
togglefullscreen
has been broken for a while though.