MisterRecursion
MisterRecursion

Reputation: 25

IDXGISwapChain::CheckInterfaceSupport returns a result that cannot be

According to the IDXGIAdapter::CheckInterfaceSupport documentation returns S_OK if the passed in interface is supported and otherwise DXGI_ERROR_UNSUPPORTED. Code snippet:

for( size_t i = 0; i < GInterface::m_Adapters.size(); i++)
{
    hr = GInterface::m_Adapters.at(i)->CheckInterfaceSupport(__uuidof(ID3D11Device), (LARGE_INTEGER*)&umdVersion);
    printf( "***D3D11 %sSUPPORTED FOR ADAPTER %d (%d)",
            (hr != DXGI_ERROR_UNSUPPORTED) ? "" : "NOT ",
            i,
            umdVersion);
}

The console always prints NOT, but if I change to __uuidof(ID3D10Device) it does not.
But I definitely know that my GPU supports DirectX11, because:

  1. The programm I am currently writing is using DirectX 11 and it's running
  2. My GPU: GTX 970, not the newest, but... yeah should be supporting D3D11 :D

Can please somebody clear things up I am slightly irritated, thank you.

Upvotes: 1

Views: 532

Answers (1)

MuertoExcobito
MuertoExcobito

Reputation: 10049

In the 'remarks' section for the IDXGIAdapter:CheckInterfaceSupport (emphasis mine):

Note You can use CheckInterfaceSupport only to check whether a Direct3D 10.x interface is supported, and only on Windows Vista SP1 and later versions of the operating system. If you try to use CheckInterfaceSupport to check whether a Direct3D 11.x and later version interface is supported, CheckInterfaceSupport returns DXGI_ERROR_UNSUPPORTED. Therefore, do not use CheckInterfaceSupport. Instead, to verify whether the operating system supports a particular interface, try to create the interface. For example, if you call the ID3D11Device::CreateBlendState method and it fails, the operating system does not support the ID3D11BlendState interface.

Upvotes: 1

Related Questions