Multihead cards are those that have a common frame buffer and accelerator, independent digital-to-analog converters (DACs), and monitor outputs. Such devices can offer much more usable multiple monitor support than a similar number of heterogeneous display adapters.
Multihead cards are exposed in the API as a single API-level device that can drive several full-screen swap chains. Consequently, all resources are shared with all the heads, and each head has exactly the same capabilities. Each head can be set to independent display modes and can be refreshed (with IDirect3DSwapChain9::Present) at different times. Use IDirect3DDevice9::Present for simultaneous presents.
Each swap chain for a multihead device must be full screen. When a device has entered multihead mode, it must remain full screen. The transition back to windowed mode requires the destruction of the device (except for the normal ALT+TAB-to-minimize operation).
The old method of dividing video memory between the heads and treating each head as a fully independent accelerator will still be a common usage scenario. This proposal does not replace that mechanism unless the application has been specifically coded to function in the Direct3D 9 multihead mode.
Drivers are given adequate knowledge to switch between the two modes of operation.
One head will be called the master head, and all other heads on the same card be called subordinate heads. If more than one multihead adapter is present in a system, the master and its subordinates from one multihead adapter are called a group. Groups are denoted by the adapter ordinal of their master head.
The D3DCAPS9 structure has been updated to expose the following new hardware caps.
UINT NumberOfAdaptersInGroup; UINT MasterAdapterOrdinal; UINT AdapterOrdinalInGroup;
This definition allows multihead cards to continue to present multiple adapters as if they were independent cards, just as they did in DirectX 8.
To create a multihead device, specify the behavior flag DAC in IDirect3D9::CreateDevice. The presentation parameters (an array of D3DPRESENT_PARAMETERS) should contain NumberOfAdaptersInGroup elements. The runtime will assign each element to each head in AdapterOrdinalInGroup numerical order. When DAC is set, each presentation parameter must have:
In addition, if EnableAutoDepthStencil is TRUE, then each of the following fields must have the same value for each D3DPRESENT_PARAMETERS:
If DAC is set, additional calls to IDirect3DDevice9::CreateAdditionalSwapChain are illegal.
If the device was created with the DAC, IDirect3DDevice9::Reset will expect an array of D3DPRESENT_PARAMETERS.
Each D3DPRESENT_PARAMETERS structure passed to IDirect3DDevice9::Reset must be full screen. To switch back to windowed mode, the application must destroy the device and re-create a non-multihead device in windowed mode.
Here is a basic usage scenario:
1. Create multihead device 2. For each swap chain of device: 3. Call GetBackBuffer for the i-th swapchain 4. Call SetRenderTarget 5. Call DrawPrimitive 6. Optionally call swapchain::Present (or wait until all swap chains are drawn and present outside of loop) 7. End the for loop 8. Optionally present all swap chains with device::Present
For more information, see IDirect3D9::CreateDevice and IDirect3DDevice9::GetNumberOfSwapChains.