前缓冲区丢失后 HRESULT 0x8876086a
我使用 DirectX 在非托管代码中渲染图像,并使用 WPF 中的 D3DImage 来托管表面。当系统进入睡眠状态时,将引发 frontBufferLost 事件。该事件已处理,所有资源均被销毁并重新创建。
在非托管代码中使用 Direct3D9 时,一切正常。引发事件后,将重新创建设备并执行渲染,不会出现任何错误。
但是当我在引擎中使用 DirectX10 时,由于我还需要 Direct3D9 设备用于 Surface 队列,因此我尝试删除并重新创建 10 和 9 设备。在此阶段,在 GetDeviceCaps 调用期间,我总是收到 0x8876086a,我认为这是设备不可用。
有人可以帮我解决这个问题吗?
I am using DirectX to render images in unmanaged code and a D3DImage in WPF to host the surface. When the system goes to sleep, the frontBufferLost event is raised. The event is handled and all the resources are destroyed and recreated.
While using Direct3D9 in unmanaged code, everything works properly. Once the event is raised, device is recreated and rendering is performed without any error.
But when I use DirectX10 in engine, since I also need Direct3D9 device for the purpose of Surface queue, I try to delete and recreate both 10 and 9 devices. At this stage, during the GetDeviceCaps call, I always get 0x8876086a which I think is device not available.
Can someone help me out with this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常解决此类问题的最佳方法是进入 DirectX 属性控制面板,切换到 DirectX 的调试版本,将调试输出级别一直调高,然后启动您的应用程序。如果您在 GetDeviceCaps() 调用失败时在 Visual Studio 中观察输出窗口,您将有望看到问题。
祝你好运!
The best way to usually solve this type of problem is to go into the DirectX Properties control panel, switch to the debug version of DirectX, turn the debug output level all the way up, and then fire up your app. If you watch your output window in Visual Studio when your GetDeviceCaps() call fails, you will hopefully see the problem.
Good luck!