Efficiently filling the vertex buffer

Hi fellow devs,

I wonder what’s the most efficient way of filling the vertex buffer? I used one big buffer but filled it with a for loop iterating over thousands of meshes and calling VertexBuffer::SetData for each of them with an offset.

This was very slow. Then I tried to set the whole thing at once with about 512MiB of data. That was much faster. So I guess setting it in large chunks would be the best way to go. But where is the limit? What would be a good chunk size? What would be a good vertex buffer size?

Hope you’ve got some ideas : )


PS: Here are the resource limits in DX11.

plese man, can you help me here Error Monogame Templates on VS 2019?

Please do not ask in other topics about this. If anyone knows what to do, they will answer in the topic you created.

My vertices have a stride of 32 Byte. The Model is about 500MB large. If I can use Vertex Buffers of 128MB each, that means each buffer can store 4,000,000 vertices, right?