使用 DeviceCreationFlags.Debug 启动 SharpDX/DirectX 应用程序



我正在尝试使用DeviceCreationFlags.Debug启动我的 directX/SharpDX 应用程序,但在启动时遇到以下崩溃:

SharpDX.SharpDXException: HRESULT: [0x80004005], Module: [General], ApiCode: [E_FAIL/Unspecified error], Message: Unspecified error
at SharpDX.Result.CheckError()
at SharpDX.Direct3D11.Device.CreateDevice(Adapter adapter, DriverType driverType, DeviceCreationFlags flags, FeatureLevel[] featureLevels)
at SharpDX.Direct3D11.Device..ctor(Adapter adapter, DeviceCreationFlags flags, FeatureLevel[] featureLevels)
at SharpDX.Toolkit.Graphics.GraphicsDevice..ctor(GraphicsAdapter adapter, DeviceCreationFlags flags, FeatureLevel[] featureLevels)
at SharpDX.Toolkit.GamePlatform.CreateDevice(GraphicsDeviceInformation deviceInformation)
at SharpDX.Toolkit.GraphicsDeviceManager.CreateDevice(GraphicsDeviceInformation newInfo)
at SharpDX.Toolkit.GraphicsDeviceManager.ChangeOrCreateDevice(Boolean forceCreate)
at SharpDX.Toolkit.GraphicsDeviceManager.SharpDX.Toolkit.IGraphicsDeviceManager.CreateDevice()
at SharpDX.Toolkit.Game.InitializeBeforeRun()
at SharpDX.Toolkit.GameWindowDesktop.Run()
at SharpDX.Toolkit.GamePlatform.Run(GameContext gameContext)
at SharpDX.Toolkit.Game.Run(GameContext gameContext)
at wrapper.Program.Main(String[] args)

这是在Win7 32位上,我确实安装了June 2010 DirextX SDK和运行时以及Windows 7的Windows SDK。

顺便说一句,这个问题起源于这个问题:使用MediaFoundation渲染h264视频时SharpDX崩溃

来自 MSDN(第 D3D11_CREATE_DEVICE_FLAG 页):

D3D11_CREATE_DEVICE_DEBUG

创建支持调试层的设备。

若要使用此标志,必须安装 D3D11*SDKLayers.dll;否则,设备创建将失败。若要获取D3D11_1SDKLayers.dll,请安装适用于 Windows 8 的开发工具包。

这些文件不是 2010 年 6 月 SDK 的一部分。您必须在其他地方找到它们(即在Windows 8 SDK中,如建议的那样)。

安装

SDK 的替代方法是安装 Visual Studio 2012 或更高版本。它的安装将安装这些调试库。
这里提到了类似的问题:链接 => 解释 3

最新更新