A have question about Vertexbuffer lock and unlock. A have testing one big buffer with .unlock(count) and several buffers with different sizes.
With big buffer i upload all vertex data and if there is changed pipeline or texture i upload data with unlock(count) and drawIndexed with number of indices. And have bad performance if there is many draw calls on native target, especially on android.
But when i have buffers with different sizes like 512, 1024... and choose them based on vertices count for this draw call, i have much better performance. But i have to do another step of uploading vertices in big array to count witch buffer size i need to choose.
My question is, i'm doing something wrong with one buffer approach? Cause in sources i see that native target use bufferSubData to upload vertex data. Or maybe i misunderstand how to implement batch render propertly.
-
Batch rendering g4
-
Batch rendering g4
There is with big buffer rendering https://github.com/clay2d/clay/blob/2d4ed257860d466952397ed7257dda05632f9970/clay/render/RenderContext.hx#L360
And with different buffers
https://github.com/clay2d/clay/blob/master/clay/render/RenderContext.hx#L359I have tested in huawei p30, and windows dx11.
I didn't have exact numbers, i will test it again without this bloated framework stuff. -
Batch rendering g4
I tested huawei p30, xiaomi redmi note 5, and pocophone f1.
Only my huawei have weird frame drops, and gain from different vertex buffer sizes.
Windows dx11 and web is perfect.
Sorry about it. Its just my phone.
There is the code if needed