Constant buffer or not?

Started by
1 comment, last by Xanather 9 years, 2 months ago

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?

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...

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

This topic is closed to new replies.

Advertisement