Graphics Reference
In-Depth Information
UINT64 PSInvocations;
UINT64 HSInvocations;
UINT64 DSInvocations;
UINT64 CSInvocations;
}
Listing B.2.The D3D11_QUERY_DATA_PIPELINE_STATISTICS structure.
Each of the members of this structure provides information on the general statistics
for each stage of the pipeline. This can be used to understand how the pipeline is perform-
ing, including what effect LOD changes have, as well as debugging the pipeline when the
results of a rendering operation are not as expected. The other query types will provide
different result types, so the developer must check which data type to supply in order to
receive the appropriate results. After the query has been used, it can be released in the typi-
cal COM manner.
Predicated Rendering
Some of the query types allow the application to determine if a particular draw call will
affect the current render target, if it were to be executed. In particular, the D3D11_QUERY_
OCCLUSION query type returns the number of pixels that pass the depth and stencil tests for
a particular rendering sequence. This is typically used to determine if a draw call will pro-
duce a significant amount of visual difference before it is rendered. Similarly, the D3D11_
QUERY_OCCLUSION_PREDICATE query type performs the same test, except that it returns a
Boolean answer to the query, instead of a number of fragments.
The occlusion predicate actually uses a subclass of the ID3D11Query interface—
the ID3D11Predicate interface. This special query type must be created with the
ID3D11Device: :CreatePredicate() method, in a fashion similar to the generic query
technique shown above.
This predicated version of the query allows for a special method of rendering, called
predicated rendering. Essentially, the query is started with the call to Begin, and then
any objects being rendered will count toward the occlusion query until the End method is
called. Once this predicate query has been started, the application can bind it to the pipeline
as an indication of whether or not subsequent API calls should take effect or not. This is
done through the ID3DllDeviceContext::SetPredication() method, which also takes
a Boolean parameter to allow selection of how the predicate is interpreted. If no pixels pass
the depth and stencil tests, the predicate will return false. If true is passed in this param-
eter, the subsequent rendering calls will not be executed when the predicate returns false.
Search WWH ::




Custom Search