Jump to content
  • Advertisement
Sign in to follow this  
Infinisearch

OpenGL [D3D12] Multidraw, Resource binding

This topic is 1077 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

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?

Share this post


Link to post
Share on other sites
No, there's nothing like glMultiDraw in D3D. You'd have to implement it yourself with a loop.

Share this post


Link to post
Share on other sites
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!).

Share this post


Link to post
Share on other sites


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?

Share this post


Link to post
Share on other sites

 

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.

Edited by ajmiles

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!