Graphics Reference
In-Depth Information
ity provided up to the Direct3D 10.1 feature level, 1 which means that it can't be used to
implement most of the techniques discussed in this topic!
After the desired device type is chosen, the next parameter allows the application
to provide a handle to the software driver DLL in situations when a software driver type
is selected. If a non-software device is chosen, this parameter can be set to NULL, which
will usually be the case. Next up is the Flags parameter, which allows for a number of
special features to be enabled when the device is created. The available flags are shown in
Listing 1.4.
enum D3D11_CREATE_DEVICE_FLAG {
D3D11_CREATE_DEVICE_SINGLETHREADED,
D3D11_CREATE_DEVICE_DEBUG J
D3D11_CREATE_DEVICE_SWITCH_T0_REF J
D3Dll_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS,
D3D11_CREATE_DEVICE_BGRA_SUPP0RT
}
Listing 1.4. The D3D11CREATEDEVICE FLAG enumeration.
The first flag indicates that the device should be created for single-threaded use. If
this flag is not present, the default behavior is to allow multithreaded use of the device.
The second flag indicates if the debug layer of the device should be created. If this flag
is set, the device is created such that it also implements the ID3DllDebug interface. This
interface is used for various debugging operations and is retrieved using the COM query
interface techniques. It also causes complete error/warning messages to be output at run-
time and enables memory leak detection as well. The third flag is unsupported for use in
Direct3D 11, so we won't discuss it in any great detail. The fourth flag is used to disable
multithreaded optimizations within the device while still allowing multithreaded use. This
would likely decrease performance, but it could allow for simpler debugging and/or profil-
ing characteristics. The final flag is used to create a device that can interoperate with the
Direct2D API. We don't cover Direct2D in this topic, but it is still important to know that
this feature is available.
The following two parameters also offer a very interesting set of capabilities for cre-
ating a device. The first is a pointer to an array of D3D_FEATURE_LEVEL values. The concept
of a feature level is the replacement for the old CAPS bits from older versions of Direct3D.
CAPS bits were a name for the myriad number of options that a GPU manufacturer could
choose to support or not, and the application was responsible for checking if a particular
feature was available or not before trying to use it.
1 The concept of feature levels is discussed in the following pages.
Search WWH ::




Custom Search