From 6730852e86774f94f5fe1b031f10cc81f1f99bb6 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Wed, 27 Nov 2019 12:18:00 +0100 Subject: [PATCH] [xna] Fixed another (not so apparent) bug in multi pass rending (item texture reference was cleared to null and added to free pool too early). See #1554. --- spine-xna/src/MeshBatcher.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spine-xna/src/MeshBatcher.cs b/spine-xna/src/MeshBatcher.cs index 2ed555391..338f03ccb 100644 --- a/spine-xna/src/MeshBatcher.cs +++ b/spine-xna/src/MeshBatcher.cs @@ -157,14 +157,17 @@ namespace Spine { Array.Copy(item.vertices, 0, vertexArray, vertexCount, itemVertexCount); vertexCount += itemVertexCount; - - item.texture = null; - freeItems.Enqueue(item); } FlushVertexArray(device, vertexCount, triangleCount); } public void AfterLastDrawPass () { + int itemCount = items.Count; + for (int i = 0; i < itemCount; i++) { + var item = items[i]; + item.texture = null; + freeItems.Enqueue(item); + } items.Clear(); }