   DirectX11 - Vertex Buffers performance
  Hello CommunityIn my sparetime iam working on a DirectX 11 Render framework.Iam using VS2008 c++ and mfc/next.I have started to build an editor arround it and now iam at the pointwhere iam not sure how to handle some things.i have different vertex buffers where i insert mesh objects to.mesh objects of the same vertex format are merged into one vertex buffer.i have a class that handles offset of the insert mesh object so i can easylookup the information for a draw call.the last days i spend on thinking what would be an good solution to handledeleting of objects inside a vertex buffer.look at this situation:1..2..3..4..5..6..7..8..9..10..11..12..........each number stands for an mesh object inside the vertex buffer.a normal task in an editor is to delete objects like meshes etc.lets say i select mesh 5 and 6 and want it to delete it.to delete the information in the class that handles the mesh information isnot a problem.but how to handle the objects after the deleted meshes inside the vertex buffer ?i have few solutions in my mind but iam not sure if this is the correct way.1. re-align the objects behind the deleted meshes in the vertex buffer.that means i need to move the mesh objects to the new free position inside the vertex bufferand recalculate the new offsets of the mesh objects.i can do this realy simply with my framework.but iam wondering how the performance will be in a complex scene with ofcourse more then 100+ objectsthat shares the same vertex buffer.2.i just delete the objects from my internal class that handles the mesh offsets.and mark the new free memory inside the vertex buffer with the free avaible space.so on the next mesh object i insert into the vertex buffer i check just if there are some region free that i can use.if not i just insert the new object as normal into the vertex buffer.as you can see this kind of solution can fast end up in unused memory inside the vertex buffer.optional i was thinking to provide some kind of event information so the user knowsits time to start a function i provide to recalculate the buffer(s).3.having a background thread in a defined intervall that checks my mesh objects and look for objects that needto be recalulated and moved to the new position inside the vertex buffer.if objects need to realign in the vertex buffer i start some functions described in step 1 above.4.a very simple way is just to have for each object in the editor its own vertex/index buffer.but i dont like this idea and dont want to use it if possible.i hope it was not to hard to read since english is not my native language.thanks for reading.   
Quote:Original post by Grunty4.a very simple way is just to have for each object in the editor its own vertex/index buffer.but i dont like this idea and dont want to use it if possible.Why not? There's hardly going to be any benefit from packing multiple meshes into a single vertex buffer, and it's certainly not going to outweigh the headaches it will cause you.;  ok thanks for your answer MJP.i made some research on this topic and some people says yes some people no :)for bigger mesh objects it is good to use one buffer for each object.somewhere i read using smaller chunks of vertex buffers should be ok too.so i think i need to test some scenarios and look how my editor react on scenes with alot of different objects that are in view range and visibly.thank you.;  Packing multiple objects to common buffers is a performance optimization, purpose of which is to reduce needed device calls. At the start of a project, however, stability and robustness should be preferred over performance. That, and switching stream sources isn't very expensive on D3D11 if the buffers already reside in the GPU memory.   