You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's my situation:
I have a draw call that uses tessellation shaders. Everything is working.
If I write the VkDrawIndirectCommand corresponding to my call to a buffer, and replace vkCmdDrawIndexed with vkCmdDrawIndexedIndirect pointing to this buffer, the object no longer renders.
Debugging with XCode shows that my indirect buffer indeed contains the correct data. The problem comes from the fact that all the elements in the geometry of the object (the tessellation evaluation shader input) are identical.
Digging a bit into what MoltenVK is doing, it seems that it's because the MVK-injected compute shader that executes cmdDrawIndexedCopyIndex32Buffer has a workgroup size of 0, and thus all the indices in the index buffer remain at their initial value of 0, and thus the MVK-injected compute shader that later generates the tessellation evaluation shader input repeatedly copies vertex element 0 over the entire vertex data.
I have the impression that this workgroup size is supposed to be written here. However, destVTX points to offset 12 of destBuf, while the shader that executes cmdDrawIndexedCopyIndex32Buffer later reads its indirect calls from offset 0 of that same buffer. Offset 0 is where destSI is located.
Maybe I'm misunderstanding what MoltenVK is doing here, but I suspect that there's a bug somewhere with these offsets and that the workgroup size is supposed to read from destVTX?
MoltenVK version: 1.2.11
The text was updated successfully, but these errors were encountered:
tomaka
changed the title
Vertex indices seem invalid when using indexed draw with tessellation
Vertex indices seem invalid when using indexed indirect draw with tessellation
Oct 13, 2024
Here's my situation:
I have a draw call that uses tessellation shaders. Everything is working.
If I write the
VkDrawIndirectCommand
corresponding to my call to a buffer, and replacevkCmdDrawIndexed
withvkCmdDrawIndexedIndirect
pointing to this buffer, the object no longer renders.Debugging with XCode shows that my indirect buffer indeed contains the correct data. The problem comes from the fact that all the elements in the geometry of the object (the tessellation evaluation shader input) are identical.
Digging a bit into what MoltenVK is doing, it seems that it's because the MVK-injected compute shader that executes
cmdDrawIndexedCopyIndex32Buffer
has a workgroup size of 0, and thus all the indices in the index buffer remain at their initial value of 0, and thus the MVK-injected compute shader that later generates the tessellation evaluation shader input repeatedly copies vertex element 0 over the entire vertex data.I have the impression that this workgroup size is supposed to be written here. However,
destVTX
points to offset 12 ofdestBuf
, while the shader that executescmdDrawIndexedCopyIndex32Buffer
later reads its indirect calls from offset 0 of that same buffer. Offset 0 is wheredestSI
is located.Maybe I'm misunderstanding what MoltenVK is doing here, but I suspect that there's a bug somewhere with these offsets and that the workgroup size is supposed to read from
destVTX
?MoltenVK version: 1.2.11
The text was updated successfully, but these errors were encountered: