Skip to content

Conversation

@kg
Copy link
Contributor

@kg kg commented Dec 1, 2025

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.

@flibitijibibo
Copy link
Member

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.

@kg
Copy link
Contributor Author

kg commented Dec 2, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants