DirectX 10 视频模式切换和性能
在 DirectX 10 应用程序中,全屏和窗口模式之间的切换是否会产生任何类型的开销,例如必须重新创建纹理和/或顶点缓冲区?
换句话说,我是否可以构建一个旨在在窗口模式和全屏模式之间进行“大量”切换的应用程序,而不会在切换发生时遭受性能影响?
In a DirectX 10 application, does switching between fullscreen and windowed mode incur any sort of overhead like having to recreate textures and/or vertexbuffers?
In other words, can I build an application that is designed to do "a lot" of switching between windowed mode and fullscreen mode without having to suffer a performance hit when the switches occur?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在DirectX10中有DXGI。 您使用交换链。 交换链的缓冲区需要调整大小,因此会产生一些开销(当然),但据说是经过优化的。 我担心的是切换视图模式会导致用户癫痫发作。
http://msdn.microsoft.com/en-us /library/bb205075(VS.85).aspx
In DirectX10 there is DXGI. You use a swap chain. The buffer of the swap chain will need to be resized so there is some overhead (of course) but it is supposedly optimized. The thing I would be worried about is causing epileptic seizures on your users by switching view modes.
http://msdn.microsoft.com/en-us/library/bb205075(VS.85).aspx
在 D3D10 中,您无需在模式切换时重新创建纹理、缓冲区或任何 D3D 资源。 一个值得注意的例外是,在 ResizeBuffers 调用之后需要更新交换链后台缓冲区引用(应该这样做以获得最佳全屏性能),但这在性能方面并不是什么大问题。
尽管如此,这并不意味着模式改变是便宜的。 模式更改操作本身对于您的应用程序和系统的其余部分来说都是非常昂贵的(特别是在 Vista 中,DWM 需要重新启动)。 Win7改进了很多,所以我建议你玩一下它,看看它是否满足你的性能要求,但不要指望立即过渡。
In D3D10, you don't need to recreate your textures, buffers or any D3D resources on mode switch. One notable exception is swapchain backbuffer references need to be updated after ResizeBuffers call (which should be done for optimal fullscreen performance), but it's not that big of a deal in terms of performance.
Still, it doesn't mean mode change is cheap. Mode change operation itself is very expensive both for your app and the rest of the system (particularly, in Vista, DWM needs to be restarted). Win7 improved a lot, so I suggest you play with it and see if it meets your performance requirements, but don't expect instant transition.