Graphics Reference
In-Depth Information
With each new generation of hardware, the number of available CAPS bits was be-
coming increasingly unmanageable. Instead of requiring the application to parse through
all of these options, the Direct3D 11 API groups implementations into categories called
feature levels. These feature levels provide a more coarse representation of the available
features for a given GPU and driver, but using them provides a significantly simpler pro-
cess to determine what capabilities the GPU supports. The available feature levels are
shown in Listing 1.5.
enum D3D_FEATURE_LEVEL {
D3D_FEATURE_LEVEL_9_1,
D3D_FEATURE_LEVEL_9_2,
D3D_FEATURE_LEVEL_9_3,
D3D_FEATURE_LEVEL_10_0,
D3D_FEATURE_LEVEL_10_1,
D3D FEATURE LEVEL 11 0
}
Listing 1.5. The D3D_FEATURE_LEVEL enumeration.
As you can see, there is one feature level for each minor revision that was released
for Direct3D since version 9. Each feature level is a strict superset of the previous fea-
ture level, meaning that a higher-level GPU will support the lower feature levels if an
application requests them. For example, if a particular application only requires features
from the 10.0 feature level, it will be able to run on a wider range of hardware than an
application that requires the 11.0 feature level. The application passes an array of feature
levels that it would like to use in the pFeatureLevels parameter, with the array elements
arranged in the order of preference. The number of elements in the array is passed in the
FeatureLevels parameter to ensure that the function doesn't exceed the array size while
processing the input array. The device creation method will try to create a device with each
feature level, beginning with the first element in the array. If that feature level is supported
for the requested driver type, the device is created. If not, then the process continues to the
next feature level. If no supported feature levels are present in the array, the method returns
a failure code.
We have two input parameters left in the device creation function. The SDKVersion
parameter is simply supplied with the D3D11_SDK_VERSI0N macro. This is a defined value
that changes with each new release of the DirectX SDK. However, since the value is auto-
matically updated with a new SDK installation, the developer does not need to make any
changes when converting to the new SDK.
The final input parameter is a pointer to a swap chain description. As described earlier
in this chapter, a swap chain is an object created by DXGI that is used to manage the contents
of a window's client area. The swap chain object defines all of the lower-level options that
Search WWH ::




Custom Search