Hello everybody!
Using Direct3D 11 you could use one dynamic vertex buffer for each pass of your sprite and line batch.
Using Direct3D 12 this is not the case anymore because you need to update the dynamic vertex buffer on your second pass of batch but this vertex buffer was not yet used for the rendering.
Is the best approach on Direct3D 12 to use a pool of vertex buffer which check if there is no free vertex buffer for this size of batch and create a new vertex buffer on the fly if it's the case?
Create a dynamic vertex buffer only require the device so you can create on the fly without issue and then use the map/unmap on it during your second pass of batch, but is it the good approach?
Thanks!
🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
[D3D12] Pool of vertex buffers for sprite and line batch?
Alundra said:
Is the best approach on Direct3D 12 to use a pool of vertex buffer which check if there is no free vertex buffer for this size of batch and create a new vertex buffer on the fly if it's the case? Create a dynamic vertex buffer only require the device so you can create on the fly without issue and then use the map/unmap on it during your second pass of batch, but is it the good approach?
what exact problem have u found when u do it this way in dx12?
I have two passes of batch of lines for example and since that uses the same vertex buffer but the two passes use different point vertices that gives an issue on the rendering at the final execution of the command list. With D3D11 it was not an issue because apparently D3D11 handle this case automatically or hide a performance issue using one vertex buffer.