本文介绍了您如何确定WPF使用的是硬件还是软件渲染?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在对各种平台上的WPF应用程序进行基准测试,我需要一种简单的方法来确定WPF是使用硬件还是软件渲染.
I'm benchmarking a WPF application on various platforms and I need an easy way to determine if WPF is using hardware or software rendering.
我似乎想起一个确定此问题的电话,但现在无法把手放在上面.
I seem to recall a call to determine this, but can't lay my hands on it right now.
还有,是否存在一种简单的基于代码的方法来将一个渲染管线强加于另一个管线?
Also, is there an easy, code based way to force one rendering pipeline over the other?
推荐答案
检查RenderCapability.Tier
Check the RenderCapability.Tier
- http://msdn.microsoft.com/library/ms742196(v = vs.100).aspx
- http://msdn.microsoft.com/zh-cn/library/system.windows.media.rendercapability_members.aspx
- http://msdn.microsoft.com/library/ms742196(v=vs.100).aspx
- http://msdn.microsoft.com/en-us/library/system.windows.media.rendercapability_members.aspx
[更新]
- RenderCapability.IsPixelShaderVersionSupported -获取一个值,该值指示是否支持指定的像素着色器版本.
- RenderCapability.IsShaderEffectSoftwareRenderingSupported -获取一个值,该值指示系统是否可以在软件中渲染位图效果.
- RenderCapability.Tier -获取一个值,该值指示当前线程的渲染层.
- RenderCapability.TierChanged -在更改当前线程的Dispatcher对象的呈现层时发生.
- RenderCapability.IsPixelShaderVersionSupported - Gets a value that indicates whether the specified pixel shader version is supported.
- RenderCapability.IsShaderEffectSoftwareRenderingSupported - Gets a value that indicates whether the system can render bitmap effects in software.
- RenderCapability.Tier - Gets a value that indicates the rendering tier for the current thread.
- RenderCapability.TierChanged - Occurs when the rendering tier has changed for the Dispatcher object of the current thread.
RenderCapability.Tier >> 16
- 渲染层0 -没有图形硬件加速. DirectX版本级别低于7.0版.
- 渲染层1 -部分图形硬件加速. DirectX版本级别大于或等于7.0版,并且小于9.0版.
- 渲染层2 -大多数图形功能使用图形硬件加速. DirectX版本级别大于或等于9.0版.
- Rendering Tier 0 - No graphics hardware acceleration. The DirectX version level is less than version 7.0.
- Rendering Tier 1 - Partial graphics hardware acceleration. The DirectX version level is greater than or equal to version 7.0, and lesser than version 9.0.
- Rendering Tier 2 - Most graphics features use graphics hardware acceleration. The DirectX version level is greater than or equal to version 9.0.
这篇关于您如何确定WPF使用的是硬件还是软件渲染?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!