Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDL_GPU: Make upload command buffer operations thread-safe (#223)
* Gate copy pass access and associated metadata behind a corresponding copy pass mutex * Adding upload commands to the copy pass locks the mutex until the command is added and metadata is updated * Mutex is locked when the upload command buffer is submitted; new command buffer is acquired and copy pass begun before mutex is unlocked * In copy pass-exclusive methods (e.g. SetTextureData), when a command flush is required, only flush the upload command buffer so as to avoid interfering with the render command buffer. * Always flush the upload command buffer before any render command buffer submissions (and lock the mutex) * No mutex for render command buffer access; assume that all render ops are scheduled and run by the main thread only
- Loading branch information