Fix stb_image optimization bug with gcc 15.2.0#6927
Conversation
CoolSpy3
left a comment
There was a problem hiding this comment.
I haven't reviewed the underlying change in-depth, but it makes sense at a high level, so I'm not opposed to merging this in until stb approves the change to be merged upstream. Out of curiosity, does this fix #6909, or is this a different rendering bug?
I do want to verify that Webots builds against this new version of stb (as it looks like there have been some other changes since then), but if so, this is good to merge.
|
Hmmm. Looks like the Windows test suite is failing (I ran it twice) because Python can't find |
Yes, I believe it does as I saw exactly the same kind of weird images appearing randomly (in a non reproducible way). |
Unfortunately, I tested this and that bug still appears on my machine when building from this branch, so the root cause is probably something else. I also did some basic playing around with the test suite, and it works for me locally. In CI, it looks like the dll load is using an absolute path to the Again tho, I doubt that it's a problem related to the stb change. Update: I did a clean build and now it looks like the above issue might be fixed 👀 I'll try to do some better testing later to see for sure. Exciting (for me) if true tho :D Update 2: After doing some better testing, this does appear to be fixed! Amazing :D Idk how you even thought to test for a single-platform, optimization-based bug in an external library, but kudos! |
|
On my local Windows 11 machine, this PR breaks some tests in the test suite. I am investigating why. |
It turns out I had this problem in my development environment as well. I propose this fix. |
I found out that the bug was only showing up in release mode, not in debug. The bug was actually showing up with gcc |
|
Wow! Awesome! Thanks for the explanation! I'll keep some of those tricks in mind for the future 👀 |
This PR fixes a random 3D rendering bug showing up on some Windows 11 (GeForce RTX 3060) in release mode (not in debug). It appears to be caused by gcc 15.2.0 failing to optimize some weird code (with some goto inside a loop) in stb_image.h. See nothings/stb#1884 for details.
This patch is temporary and should be removed whenever nothings/stb#1884 gets merged.
Fixes #6909.