ID3D11DeviceContextX::MultiDrawInstancedIndirectAuto Method

Draws multiple instanced, GPU-generated primitives using a GPU-generated count. Non-indexed.

Syntax

public:
void MultiDrawInstancedIndirectAuto(
         ID3D11Buffer *pBufferForPrimitiveCount,
         UINT AlignedByteOffsetForPrimitiveCount,
         ID3D11Buffer *pBufferForArgs,
         UINT AlignedByteOffsetForArgs,
         UINT StrideByteOffsetForArgs,
         UINT Flags
)  

Parameters

pBufferForPrimitiveCount
Type: ID3D11Buffer *

[in, out] A pointer to an ID3D11Buffer, which is a buffer containing the count of GPU-generated primitives. The layout of the buffer must be a 32-bit UINT. The count itself is generated by the GPU, use the non-Auto MultiDrawInstancedIndirect if the count is to be generated by the CPU.

AlignedByteOffsetForPrimitiveCount
Type: UINT 

[in] Offset in pBufferForPrimitiveCount to the start of the count of GPU-generated primitives.

pBufferForArgs
Type: ID3D11Buffer *

[in, out] An indirect buffer containing the GPU-generated primitives, as a pointer to an ID3D11Buffer.

When using the flag D3D11X_MULTI_DRAW_DRAWID_FROM_BUFFER_FOR_ARGS, the layout of the indirect buffer must adhere to the layout of the D3D11X_DRAW_INSTANCED_INDIRECT_WITH_DRAWID_ARGS structure.

In other cases, the layout of the indirect buffer must adhere to the layout of the D3D11_DRAW_INSTANCED_INDIRECT_ARGS structure.

Explicit synchronization on the buffer is required before passing it as a parameter, refer to Multi-Draw calls.

AlignedByteOffsetForArgs
Type: UINT 

[in] The offset in pBufferForArgs to the start of the GPU-generated primitives.

StrideByteOffsetForArgs
Type: UINT 

[in] The stride in pBufferForArgs between each set of GPU-generated primitives.

When using the flag D3D11X_MULTI_DRAW_DRAWID_FROM_BUFFER_FOR_ARGS, this value must be >= sizeof(D3D11X_DRAW_INSTANCED_INDIRECT_WITH_DRAWID_ARGS).

In other cases, this value must be >= sizeof(D3D11_DRAW_INSTANCED_INDIRECT_ARGS)

Flags
Type: UINT 

[in] Flags to control this method, as a bitwise-OR’d combination of D3D11X_MULTI_DRAW_FLAG enumeration constants, such as flags for: auto-generate, from buffer for arguments, or Vertex shader user data register 15.

Return value

None.

Remarks

When an application creates a buffer that is associated with the ID3D11Buffer interface that pBufferForArgs points to, the application must set the D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS flag in the MiscFlags member of the D3D11_BUFFER_DESC structure that describes the buffer. To create the buffer, the application calls the ID3D11Device::CreateBuffer method and in this call passes a pointer to D3D11_BUFFER_DESC in the pDesc parameter.

This API is similar to using ID3D11DeviceContextX::MultiDrawInstancedIndirect; however, the count is provided by the GPU in a buffer instead of by the CPU as a parameter.

See the synchronization requirements for this method.

Requirements

Header: Declared in d3d11_x.h.

Library: Use d3d11_x.lib.

See also

Reference

ID3D11DeviceContextX Interface

ID3D11DeviceContextX Members