在 Windows 10 上使用 D3D11 调试层和 VS2013 [英] Use D3D11 debug layer with VS2013 on Windows 10

查看:32
本文介绍了在 Windows 10 上使用 D3D11 调试层和 VS2013的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 D3D 11 项目中,我总是添加

In my D3D 11 projects, I always add

#if (defined(DEBUG) || defined(_DEBUG))
deviceFlags |= D3D11_CREATE_DEVICE_DEBUG;
#endif /* (defined(DEBUG) || defined(_DEBUG)) */

到设备创建标志以启用调试输出.由于我升级到 Windows 10,这不再起作用.设备创建失败,输出如下:

to the device creation flags to enable debug output. Since I upgraded to Windows 10, this does not work any more. The device creation fails with the following output:

D3D11CreateDevice:指定的标志 (0x2) 需要适用于 Windows 10 的 D3D11 SDK 层,但它们在系统上不存在.必须删除这些标志,或者必须安装 Windows 10 SDK.标志包括:D3D11_CREATE_DEVICE_DEBUG

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 调试层吗?

However, I cannot use the Windows 10 SDK nor can I upgrade the project from VS2013 to VS 2015 atm. Is there any way to resolve this issue, ie can I enable the D3D11 debug layer on Windows 10 with VS2013?

推荐答案

调试信息有点误导.对于 Windows 10,Windows SDK 不再安装 Direct3D 调试层.相反,您需要启用一个名为图形工具"的 Windows 可选功能,其中包括调试层.在 Windows 10 上安装 VS 2015 和 Windows 10 SDK 应该也会自动启用此功能,但您可以直接启用.

The debug message is a little misleading. For Windows 10, the Windows SDK no longer installs the Direct3D debug layer. Instead, you need to enable a Windows Optional Feature called "Graphics Tools" which includes the debug layer. Installing VS 2015 and the Windows 10 SDK on Windows 10 should automatically enable this feature as well, but you can do it directly.

(a) 设置面板 -> 系统 -> 应用程序和功能 -> 管理可选功能 -> 添加功能 -> 选择图形工具"

(a) Settings panel -> System -> Apps & features -> Manage optional Features -> Add a feature -> Select "Graphics Tools"

(b) 从管理员命令行提示符:

(b) from a admin command-line prompt:

Dism /online /add-capability /capabilityname:Tools.Graphics.DirectX~~~~0.0.1.0

参见 这篇文章.

请注意,当您从 Windows 10 (10240) 升级到 2015 年 11 月更新 (10586) 时,您可能需要重新启用图形工具可选功能.

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.

这篇关于在 Windows 10 上使用 D3D11 调试层和 VS2013的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆