D3D11CreateDevice() can take an optional parameter of the Adapter to use when creating the device, however.. if you have multiple GPU's you can have more than one Adapter on your computer, and AFAIK the only way to retrieve the available adapters is using DXGIFactory::EnumAdapters().
However, If I try to create a Factory and create the device like this:
IDXGIFactory *pFactory;
CreateDXGIFactory(__uuidof(IDXGIFactory), reinterpret_cast<void**>(&pFactory) );
IDXGIAdapter *pAdapter = nullptr;
for( int i=0; pFactory->EnumAdapters( i, &pAdapter ) != DXGI_ERROR_NOT_FOUND; i++ )
{
D3D11CreateDevice( pAdapter, DriverType, 0, creationFlags, 0, 0, D3D11_SDK_VERSION, &m_pDirect3D, &m_featureLevel, &m_pDeviceContext );
}
The call fails... but if I set the pAdapter parameter to NULL then the device is created correctly...
so, if it's not this way, how is one supposed to retrieve the adapter and pass it to the D3D11CreateDevice() function?
Thanks
Edited by はとぶ, 20 May 2012 - 01:47 PM.






