c++ - 在 Windows 10 上使用 D3D11 调试层和 VS2013

标签 c++ debugging visual-studio-2013 windows-10 direct3d

在我的 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/

相关文章:

位域结构的 C++ 严格别名规则

c++ - 如何通过某个字段将对象插入到 map 结构中?

c++ - procdump.exe 显示的异常是什么意思?

c - 最重要的信号要处理?

c# - 如何在VS 2013的代码编辑器上隐藏引用标签?

c++ - C++ Goto vs Std::function lambda? [closed]

android - chrome远程调试,设备不显示

visual-studio-2013 - 开发 Xamarin 项目时,Visual Studio 中的 "CompileXaml"任务意外失败

java - 相当于C#中的java包

c++ - std::thread 构造函数(变量数量)