devkitPro / citro3d

Homebrew PICA200 GPU wrapper library for Nintendo 3DS
zlib License
248 stars 35 forks source link

C3D_SafeDisplayTransfer causes freezes in "next" branch. #34

Closed ghost closed 7 years ago

fincs commented 7 years ago

Thank you for reporting. I will investigate.

fincs commented 7 years ago

I've looked a bit at the FBI source code, and noticed that you are using the safe transfer functions in a separate thread. These functions have never been intended to be used outside the main (graphics) thread, therefore it kind of surprises me that it ever worked. One thing that changed in next is the fact that GX commands are now queued and sent asynchronously (as opposed to before). The "safe" functions have to completely stop the queue, flush any remaining commands, disable the queue, submit the command and when it finishes executing, reenable everything. Multiple threads trying to submit GX commands at the same time has always been a recipe for disaster. As an alternative you may want to instead convert the tiles in software, which is what hbmenu does in its own worker thread.