| Summary: | SDL OpenGL window permenantly black on second thread when inited later in the program on Mojave | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Daniel Bokser <dan.bokser> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED WONTFIX | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | amaranth72, dan.bokser, icculus, marcus.zetterquist, sezeroz |
| Version: | 2.0.9 | ||
| Hardware: | x86_64 | ||
| OS: | Mac OS X (All) | ||
| Attachments: |
Test program
(maybe) Simplified test program Very simple demo of problem, as described in my post. |
||
Clarification: >while I have confirmation that this exact program works on High Sierra should be >while I do NOT have confirmation that this exact program works on High Sierra Created attachment 3394 [details]
(maybe) Simplified test program
I've been working on this for hours and hours, and I can't coerce this to work. If LATE_INIT is zero, it works, if it's one, it doesn't.
Same result with SDL's render API (USE_RENDERER 1) or just using OpenGL from two threads, so it's not an SDL renderer bug.
I think it's a macOS bug, honestly. I haven't found a workaround, beyond creating all the contexts upfront.
Ah that sucks. Maybe I will try to file a bug with Apple, even though it will probably be futile. For some reason even after uninstalling Xcode 10 and installing Xcode 9, it still seems linking to the Xcode 10 libs, so gotta figure that out now. Thank you very much for trying! I have similar problem while running *one* thread. See super-simple "test3.cpp". If I call SDL_PollEvent(), then drawing wont happen. I need to manually move window first. Found another similar report on stackoverflow: https://stackoverflow.com/questions/51992402/sdl-pollevent-prevents-render-unless-window-moved-or-resized This may be a showstopper on Mojave. I'm just starting using SDL so I might missed something though. In test program, "#if 1" will give me black window. "#if 0" will give me a blue window. Created attachment 3403 [details]
Very simple demo of problem, as described in my post.
Are you using the latest SDL source code? There was a separate bug report for that which had some fixes go into SDL recently: https://bugzilla.libsdl.org/show_bug.cgi?id=4272 I'm using stable 2.0.8. True, my problem does indeed seem to match bug 4272 better. Sorry for noise. Please reopen this bug if it isn't fixed in 2.0.9. Thanks! Confirmed that this bug is not fixed in 2.0.9. (In reply to Daniel Bokser from comment #9) > Confirmed that this bug is not fixed in 2.0.9. I think Sam was talking to Marcus (who was reporting the same issue as Bug #4272) ... the initial bug reported here is believed to be a macOS Mojave bug, and beyond our control, at least with current beliefs. If a workaround is found, I'm happy to revisit, but right now I'm out of ideas. --ryan. |
Created attachment 3392 [details] Test program When a SDL OpenGL window is opened after an SDL_PollEvent, and is rendered on a second thread in macOS Mojave, the window is permanently black. I have attached a sample program with this structure. This program works fine in Linux and while I have confirmation that this exact program works on High Sierra, my SDL project which has this structure worked fine on High Sierra. This occurs with all latest fixes on 2.0.9