Class FBDisplayRefreshRate
On platforms which support dynamically adjusting the display refresh rate, application developers may request a specific display refresh rate in order to improve the overall user experience, examples include:
- A video application may choose a display refresh rate which better matches the video content playback rate in order to achieve smoother video frames.
- An application which can support a higher frame rate may choose to render at the higher rate to improve the overall perceptual quality, for example, lower latency and less flicker.
This extension allows:
- An application to identify what display refresh rates the session supports and the current display refresh rate.
- An application to request a display refresh rate to indicate its preference to the runtime.
- An application to receive notification of changes to the display refresh rate which are delivered via events.
In order to enable the functionality of this extension, the application must pass the name of the extension into CreateInstance via the XrInstanceCreateInfo::enabledExtensionNames parameter as indicated in the extension section.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intExtendsXrResult.static final StringThe extension name.static final intThe extension specification version.static final intExtendsXrStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic intnxrEnumerateDisplayRefreshRatesFB(XrSession session, int displayRefreshRateCapacityInput, long displayRefreshRateCountOutput, long displayRefreshRates) Unsafe version of:EnumerateDisplayRefreshRatesFBstatic intnxrGetDisplayRefreshRateFB(XrSession session, long displayRefreshRate) Unsafe version of:GetDisplayRefreshRateFBstatic intxrEnumerateDisplayRefreshRatesFB(XrSession session, IntBuffer displayRefreshRateCountOutput, @Nullable FloatBuffer displayRefreshRates) Enumerates display refresh rates.static intxrGetDisplayRefreshRateFB(XrSession session, FloatBuffer displayRefreshRate) Get the current display refresh rate.static intxrRequestDisplayRefreshRateFB(XrSession session, float displayRefreshRate) Request a display refresh rate.
-
Field Details
-
XR_FB_display_refresh_rate_SPEC_VERSION
public static final int XR_FB_display_refresh_rate_SPEC_VERSIONThe extension specification version.- See Also:
-
XR_FB_DISPLAY_REFRESH_RATE_EXTENSION_NAME
The extension name.- See Also:
-
XR_TYPE_EVENT_DATA_DISPLAY_REFRESH_RATE_CHANGED_FB
public static final int XR_TYPE_EVENT_DATA_DISPLAY_REFRESH_RATE_CHANGED_FBExtendsXrStructureType.- See Also:
-
XR_ERROR_DISPLAY_REFRESH_RATE_UNSUPPORTED_FB
public static final int XR_ERROR_DISPLAY_REFRESH_RATE_UNSUPPORTED_FBExtendsXrResult.- See Also:
-
-
Method Details
-
nxrEnumerateDisplayRefreshRatesFB
public static int nxrEnumerateDisplayRefreshRatesFB(XrSession session, int displayRefreshRateCapacityInput, long displayRefreshRateCountOutput, long displayRefreshRates) Unsafe version of:EnumerateDisplayRefreshRatesFB- Parameters:
displayRefreshRateCapacityInput- the capacity of thedisplayRefreshRates, or 0 to retrieve the required capacity.
-
xrEnumerateDisplayRefreshRatesFB
public static int xrEnumerateDisplayRefreshRatesFB(XrSession session, IntBuffer displayRefreshRateCountOutput, @Nullable FloatBuffer displayRefreshRates) Enumerates display refresh rates.C Specification
The
EnumerateDisplayRefreshRatesFBfunction is defined as:XrResult xrEnumerateDisplayRefreshRatesFB( XrSession session, uint32_t displayRefreshRateCapacityInput, uint32_t* displayRefreshRateCountOutput, float* displayRefreshRates);Description
EnumerateDisplayRefreshRatesFBenumerates the display refresh rates supported by the current session. Display refresh rates must be in order from lowest to highest supported display refresh rates. Runtimes must always return identical buffer contents from this enumeration for the lifetime of the session.Valid Usage (Implicit)
- The
XR_FB_display_refresh_rateextension must be enabled prior to callingEnumerateDisplayRefreshRatesFB sessionmust be a validXrSessionhandledisplayRefreshRateCountOutputmust be a pointer to auint32_tvalue- If
displayRefreshRateCapacityInputis not 0,displayRefreshRatesmust be a pointer to an array ofdisplayRefreshRateCapacityInputfloatvalues
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
session- the session that enumerates the supported display refresh rates.displayRefreshRateCountOutput- a pointer to the count offloatdisplayRefreshRateswritten, or a pointer to the required capacity in the case thatdisplayRefreshRateCapacityInputis insufficient.displayRefreshRates- a pointer to an array offloatdisplay refresh rates, but can beNULLifdisplayRefreshRateCapacityInputis 0.
- The
-
nxrGetDisplayRefreshRateFB
Unsafe version of:GetDisplayRefreshRateFB -
xrGetDisplayRefreshRateFB
Get the current display refresh rate.C Specification
The
GetDisplayRefreshRateFBfunction is defined as:XrResult xrGetDisplayRefreshRateFB( XrSession session, float* displayRefreshRate);Description
GetDisplayRefreshRateFBretrieves the current display refresh rate.Valid Usage (Implicit)
- The
XR_FB_display_refresh_rateextension must be enabled prior to callingGetDisplayRefreshRateFB sessionmust be a validXrSessionhandledisplayRefreshRatemust be a pointer to afloatvalue
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
session- theXrSessionto query.displayRefreshRate- a pointer to a float into which the current display refresh rate will be placed.
- The
-
xrRequestDisplayRefreshRateFB
Request a display refresh rate.C Specification
The
RequestDisplayRefreshRateFBfunction is defined as:XrResult xrRequestDisplayRefreshRateFB( XrSession session, float displayRefreshRate);Description
RequestDisplayRefreshRateFBprovides a mechanism for an application to request the system to dynamically change the display refresh rate to the application preferred value. The runtime must returnERROR_DISPLAY_REFRESH_RATE_UNSUPPORTED_FBifdisplayRefreshRateis not either0.0for one of the values enumerated byEnumerateDisplayRefreshRatesFB. A display refresh rate of0.0findicates the application has no preference.Note that this is only a request and does not guarantee the system will switch to the requested display refresh rate.
Valid Usage (Implicit)
- The
XR_FB_display_refresh_rateextension must be enabled prior to callingRequestDisplayRefreshRateFB sessionmust be a validXrSessionhandle
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
session- a validXrSessionhandle.displayRefreshRate-0.0for a supported display refresh rate. Supported display refresh rates are indicated byEnumerateDisplayRefreshRatesFB.
- The
-