問題描述
獲取 D3D 調試信息? (Get D3D debug information?)
在初始化我的 D3D 內容期間,我調用以下函數:
hr = D3D11CreateDevice(nullptr,gDriverTypes[DriverTypeIndex],nullptr,
#ifdef _DEBUG
D3D11_CREATE_DEVICE_DEBUG,
#else
0,
#endif
gFeatureLevels,gNumFeatureLevels,D3D11_SDK_VERSION,&lDevice,&lFeatureLevel,&lImmediateContext);
在調試構建中,為了獲取有關可能的 D3D 錯誤的更多信息,我設置了標誌 D3D11_CREATE_DEVICE_DEBUG。如果沒有任何進一步的操作,這會讓我的應用程序立即終止。
因此根據 在 Windows 10 上使用 D3D11 調試層和 VS2013 我嘗試通過調用
Dism /online /add‑capability /capabilityname:Tools.Graphics.DirectX~~~~0.0.1.0
在最新 Windows 上的管理控制台中安裝所需的 D3D 調試內容10. 不幸的是,這失敗了
Deployment Image Servicing and Management tool
Version: 10.0.18362.1316
Image Version: 10.0.18363.1316
[==========================100.0%==========================]
Error: 0x8024500c
DISM failed. No operation was performed.
日誌文件也不是很有幫助,它包含大量的錯誤消息和一個不容易理解的錯誤代碼。
參考解法
方法 1:
For Windows 10, support for the Direct3D 11 and Direct3D 12 "Debug Device" is only available with the "Graphics Tools" Windows optional feature enabled.
The HRESULT of 0x8024500c
indicates you have some problem with Windows Update on your system. It's WU_E_REDIRECTOR_CONNECT_POLICY
.
Most likely your PC is on a corporate network using WSUS. You need to ask the IT admins to allow this Windows optional feature.
(by Elmi、Chuck Walbourn)