在我的 D3D 11 项目中,我总是添加
#if (defined(DEBUG) || defined(_DEBUG))
deviceFlags |= D3D11_CREATE_DEVICE_DEBUG;
#endif /* (defined(DEBUG) || defined(_DEBUG)) */
到设备创建标志以启用调试输出。由于我升级到 Windows 10,这不再起作用。设备创建失败,输出如下:
D3D11CreateDevice: Flags (0x2) were specified which require the D3D11 SDK Layers for Windows 10, but they are not present on the system. These flags must be removed, or the Windows 10 SDK must be installed. Flags include: D3D11_CREATE_DEVICE_DEBUG
但是,我无法使用 Windows 10 SDK,也无法将项目从 VS2013 升级到 VS 2015 atm。有什么办法可以解决这个问题,即我可以在Windows 10 VS2013 上启用D3D11 调试层吗?
最佳答案
调试消息有点误导。对于 Windows 10,Windows SDK 不再安装 Direct3D 调试层。相反,您需要启用一个名为“图形工具”的 Windows 可选功能,其中包括调试层。在 Windows 10 上安装 VS 2015 和 Windows 10 SDK 应该也会自动启用此功能,但您可以直接启用。
(a) 设置面板 -> 系统 -> 应用和功能 -> 管理可选功能 -> 添加功能 -> 选择“图形工具”
(b) 从管理员命令行提示符:
Dism /online /add-capability /capabilityname:Tools.Graphics.DirectX~~~~0.0.1.0
见 this post .
Note that when you upgrade from Windows 10 (10240) to the November 2015 update (10586), you may need to re-enable the Graphics Tools optional feature.
关于c++ - 在 Windows 10 上使用 D3D11 调试层和 VS2013,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32809169/