1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-05-03 08:45:15 +02:00

don't draw empty vertex buffers

This commit is contained in:
Ell 2021-10-19 17:20:00 +02:00
parent 6f04b30591
commit 08bd443c36

View file

@ -149,6 +149,8 @@ namespace MLEM.Misc {
var totalIndex = 0;
foreach (var buffer in this.vertexBuffers) {
var tris = Math.Min(this.vertices.Count - totalIndex, buffer.VertexCount) / 4 * 2;
if (tris <= 0)
break;
this.graphicsDevice.SetVertexBuffer(buffer);
if (effect != null) {
foreach (var pass in effect.CurrentTechnique.Passes) {