-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make upload command buffer operations thread-safe #223
Conversation
I have threaded uploads (disabled because they currently crash on SDL_GPU) so i'll try and test with this ASAP. |
Will test with TMNT and SOR4 soon! |
Looks like the CI failures are just the SDL3 beta tag being old - we should ask Sam to tag another preview release. In the meantime, the Linux SDL3 test branches on Steam for both TMNT and SOR4 have been updated with this draft. |
Looks like we're just barely off; changing this to 3.1.6 should fix it? https://github.com/FNA-XNA/FNA3D/blob/master/.github/workflows/ci.yml#L7 |
Man, SDL3 releases are a mess right now... I'll take care of this on my end, sorry!! |
Latest upstream fixes CI. I can also take the .gitignore changes as a separate patch while we review the GPU changes. |
b533923
to
70c2bed
Compare
rebased on upstream/master. gitignore patch!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes overall lgtm - basically all I can think of is rearranging stuff to shrink the size of the diff, but I'll happily take a larger diff if we get better organization out of it.
@flibitijibibo sweet! the main organizational change was just moving BeginCopyPass, EndCopyPass, BeginRenderPass, and EndRenderPass into the same general location. still ended up a little messy due to their dependencies on other functions and each other, so i'm perfectly happy to put em back in the interest of continuity if you prefer, let me know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran through the changes in more detail and the new arrangement is definitely better, just one nit and I'll go ahead and merge so fnalibs-dailies can have this for QA!
this PR resolves a compatibility issue where projects that use threading for GPU copy operations would sometimes crash due to thread contention when using the SDLGPU driver. the contended resources were the upload and render command buffers and associated copy/render passes, and corresponding metadata.
this PR resolves the issue with the following approach:
to test this implementation, i ran the following ruby script:
n_test.rb
the script opens Celeste and waits for it to print
DONE LOADING
on stdout, kills the program and does it again, n times. if the program encounters an error it prints stderr and exits.initially, i ran this against an FNA3D build from the current
master
branch. Celeste crashed on startup roughly 10% of the time with expected errors (e.g. "Command buffer already submitted!", "Cannot acquire a swapchain texture during a pass!"). with an FNA3D build from this PR, i ran this script with n=500 without any failures.submitting as a draft because i would like to see a successful test against another FNA game known to use threaded uploads at startup. i am working on testing TMNT but it requires a new dev environment (no mac builds), so assistance would be appreciated. please note that the script above is hard-coded to work with Celeste only as it depends on the specific
DONE LOADING
stdout line that i am pretty sure originates from the Celeste codebase.