Detect multithreaded use of common FNA3D operations with the SDL_GPU backend and assert in debug builds
Idea came up on discord. It's not safe to do multithreaded operations on the SDL_GPU backend even though it's guarded by a mutex (the explanation for why not is complicated and I've partially forgotten) so ideally anyone having trouble can run with a debug build of FNA3D and the asserts will help them spot the bug in their code.
The idea makes sense but we can possibly do this at a higher level; this can be done in FNA3D.c with a custom define that just checks the TID regardless of backend, and we can disable it by default in CMake.
The idea makes sense but we can possibly do this at a higher level; this can be done in FNA3D.c with a custom define that just checks the TID regardless of backend, and we can disable it by default in CMake.
AFAIK it is completely safe to do multithreaded FNA3D on the D3D11 backend, and the OpenGL backend will break horribly, so I'm not sure we need to do it. I'm not opposed to doing it in a backend-agnostic way though, it just seemed most important to do it for SDL_GPU since the hazard is invisible.