Jump to content
  • Advertisement
Sign in to follow this  
Exomoto

Filling out an IDXGIAdapter

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

Hey, I'm having some trouble checking if an adapter supports Direct3D 10. I'm using an IDXGIFactory to iterate through adapters and calling IDXGI::CheckInterfaceSupport on each one (well, the only one). This should work, however IDXGIFactory::EnumAdapters doesn't seem to return a filled out IDXGIAdapter. Does anyone know how I can resolve this issue?
	AdapterID = 0;
	pAdapter = NULL;

	while( pFactory->EnumAdapters( AdapterID, &pAdapter ) == S_OK )
	{
			pAdapter->CheckInterfaceSupport( __uuidof(md3dDevice), pAdapterd3dSupport );
			pAdapter->Release();
			AdapterID++;
	}

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Gage64
Try checking what is the exact return value of EnumAdapters.


Even if I just call EnumAdapters once with an AdapterID of 1, it still doesn't fill out pAdapter.

Share this post


Link to post
Share on other sites
Quote:
Original post by Exomoto
Even if I just call EnumAdapters once with an AdapterID of 1, it still doesn't fill out pAdapter.


That's as it should be - you're supposed to pass an adapter index, and if you only have 1 adapter, the only valid index is 0.

But that is what you did in the OP, so that's not the problem. See here for the possible return values of EnumAdapters and check which one is returned.

Share this post


Link to post
Share on other sites
Quote:
Original post by Gage64
That's as it should be - you're supposed to pass an adapter index, and if you only have 1 adapter, the only valid index is 0.

But that is what you did in the OP, so that's not the problem. See here for the possible return values of EnumAdapters and check which one is returned.


It seems to be running through the loop once, since AdapterID displays on screen as 1 when the CheckInterfaceSupport call is edited out, and for some reason I can call pAdapter->Release() without any issues ocurring, it's just that call to CheckInterfaceSupport which causes a debug.

I can pass EnumAdapters an IDXGIAdapter**, which seems to work ok, but then I can't figure out how to use that to call the CheckInterfaceSupport function.

Share this post


Link to post
Share on other sites
Quote:
Original post by Exomoto
I can call pAdapter->Release() without any issues ocurring, it's just that call to CheckInterfaceSupport which causes a debug.


What do you mean "causes a debug"? What happens if you do this:

if (FAILED(pAdapter->CheckInterfaceSupport( __uuidof(md3dDevice), pAdapterd3dSupport )))
// report error


Also, try replacing the first argument with __uuidof(ID3D10Device).

Share this post


Link to post
Share on other sites
Quote:
Original post by Gage64
Quote:
Original post by Exomoto
I can call pAdapter->Release() without any issues ocurring, it's just that call to CheckInterfaceSupport which causes a debug.


What do you mean "causes a debug"? What happens if you do this:

if (FAILED(pAdapter->CheckInterfaceSupport( __uuidof(md3dDevice), pAdapterd3dSupport )))
// report error


Also, try replacing the first argument with __uuidof(ID3D10Device).


CheckInterfaceSupport now returns S_OK but doesn't fill pAdapterD3DSupport, so when I attempt to retrieve pAdapterd3dSupport->QuadPart I get an exception.

Share this post


Link to post
Share on other sites
How do you initialize pAdapterd3dSupport?

Try calling it like this:

LARGE_INTEGER Adapterd3dSupport;
pAdapter->CheckInterfaceSupport( __uuidof(ID3D10Device), &Adapterd3dSupport );

Share this post


Link to post
Share on other sites
Quote:
Original post by Gage64
How do you initialize pAdapterd3dSupport?

Try calling it like this:

LARGE_INTEGER Adapterd3dSupport;
pAdapter->CheckInterfaceSupport( __uuidof(ID3D10Device), &Adapterd3dSupport );


Thanks a lot for the advice, I appreciate it.

Simple change but it worked, CheckInterfaceSupport now functions fine.

One last question, is there much I can do with the Adapterd3dSupport variable? I don't see the relevance of the value stored in Adapterd3dSupport.QuadPart.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!