4

我有以下调用,无论我尝试什么,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
    );

根据上面的日志行,两者useSoftwareEmulationenableRenderDebugging都是false

所有其他变量的类型如下:

currentAdapter是一个IDXGIAdapter*

swapChainDescriptor是一个DXGI_SWAP_CHAIN_DESC

swapChain是一个IDXGISwapChain*

graphicsCardInterface是一个ID3D11Device*

runningFeatureLevel是一个D3D_FEATURE_LEVEL

graphicsCardContext是一个ID3D11DeviceContext*

4

1 回答 1

4

误报:我的 swapChainDescriptor 中有错误(即我的 MSAA 计数和质量值被交换)。

希望这可以在未来对其他人有所帮助。

于 2013-10-13T19:38:36.477 回答