Freigeben über


ID3D11DeviceContext::GetData Method

Get data from the Grafikprozessor (GPU) asynchronously.

Syntax

HRESULT GetData(
  [in]   ID3D11Asynchronous *pAsync,
  [out]  void *pData,
  [in]   UINT DataSize,
  [in]   UINT GetDataFlags
);

Parameter

  • pAsync [in]
    Typ: ID3D11Asynchronous*

    A pointer to an ID3D11Asynchronous interface for the object about which GetData retrieves data.

  • pData [out]
    Typ: void*

    Address of memory that will receive the data. If NULL, GetData will be used only to check status. The type of data output depends on the type of asynchronous interface.

  • DataSize [in]
    Typ: UINT

    Size of the data to retrieve or 0. Must be 0 when pData is NULL.

  • GetDataFlags [in]
    Typ: UINT

    Optional flags. Can be 0 or any combination of the flags enumerated by D3D11_ASYNC_GETDATA_FLAG.

Rückgabewert

Typ: HRESULT

This method returns one of the Direct3D 11 Return Codes. A return value of S_OK indicates that the data at pData is available for the calling application to access. A return value of S_FALSE indicates that the data is not yet available. If the data is not yet available, the application must call GetData until the data is available.

Hinweise

Queries in a deferred context are limited to predicated drawing. That is, you cannot call ID3D11DeviceContext::GetData on a deferred context to get data about a query; you can only call GetData on the immediate context to get data about a query. For predicated drawing, the results of a predication-type query are used by the GPU and not returned to an application. For more information about predication and predicated drawing, see D3D11DeviceContext::SetPredication.

GetData retrieves the data that the runtime collected between calls to ID3D11DeviceContext::Begin and ID3D11DeviceContext::End. Certain queries only require a call to ID3D11DeviceContext::End in which case the data returned by GetData is accurate up to the last call to ID3D11DeviceContext::End. For information about the queries that only require a call to ID3D11DeviceContext::End and about the type of data that GetData retrieves for each query, see D3D11_QUERY.

If DataSize is 0, GetData is only used to check status.

An application gathers counter data by calling ID3D11DeviceContext::Begin, issuing some graphics commands, calling ID3D11DeviceContext::End, and then calling ID3D11DeviceContext::GetData to get data about what happened in between the Begin and End calls. For information about performance counter types, see D3D11_COUNTER. The counter data is of type FLOAT32.

Anforderungen

Header

D3D11.h

Bibliothek

D3D11.lib