-
Notifications
You must be signed in to change notification settings - Fork 968
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
draw_indexed_indirect on DX12 doesn't handle non-zero base_instance #2471
Comments
Doesn't look like Dawn has this implemented either - https://bugs.chromium.org/p/dawn/issues/detail?id=548&q=548&can=2 |
I concluded the research here. Good example code can be found in d3d functional spec. Unfortunately, we can't just re-use the start instance you have in the draw structures. The indirect command signature requires this value to be placed separately in a draw structure... So the only way around for us is to copy your draw structure into one we temporarily create, so that we can also copy the start instance. This was the bad news. I definitely didn't want to involve a copy of indirect arguments here... |
Dawn has fixed that bug. |
We should remember to also remove |
Dx12 non-zero base_instance actually works but the result is just not exposed in the shader. Before this issue get fixed, one way to workaround is to manually generate(by compute shader) a base_instance buffer and bind it as an instance vertex buffer. |
remove incompatible windows & rust testing (for now). Refer to: gfx-rs/wgpu#2471
remove incompatible windows & rust testing (for now). Refer to: gfx-rs/wgpu#2471
This has a lower priority than #2431 but I will work on it right after draw indirect validation since it will be easier to do while I still have that context. |
Description
DrawIndexedIndirect.base_instance
is always 0 in the shader when usingdraw_indexed_indirect
on DX12, regardless of the value provided. This works on Vulcan and Metal. Setting theINDIRECT_FIRST_INSTANCE
flag doesn't help.Platform
wgpu 0.12.0, Windows DX12
(Filed this issue by request from @kvark from a discussion in the matrix chat)
The text was updated successfully, but these errors were encountered: