ID3D12CommandList::BeginQuery method

[This documentation is preliminary and is subject to change.]

Transitions a query into the querying state.

Syntax


void BeginQuery(
  ID3D11Asynchronous *pAsync
);

Parameters

pAsync

A pointer to an ID3D11Asynchronous interface.

Return value

Returns nothing.

Remarks

In Direct3D 12, the usage of queries is more restricted than Direct3D 11. The following scenarios are no longer supported:

  • A call to BeginQuery followed by another call to BeginQuery without an intervening call to EndQuery.
  • A call to EndQuery followed by EndQuery without an intervening call to BeginQuery.

Given these restrictions, there are 3 states that a query can be in:

  • Inactive (this is the initial state of all queries)
  • Querying
  • Predicating

BeginQuery transitions a query from the inactive state to the querying state. EndQuery transitions a query from the querying state to the inactive state. SetPredication transitions the previous set query from the predicating state to the inactive state and transitions the newly set query from the inactive state to the predicating state .

Runtime validation

The runtime will issue errors for the following calls:

  • Calling BeginQuery on a query which is in the querying or predicating state
  • Calling EndQuery on a query which is in the inactive or predicating state
  • Calling SetPredication on a query which is in the querying state

Ilegal API calls will result in Close returning an error or ExecuteCommandList dropping the command list, and the device becoming removed. Note that predication state is not inherited by direct command lists. All direct command lists begin with predication disabled.

Debug layer

The debug layer will issue errors whenever the runtime validation fails.

See also

ID3D12CommandList

 

 

Show: