-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
SDL3 GPU: SDL_DrawGPUIndexedPrimitivesIndirect sets instance count to 0? #11916
Comments
As an aside, the documentation for
|
Draw call in question https://github.com/libsdl-org/SDL/blob/main/src/gpu/vulkan/SDL_gpu_vulkan.c#L5383 Is it using the fake multidraw path maybe...? We have a test for this here: https://github.com/TheSpydog/SDL_gpu_examples/blob/main/Examples/DrawIndirect.c |
I'll try to trace it if I can too 👍 For now I can at least use the workaround with multiple draw calls. |
We don't have a lot of direct control over this behavior, we're basically just calling the vk function, so this is fairly surprising. The only thing I can think of on our end is that the memory barrier is incorrect but I just checked and that seems unlikely. Have you tried running this through RenderDoc and checking the parameter there? I'm almost suspicious of a driver bug but that would also be surprising. |
@thatcosmonaut I'd rather think it's me doing something that makes it do it :D
I'll try! I'm very new to graphics and don't know yet which tools are out there. Have just tried it on a Mac and it doesn't draw too with the indirect indexed call, but draws with the indexed primitive call 😬 Which increases the likelihood of user error. |
Definitely check out RenderDoc, it's incredibly useful: https://renderdoc.org/ |
I'm trying to use
SDL_DrawGPUIndexedPrimitivesIndirect
to draw some quads with a Vulkan backend. I have an indirect buffer setup with one instance ofSDL_GPUIndexedIndirectDrawCommand
that I populate like so:The in-memory array gets updated:
After that I upload the in-memory array to an
SDL_GPUBuffer
created withSDL_GPU_BUFFERUSAGE_INDIRECT
andsizeof(SDL_GPUIndexedIndirectDrawCommand)
, it gets uploaded without error.I try to draw the geometry as follows:
As a result, nothing gets drawn. Nvidia Nsight Graphics shows that the geometry itself loads correctly but instance count is zero:
As an alternative, I tried to draw exactly the same geometry on the very next line using
SDL_DrawGPUIndexedPrimitives
with exactly the same parameters I used for populating the indirect draw command - it was drawn without issue:I'm currently using the commit 82125ec.
The text was updated successfully, but these errors were encountered: