AdapterID = 0;
pAdapter = NULL;
while( pFactory->EnumAdapters( AdapterID, &pAdapter ) == S_OK )
{
pAdapter->CheckInterfaceSupport( __uuidof(md3dDevice), pAdapterd3dSupport );
pAdapter->Release();
AdapterID++;
}
Filling out an IDXGIAdapter
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?
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.
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.
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.
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).
Quote:Original post by Gage64Quote: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.
How do you initialize pAdapterd3dSupport?
Try calling it like this:
Try calling it like this:
LARGE_INTEGER Adapterd3dSupport;pAdapter->CheckInterfaceSupport( __uuidof(ID3D10Device), &Adapterd3dSupport );
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement