mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
comp: Update nominal frame interval to match chosen mode in direct mdoe
This value is used in xrWaitFrame() to throttle the application's rendering down to the refresh rate of the HMD.
This commit is contained in:
parent
36d6b71e8a
commit
6b8103f31b
|
@ -468,6 +468,20 @@ comp_window_direct_get_primary_display_mode(struct comp_window_direct *w,
|
|||
props.parameters.visibleRegion.height,
|
||||
(float)props.parameters.refreshRate / 1000.);
|
||||
|
||||
int64_t new_frame_interval =
|
||||
1000. * 1000. * 1000. * 1000. / props.parameters.refreshRate;
|
||||
|
||||
COMP_DEBUG(w->base.c,
|
||||
"Updating compositor settings nominal frame interval from "
|
||||
"%lu (%f Hz) to %lu (%f Hz)",
|
||||
w->base.c->settings.nominal_frame_interval_ns,
|
||||
1000. * 1000. * 1000. /
|
||||
(float)w->base.c->settings.nominal_frame_interval_ns,
|
||||
new_frame_interval,
|
||||
(float)props.parameters.refreshRate / 1000.);
|
||||
|
||||
w->base.c->settings.nominal_frame_interval_ns = new_frame_interval;
|
||||
|
||||
delete[] mode_properties;
|
||||
|
||||
return props.displayMode;
|
||||
|
|
Loading…
Reference in a new issue