Graphics Reference
In-Depth Information
B
Appendix B:
Direct3D 11 Queries
Throughout this topic, we have explored in great detail the operations that Direct3D 11
makes available to a developer. This includes the ability to manipulate and control the indi-
vidual actions carried out by modern high-performance GPUs. Since the GPU has evolved
into such a sophisticated and specialized processor, there are many instances where the
biggest bottleneck in an application is introduced when the CPU requires data that forces
the GPU to stop what it is doing to respond to CPU's request. For example, if the CPU re-
quests that a buffer be mapped into system memory for reading, that buffer cannot be used
by the GPU until the CPU releases it. This can lead to situations where the CPU is waiting
for a response from the GPU, or vice versa. In either case, one of the two processing units
is considered to be "stalled," since it is not performing any useful operations while it is
waiting on the other.
Direct3D 11 provides a mechanism with which some of these stalling situations can
be avoided, or at least minimized. There is an interface that provides asynchronous access
to some pipeline information and operations that the CPU can use without the GPU having
to halt its operation and respond. This interface is the ID3DllQuery interface. We will take
a closer look at this interface while investigating how it operates, and finally, will consider
a few sample usages for this functionality.
Using Query Interfaces
As mentioned above, the ID3DllQuery interface provides the ability to acquire data asyn-
chronously from the GPU. This means that the CPU can request information from the GPU
613
Search WWH ::




Custom Search