ID3D11DeviceContext::IASetIndexBuffer Method

Bind an index buffer to the input-assembler stage.

Syntax

void IASetIndexBuffer(
  [in]  ID3D11Buffer *pIndexBuffer,
  [in]  DXGI_FORMAT Format,
  [in]  UINT Offset
);

Parameter

  • pIndexBuffer [in]
    Typ: ID3D11Buffer*

    A pointer to an ID3D11Buffer object, that contains indices. The index buffer must have been created with the D3D11_BIND_INDEX_BUFFER flag.

  • Format [in]
    Typ: DXGI_FORMAT

    A DXGI_FORMAT that specifies the format of the data in the index buffer. The only formats allowed for index buffer data are 16-bit (DXGI_FORMAT_R16_UINT) and 32-bit (DXGI_FORMAT_R32_UINT) integers.

  • Offset [in]
    Typ: UINT

    Offset (in bytes) from the start of the index buffer to the first index to use.

Rückgabewert

Returns nothing.

Hinweise

For information about creating index buffers, see How to: Create an Index Buffer.

Calling this method using a buffer that is currently bound for writing (i.e. bound to the stream output pipeline stage) will effectively bind NULL instead because a buffer cannot be bound as both an input and an output at the same time.

The debug layer will generate a warning whenever a resource is prevented from being bound simultaneously as an input and an output, but this will not prevent invalid data from being used by the runtime.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

Anforderungen

Header

D3D11.h

Bibliothek

D3D11.lib

Siehe auch

ID3D11DeviceContext