Graphics Reference
In-Depth Information
about the operations performed between a beginning and ending point in a sequence of
API calls, and the driver will respond as soon as the information is available. By allowing
the driver to respond at a later point, the CPU can continue and check the query result later
on, after the GPU has finished the tasks that the query is concerned with. This provides a
communication mechanism between the two processing units that can be used in a number
of different ways, which we will explore in the following sections.
As mentioned above, various different types of queries can be performed.
However, only a single interface is used to carry out the queries—ID3D11Query. The in-
dividual types of queries are selected during the creation of the query. As with all ob-
jects in Direct3D 11, the query objects are created with a method from the device—the
ID3D11Device::CreateQuery() method. This method takes a pointer to a description
structure, plus a pointer to the returned query interface. In the case of the query description,
the structure contains only two variables. The description structure and its subelements are
shown in Listing B.l.
struct D3D11_QUERY_DESC {
D3D11_QUERY Query;
UINT
MiscFlags;
};
enum D3D11_QUERY {
D3D11_QUERY_EVENT,
D3D11_QUERY_0CCLUSI0N,
DSDll_QUERY_TIMESTAMP,
D3D11_QUERY_TIMESTAMP_DISD0INT,
D3D11_QUERY_PIPELINE_STATISTICS )
D3D11_QUERY_0CCLUSI0N_PREDTCATE,
D3D11_QUERY_S0_STATISTICS )
D3D11_QUERY_S0_0VERFL0W_PREDICATE )
D3D11_QUERY_SO_STATISTICS_STREAM0,
D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0,
D3D11_QUERY_S0_STATISTICS_STREAM1,
D3D11_QUERY_S0_0VERFL0W_PREDICATE_STREAM1,
D3D11_QUERY_S0_STATISTICS_STREAM2,
D3Dll_QUERY_SO_OVERFLOW_PREDICATE_STREAM2,
D3D11_QUERY_S0_STATISTICS_STREAM3,
D3Dll_QUERY_SO_OVERFLOW_PREDICATE_STREAM3
}
enum D3D11_QUERY_MISC_FLAG {
D3D11_QUERY_MISC_PREDICATEHINT
}
Listing B.l. The D3D11_QUERY_DESC structure and its components.
From Listing B.l, we can see that the primary purpose of this description structure
is to select the type of the query, with the D3D11_QUERY enumeration providing the avail-
able choices. There are queries for acquiring pipeline event and timing information, for
Search WWH ::




Custom Search