Skip to content

Commit

Permalink
SDL_GPU: Make upload command buffer operations thread-safe (#223)
Browse files Browse the repository at this point in the history
* 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
cryy22 authored Dec 7, 2024
1 parent ebcf916 commit 1cdafc1
Showing 1 changed file with 322 additions and 237 deletions.
Loading

0 comments on commit 1cdafc1

Please sign in to comment.