根据IDXGIAdapter::CheckInterfaceSupport
documentation如果支持传入的接口(interface),则返回 S_OK
,否则返回 DXGI_ERROR_UNSUPPORTED
。代码片段:
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);
}
控制台始终打印NOT
,但如果我更改为__uuidof(ID3D10Device)
,则不会。
但我绝对知道我的 GPU 支持 DirectX11,因为:
- 我目前正在编写的程序正在使用 DirectX 11 并且它正在运行
- 我的 GPU:GTX 970,不是最新的,但是......应该支持 D3D11 :D
请有人把事情弄清楚我有点恼火,谢谢。
最佳答案
在 IDXGIAdapter:CheckInterfaceSupport
的“备注”部分(强调我的):
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.
关于c++ - IDXGISwapChain::CheckInterfaceSupport 返回的结果不能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42615225/