ID3D11DeviceContext::DrawInstanced Method

Draw non-indexed, instanced primitives.

Syntax

public:
void DrawInstanced(
         UINT VertexCountPerInstance,
         UINT InstanceCount,
         UINT StartVertexLocation,
         UINT StartInstanceLocation
)  

Parameters

VertexCountPerInstance
Type: UINT 

[in] Number of vertices to draw.

InstanceCount
Type: UINT 

[in] Number of instances to draw.

StartVertexLocation
Type: UINT 

[in] Index of the first vertex.

StartInstanceLocation
Type: UINT 

[in] A value added to each index before reading per-instance data from a vertex buffer.

Return value

None.

Remarks

A draw API submits work to the rendering pipeline.

Instancing may extend performance by reusing the same geometry to draw multiple objects in a scene. One example of instancing could be to draw the same object with different positions and colors.

The vertex data for an instanced draw call normally comes from a vertex buffer that is bound to the pipeline. However, you could also provide the vertex data from a shader that has instanced data identified with a system-value semantic (SV_InstanceID).

Requirements

Header: Declared in d3d11_x.h (d3d11.h on other Windows platforms).

Library: Use d3d11_x.lib (d3d11.lib on other Windows platforms).

See also

ID3D11DeviceContext

ID3D11DeviceContext Members