How do you determine if WPF is using Hardware or Software Rendering?

前端 未结 7 1194
借酒劲吻你
借酒劲吻你 2020-11-27 16:06

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 cal

7条回答
  •  一个人的身影
    2020-11-27 16:21

    Check RenderCapability.Tier

    • Graphics Rendering Tiers
    • RenderCapability Class

    [UPDATE]

    • 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

    • 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.

提交回复
热议问题