瀏覽代碼

DX12 : Fix ExecuteIndirect offsets

TothBenoit 4 月之前
父節點
當前提交
531ad436b8
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      h3d/impl/DX12Driver.hx

+ 1 - 1
h3d/impl/DX12Driver.hx

@@ -2455,7 +2455,7 @@ class DX12Driver extends h3d.impl.Driver {
 			if ( commands.countBuffer != null )
 				transition(commands.countBuffer, INDIRECT_ARGUMENT);
 			flushTransitions();
-			frame.commandList.executeIndirect(indirectCommand, commands.commandCount, commands.data.res, commands.offset, commands.countBuffer != null ? commands.countBuffer.res : null, commands.countOffset);
+			frame.commandList.executeIndirect(indirectCommand, commands.commandCount, commands.data.res, commands.offset * InstanceBuffer.ELEMENT_SIZE, commands.countBuffer != null ? commands.countBuffer.res : null, commands.countOffset * 4);
 		} else {
 			flushTransitions();
 			frame.commandList.drawIndexedInstanced(commands.indexCount, commands.commandCount, commands.startIndex, 0, 0);