prime31 / Nez

Nez is a free 2D focused framework that works with MonoGame and FNA
MIT License
1.78k stars 362 forks source link

FNA dynamic buffer warning: "Dynamic buffer using SetDataOptions.None, expect bad performance and broken output!" #743

Open TheDreadWolf opened 2 years ago

TheDreadWolf commented 2 years ago

I'm experimenting with using Nez with FNA. I created a single entity with a SpriteRenderer. Everything renders correctly, but the logs are spammed with "Dynamic buffer using SetDataOptions.None, expect bad performance and broken output!" every time the Draw function is executed. This error comes from the FNA3D.dll but this line in Batcher.cs triggers it: _vertexBuffer.SetDataPointerEXT(0, (IntPtr)p, _numSprites * VertexPositionColorTexture4.RealStride, SetDataOptions.None); I'm fairly certain that this error is caused by creating a dynamic buffer but not using enough data to fill it, since if I set MAX_SPRITES to 1, the warning goes away. Should I be concerned about this warning and is there anything I can do to get rid of it?