Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ID3D11Query interface

A query interface queries information from the GPU.

Members

The ID3D11Query interface inherits from ID3D11Asynchronous. ID3D11Query also has these types of members:

Methods

The ID3D11Query interface has these methods.

MethodDescription
GetDesc

Get a query description.

 

Remarks

A query can be created with ID3D11Device::CreateQuery.

Query data is typically gathered by issuing an ID3D11DeviceContext::Begin command, issuing some graphics commands, issuing an ID3D11DeviceContext::End command, and then calling ID3D11DeviceContext::GetData to get data about what happened in between the Begin and End calls. The data returned by GetData will be different depending on the type of query.

There are, however, some queries that do not require calls to Begin. For a list of possible queries see D3D11_QUERY.

A query is typically executed as shown in the following code:




D3D11_QUERY_DESC queryDesc;
... // Fill out queryDesc structure
ID3D11Query * pQuery;
pDevice->CreateQuery(&queryDesc, &pQuery);
pDeviceContext->Begin(pQuery);

... // Issue graphics commands

pDeviceContext->End(pQuery);
UINT64 queryData; // This data type is different depending on the query type

while( S_OK != pDeviceContext->GetData(pQuery, &queryData, sizeof(UINT64), 0) )
{
}


When using a query that does not require a call to Begin, it still requires a call to End. The call to End causes the data returned by GetData to be accurate up until the last call to End.

Requirements

Minimum supported client

Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8

Header

D3D11.h

Library

D3D11.lib

See also

ID3D11Asynchronous
Core Interfaces

 

 

Show:
© 2016 Microsoft