Sign in to follow this  

Instancing Data Source: IA, cbuffer, or structured buffer

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

This topic is 822 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this