Jump to content
  • Advertisement
Sign in to follow this  

Can't pass enumerated adapter in D3D11CreateDeviceAndSwapChain

This topic is 1738 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I have a pretty standard initialization call of D3D11
if(FAILED(hr = D3D11CreateDeviceAndSwapChain(this->m_pAdapter, pArgs->DriverType, pArgs->Software, pArgs->Flags, pArgs->pFeatureLevels, pArgs->numFeatureLevels,
	D3D11_SDK_VERSION, pArgs->pSwapChainDesc, &pSwapChain, &pDevice, pArgs->pFeatureLevel, &pContext))){
		return hr;
where pArgs->stuff is passed to the function via a structure to decrease the complexity of the function call. I got m_pAdapter via an IDXGIFactory (m_pFactory) like this:
this->m_pFactory->EnumAdapters(0, &this->m_pAdapter);
This is odd, because the first argument is supposed to be the the adapter to use and if null, the first enumerated adapter, which is the one I have, and it fails. However, passing NULL does not cause it to fail.

Any ideas on what could be causing my call to fail?

Share this post

Link to post
Share on other sites

If are passing an enumerated adapter, then you should use D3D_DRIVER_TYPE_UNKNOWN for the driver type.  On the other hand, if you are passing nullptr for the adapter, then you can pass the desired driver type as you have shown above.


You can check out the RendererDX11::Initialize(...) function from Hieroglyph 3 for an example. 


Does that help your initialization call?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!