作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我有以下调用,无论我尝试什么,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*
最佳答案
误报:我的 swapChainDescriptor 有错误(即,我的 MSAA 计数和质量值被交换了)。
希望这对以后的其他人有所帮助。
关于c++ - DirectX D3D11CreateDeviceAndSwapChain 返回 E_INVALIDARG,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19348787/
我正在尝试用 C++ 初始化 Direct3D11。在安装了 Visual Studio 的机器上(所有这些都在 Windows 10 上运行),它运行良好。在其他计算机(未安装 Visual Stu
我是一名优秀的程序员,十分优秀!