/// <summary> /// Draw indexed, instanced primitives. /// </summary> /// <param name="primitiveType">Type of the primitive to draw.</param> /// <param name="indexCountPerInstance">Number of indices read from the index buffer for each instance.</param> /// <param name="instanceCount">Number of instances to draw.</param> /// <param name="startIndexLocation">The location of the first index read by the GPU from the index buffer.</param> /// <param name="baseVertexLocation">A value added to each index before reading a vertex from the vertex buffer.</param> /// <param name="startInstanceLocation">A value added to each index before reading per-instance data from a vertex buffer.</param> public void DrawIndexedInstanced(PrimitiveType primitiveType, int indexCountPerInstance, int instanceCount, int startIndexLocation = 0, int baseVertexLocation = 0, int startInstanceLocation = 0) { PrepareDraw(primitiveType); NativeDeviceContext.DrawIndexedInstanced(indexCountPerInstance, instanceCount, startIndexLocation, baseVertexLocation, startInstanceLocation); FrameDrawCalls++; FrameTriangleCount += (uint)(indexCountPerInstance * instanceCount); }
/// <summary> /// Draw indexed, instanced primitives. /// </summary> /// <param name="primitiveType">Type of the primitive to draw.</param> /// <param name="indexCountPerInstance">Number of indices read from the index buffer for each instance.</param> /// <param name="instanceCount">Number of instances to draw.</param> /// <param name="startIndexLocation">The location of the first index read by the GPU from the index buffer.</param> /// <param name="baseVertexLocation">A value added to each index before reading a vertex from the vertex buffer.</param> /// <param name="startInstanceLocation">A value added to each index before reading per-instance data from a vertex buffer.</param> public void DrawIndexedInstanced(PrimitiveType primitiveType, int indexCountPerInstance, int instanceCount, int startIndexLocation = 0, int baseVertexLocation = 0, int startInstanceLocation = 0) { PrepareDraw(primitiveType); NativeDeviceContext.DrawIndexedInstanced(indexCountPerInstance, instanceCount, startIndexLocation, baseVertexLocation, startInstanceLocation); }