Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
415 views
in Technique[技术] by (71.8m points)

c++ - Use D3D11 debug layer with VS2013 on Windows 10

In my D3D 11 projects, I always add

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

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: 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

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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) Settings panel -> System -> Apps & features -> Manage optional Features -> Add a feature -> Select "Graphics Tools"

(b) from a admin command-line prompt:

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

See 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...