Graphics Reference
In-Depth Information
const DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
IDXGISwapChain **ppSwapChain,
ID3DllDevice **ppDevice,
D3D_FEATURE_LEVEL *pFeatureLevel,
ID3DllDeviceContext **ppImmediateContext
);
Listing 1.2. The D3DllCreateDeviceAndSwapChain function prototype.
The first parameter, pAdapter, is a pointer to the graphics adapter that the device
should be created for. This parameter can be passed as NULL to use the default adapter.
The second parameter is vitally important to properly configure. The DriverType param-
eter specifies which type of driver will be used for the device created with this function call.
The available options are shown in Listing 1.3.
enum D3D_DRIVER_TYPE {
D3D_DRIVER_TYPE_UNKN0WN,
D3D_DRIVER_TYPE_HARDWARE,
D3D_DRIVER_TYPE_REFERENCE,
D3D_DRIVER_TYPE_NULL ,
D3D_DRIVER_TYPE_S0FTWARE,
D3D_DRIVER_TYPE_WARP
}
Listing 1.3. The D3D_DRIVER_TYPE enumeration, showing the types of drivers that can be created.
As you can see, it is possible to use hardware based drivers that interact with actual
hardware devices. This is the configuration that will be used in the majority of cases, but
there are also several other driver types that must be considered. The next driver type is the
reference driver. This is a software driver that fully implements the complete Direct3D 11
specification, but since it runs in software, it is not very fast. This driver type is typically
used to test if a particular set of rendering commands produces the same results with both
the hardware driver and the reference drivers. The null driver is only used in testing and
does not implement any rendering operations. The software driver type allows for a cus-
tom software driver to be used. This is not a common option, since it requires a complete
third-party software driver to be provided on the target machine. The final option is perhaps
one of the most interesting. The WARP device is a software renderer that is optimized for
rendering speed and that will use any special features of a CPU, such as multiple cores or
SIMD instructions. This allows an application to have a moderately fast software driver
available for use on all target machines, making the deployable market significantly larger
for many application types. Unfortunately, this device type only supports the functional-
Search WWH ::




Custom Search