WVR_EXPORT bool WVR_EnableAdaptiveQuality(bool enable, uint32_t strategyFlags = WVR_QualityStrategy_Default)
Enables the adaptive render quality and CPU/GPU performance level.
Use this API to allow the WaveVR SDK runtime to adjust CPU/GPU performance level automatically. It will use the strategies to improve the FPS when rendering performance is insufficient.
If WVR_QualityStrategy is not specified, “WVR_QualityStrategy_Default” is used to adjust the CPU/GPU performance level based on the system workload only.
- true if enableAdaptiveQuality is successful, otherwise return false.
- API Level 4
- Supported since Runtime version 4 or higher.
enable: Boolean to enable/disable WaveVR AdaptiveQuality.
strategyFlags: “bitwise-or” flags used to select strategies to improve the FPS when the rendering performance is insufficient.
Struct and enumeration¶
The enum WVR_QualityStrategy is defined as:
The folowing flags describe the strategies used by AdaptiveQuality when rendering quality is insufficent.
WVR_QualityStrategy_Default: Automatically adjusts CPU/GPU performance level if needed. This flag is always On.
WVR_QualityStrategy_SendQualityEvent= 1 << 1¶
WVR_QualityStrategy_QualityHint: Specify if it is needed to send events when the recommended quality has changed..
WVR_QualityStrategy_AutoFoveation= 1 << 2¶
WVR_QualityStrategy_AutoFoveation: Automatically enable/disable foveation rendering if needed.
WVR_QualityStrategy_AutoAMC= 1 << 3¶
WVR_QualityStrategy_AutoAMC: Experimental function
WVR_QualityStrategy_Reserved_2= 1 << 28¶
WVR_QualityStrategy_Reserved_2: System reserved.
WVR_QualityStrategy_Reserved_1= 1 << 29¶
WVR_QualityStrategy_Reserved_1: System reserved.
WVR_QualityStrategy_Reserved= 1 << 30¶
WVR_QualityStrategy_Reserved: System reserved.
How to use¶
The following is an example of this function:
#include <wvr/wvr_system.h> // Enable WVR_EnableAdaptiveQuality bool result = WVR_EnableAdaptiveQuality(true); if (result) LOGI("Setting WVR_EnableAdaptiveQuality is done."); else LOGE("Setting WVR_EnableAdaptiveQuality is failed"); // Disable WVR_EnableAdaptiveQuality result = WVR_EnableAdaptiveQuality(false); // Enable WVR_EnableAdaptiveQuality with "SendQualityEvent" strategy. // (Support on SDK3.2.0 or later). result = WVR_EnableAdaptiveQuality(true, WVR_QualityStrategy_SendQualityEvent); // Enable WVR_EnableAdaptiveQuality with "SendQualityEvent" and "AutoFoveation" strategies. (Support on SDK3.2.0 or later). result = WVR_EnableAdaptiveQuality(true, WVR_QualityStrategy_SendQualityEvent | WVR_QualityStrategy_AutoFoveation);
The API can be used to allow the WaveVR runtime to adjust the system performance automatically.
Starting from WaveVR SDK 3.2.0, this API will support specifying the WVR_QualityStrategy.
The behaviors differ based on the WaveVR SDK version used to build the app.
WaveVR SDK 3.1.1 to 3.1.6: WVR_EnableAdaptiveQuality(true) allows the WaveVR runtime to adjust the CPU/GPU performance level automatically and send events when the recommended quality changes based on the system workload.
WaveVR SDK 3.2.0 or later: WVR_EnableAdaptiveQuality(true), without assigning any strategies, will only allow the WaveVR runtime to adjust the CPU/GPU performance level automatically.
WVR_EnableAdaptiveQuality must be used after WVR_RenderInit is invoked.