Jump to content
  • Advertisement
Sign in to follow this  
Quat

Instancing Data Source: IA, cbuffer, or structured buffer

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

I'm adding instancing support, but it looks like there are a few options to get my instancing data:

 

1. Stream in per-instance data as part of input assembly stage.

2. Use instance ID to index into a constant buffer or structured buffer with the instance data.

 

Is one better than the other as far as performance?

 

Share this post


Link to post
Share on other sites
Advertisement
Any performance difference would be hardware-specific. In some hardware there may not even be any difference between the three methods. I would suggest doing whatever makes the most sense for your engine. Personally I like using structured buffers, and doing any special logic for instance data in the vertex shader.

Share this post


Link to post
Share on other sites

I have noticed that cbuffer arrays can cause slower shader compiling. Bigger the array longer the compile time and this scales linearly. I needed to switch to tbuffers just to make iteration times sane. 

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!