我有以下电话,无论我尝试什么,hresult
总是E_INVALIDARG:
LogMessage(L"Creating swap chain. Emulation: " + std::to_wstring(useSoftwareEmulation) + L", Debugging: " + std::to_wstring(enableRenderDebugging));
HRESULT hresult = D3D11CreateDeviceAndSwapChain(
(useSoftwareEmulation ? NULL : currentAdapter),
(useSoftwareEmulation ? D3D_DRIVER_TYPE_WARP : D3D_DRIVER_TYPE_UNKNOWN),
NULL,
(enableRenderDebugging ? D3D11_CREATE_DEVICE_DEBUG | D3D11_CREATE_DEVICE_DEBUGGABLE : 0),
NULL,
0,
D3D11_SDK_VERSION,
&swapChainDescriptor,
&swapChain,
&graphicsCardInterface,
&runningFeatureLevel,
&graphicsCardContext
);
根据上面的日志行,useSoftwareEmulation
和enableRenderDebugging
都是 false 。
所有其他变量的类型如下:
currentAdapter
是IDXGIAdapter*
swapChainDescriptor
是DXGI_SWAP_CHAIN_DESC
swapChain
是IDXGISwapChain*
graphicsCardInterface
是ID3D11Device*
runningFeatureLevel
是D3D_FEATURE_LEVEL
graphicsCardContext
是ID3D11DeviceContext*
答案 0 :(得分:4)
错误警报:我的swapChainDescriptor出错(即我的MSAA计数和质量值已被交换)。
希望这可能在将来帮助其他任何人。