Jump to content
  • Advertisement

3D [Metal] vertex_id value when using indirectBuffer

This topic is 401 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

What is the value of the vertex_id attribute in a metal shader when using drawPrimitives with indirectBuffer?

I know it is relative to baseVertex when using normal draw but how does it work with indirect draw arguments?

It doesn't say anything in the spec so any info on this would really help.

Thank you.

Edited by mark_braga

Share this post

Link to post
Share on other sites

It is the same, it starts at zero.


At the metal level, if you look for ISA in PIX (if using DX12 and AMD), you would see that the shader receive the offset in a scalar register and the vid is just auto generated value, and it sums them prior to fetching the buffer values. Something nice on Consoles, we can so know both 0 based and absolute. On PC, we only have the later :(



Share this post

Link to post
Share on other sites

  • 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!