[D3D12] Multidraw, Resource binding

Started by
7 comments, last by Adam Miles 8 years, 8 months ago

In opengl there is something called multidraw, I was wondering if D3D12 has an equivalent? I didn't see one in the graphicscommandlist interface docs, am I missing something or is there no equivalent?

Also I'm starting to look into the source of the dynamic indexing example and looking at this (https://msdn.microsoft.com/en-us/library/windows/desktop/mt186614(v=vs.85).aspx) page. I was wondering how to handle resource binding tier 1 hardware? I am right in connecting Resource Binding Tiers and dynamic indexing right? or am I completely off base.

-potential energy is easily made kinetic-

Advertisement
re: multidraw, I think you mean "indirect drawing" which is indeed supported: https://msdn.microsoft.com/en-us/library/windows/desktop/Dn903925(v=VS.85).aspx

Sean Middleditch – Game Systems Engineer – Join my team!

re: multidraw, I think you mean "indirect drawing" which is indeed supported: https://msdn.microsoft.com/en-us/library/windows/desktop/Dn903925(v=VS.85).aspx

While there is an indirect version of multidraw, that is not what I was inquiring about. I was asking about the following: https://www.opengl.org/wiki/Vertex_Rendering#Multi-Draw having an equivalent in D3D12.

In regards to the resource binding tiers question, I just wanted to know if I need to bound check manually? And if I do go out of bounds what happens is the access clamped or will an error happen?

-potential energy is easily made kinetic-

No, there's nothing like glMultiDraw in D3D. You'd have to implement it yourself with a loop.
HOWEVER, as you aren't wandering off into user mode driver town every time you do a draw call, because you are recording them into a client side buffer, this isn't a bad thing.

MultiDraw, and its ilk, are pretty much there as an optimisation and would allow the driver to hit some faster paths because it knows, between draw calls, that you aren't changing state.

Useful in a client-server setup.
Useful in a high overhead setup.
Less useful in a thin API.

In fact with the executeindirect functionality of D3D12 (which gives you the ability to change some root signature constants, and indeed vertex and index buffer locations based on a buffer input) you can do practically more things with better functionality. (One thread writes a command list with N indirect calls, one thread (or the GPU!) writes a buffer with draw call information, bit of fence sync magics, and bam! loads of draws!).


In fact with the executeindirect functionality of D3D12 (which gives you the ability to change some root signature constants, and indeed vertex and index buffer locations based on a buffer input) you can do practically more things with better functionality. (One thread writes a command list with N indirect calls, one thread (or the GPU!) writes a buffer with draw call information, bit of fence sync magics, and bam! loads of draws!).

Yeah I agree, but I'm not ready for indirect drawing yet. I'm still acquainting myself to the basics of D3D12.

Any takers on resource binding tiers and out of bounds indexing?

-potential energy is easily made kinetic-

re: multidraw, I think you mean "indirect drawing" which is indeed supported: https://msdn.microsoft.com/en-us/library/windows/desktop/Dn903925(v=VS.85).aspx

While there is an indirect version of multidraw, that is not what I was inquiring about. I was asking about the following: https://www.opengl.org/wiki/Vertex_Rendering#Multi-Draw having an equivalent in D3D12.

In regards to the resource binding tiers question, I just wanted to know if I need to bound check manually? And if I do go out of bounds what happens is the access clamped or will an error happen?

No, there's nothing like glMultiDraw in D3D. You'd have to implement it yourself with a loop.

Take another look at the link that SeanMiddleditch posted. ExecuteIndirect *is* MultiDraw. It's wrong to suggest D3D12 has no MultiDraw equivalent, it's in fact even more powerful than GL's MultiDraw. I believe it's also possible for a single ExecuteIndirect to execute Draws and Dispatches within a single ExecuteIndirect.

Edit: That was a misreading of the documentation, it is not.

Adam Miles - Principal Software Development Engineer - Microsoft Xbox Advanced Technology Group

ExecuteIndirect is MultiDrawIndirect (glMultiDrawArraysIndirect, glMultiDrawElementsIndirect). MultiDraw (glMultiDrawArrays, glMultiDrawElements) is the simple version that D3D12 doesn't need because of the low draw overhead.

Right, I think I see what the OP was getting at now.

Adam Miles - Principal Software Development Engineer - Microsoft Xbox Advanced Technology Group

This topic is closed to new replies.

Advertisement