Jump to content
  • Advertisement
Sign in to follow this  
BlackJoker

E_INVALIDARGS when creating D3D11Device with certain adapter

This topic is 2121 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

Hello,

 

I want to create D3D11 device using as first argument of function D3D11CreateDevice a certain adapter, but not NULL as by default.

But problem is that id I pass to function my adapter, I receive E_INVALIDARGS and if I pass NULL, D3D11 device creating successfully.

 

Code for creating device:



IDXGIFactory2* factory;
	IDXGIAdapter* adapter;

result = CreateDXGIFactory1(__uuidof(IDXGIFactory2), (void**)&factory);
	if (FAILED(result))
	{
		return false;
	}

D3D_FEATURE_LEVEL featureLevels[] =
	{
		D3D_FEATURE_LEVEL_11_0,
		D3D_FEATURE_LEVEL_10_1,
		D3D_FEATURE_LEVEL_10_0
	};

	UINT numFeatureLevels = ARRAYSIZE(featureLevels);
	factory->EnumAdapters(0,&adapter);

	//Create Direct3D and D3D11 Context
	result = D3D11CreateDevice(adapter, driverType,NULL,D3D11_CREATE_DEVICE_DEBUG|D3D11_CREATE_DEVICE_BGRA_SUPPORT, featureLevels,numFeatureLevels,
			D3D11_SDK_VERSION, &d3d11_Device, &featureLevel, &d3d11_DeviceContext );

	if (FAILED(result))
	{
		return false;
	}

If I have several adapter, I might want to create device not on first adapter.

Please, help to understand the cause of problem. 

Edited by BlackJoker

Share this post


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

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!