Greetings,
I'm thinking about rendering 2d quads. I'll try to write the ways I know with pros and cons. But I hope that more experienced guys will fix me if I wrong and will add another methods. Important note - I need to calculate data on cpu, so I think gpgpu will not help me.
1. Every quad is a separate object with it's own vertex buffer. For rendering will be used DrawIndexed(6, 0, 0). For position/size/rotation change we need to recreate buffer from scratch. Worst method in my opinion.
2. Every quad is a separate object with it's own dynamic vertex buffer. For rendering also will be used DrawIndexed(6, 0, 0). For position/size/rotation change we need to update buffer from. If there's a lot of sprites updating a lot of dynamic buffers will kill performance (will it? never tried).
3. Use one big vertex buffer for n quads. Since recreating such a big buffer from scratch every frame is not a good idea, let's use dynamic vertex buffer. The huge win is that we're calling DrawIndexed() only once. But again, updating such a big buffer will be slow, right?
4. Use one big vertex buffer for n quads. Render all quads in one draw call. For position/size/rotation we need to provide n matrices with constants buffers. The number of quads in one draw call is limited with number of matrices we can pass. I don't know how efficient is this. As far as I know passing constant buffers is not efficient. We can pass position point and expand to quad in geometry shader.
5. Use instancing. Have no idea about this, never tried.
Can you correct me or add something different?