clementlandrin 5 months ago
parent
commit
1bdd09cd1a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      h3d/scene/MeshBatch.hx

+ 1 - 1
h3d/scene/MeshBatch.hx

@@ -505,7 +505,7 @@ class MeshBatch extends MultiMaterial {
 				if( p.instanceBuffers == null ) {
 					var count = hxd.Math.imin( instanceCount - p.maxInstance * bufferIndex, p.maxInstance );
 					instanced.setCommand(p.matIndex, instanced.screenRatioToLod(curScreenRatio), count);
-					if ( p.commandBuffers != null && p.commandBuffers.length > 0 ) {
+					if ( useCommandBuffer() ) {
 						@:privateAccess instanced.commands.data = p.commandBuffers[bufferIndex].vbuf;
 						@:privateAccess instanced.commands.countBuffer = p.countBuffers[bufferIndex].vbuf;
 					}