Jump to content
  • Advertisement
Sign in to follow this  
Xanather

Constant buffer or not?

This topic is 1395 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 am developing a simple 2D spriting engine. I was wondering if it would be a better idea to include matrix modelviewproj transformation data within the vertices themselves (will add an additional parameter to the vertex layout from CPU to GPU vertex shader) or simply use a constant buffer and change that constant buffer for each sprite.

 

From learning about Direct3D11 I find that you should try to minimze the calls to the GPU. If this is the case wouldn't packing the matrix data for each frame within the vertices themselves be a better idea? or would the extra bandwidth (matrix's cost alot of memory) for the extra parameter be too expensive?

Share this post


Link to post
Share on other sites
Advertisement
3rd alternative would be to transform the vertices on the CPU, so that there's no need to send matrices to the GPU at all. This also means you can draw all the sprites in a single draw-call...

Share this post


Link to post
Share on other sites

Thanks Hodgman, considering the limited amounts of Matrix multiplation for 2D spriting I think that may be the best solution.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!