SDL_gpu - handling heavy compute passes

Hello!

I’m working on a mesh voxelizer and need to run a large compute workload in the background (it doesn’t fit in a frame, takes up to a second currently). I’d like to know if it’s actually possible to execute compute and graphics tasks in parallel with SDL. I first tried using separate command buffers, but the passes still ran sequentially for some reason, blocking the whole app. I found that DX12 support async compute, but I haven’t seen anything similar in SDL, so I’m not sure whether this is simply unsupported or if i’m accidentally blocking shared resources or something. A possible workaround would be to split the compute job into smaller chunks, but new to this so id like to confirm whether that’s actually necessary.

1 Like

The underlying APIs like DirectX 12 and Vulkan do have this capability, but I don’t think SDL GPU exposes any abstractions to execute command buffers in parallel.

SDL_SubmitGPUCommandBuffer has explicit guarantees of somewhat-sequential execution in the docs:

All commands in the submission are guaranteed to begin executing before any command in a subsequent submission begins executing.

1 Like