Skip to content

Commit 0a1fb7e

Browse files
anholtcharles-lunarg
authored andcommitted
cube: Fix GOOGLE_display_timing desired-present-time calibration.
as the name says, we're calculating what the previous present's desired time should have been, which will have IPD added for the next_present_id's presentation. So for example, if we are processing the last presented frame's actualPresentTime, our multiple should be 0, not 1. Now the demo properly locks to 60fps for a 1.0 IPD on my 60Hz display.
1 parent 5e57c8f commit 0a1fb7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cube/cube.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ void DemoUpdateTargetIPD(struct demo *demo) {
11441144
}
11451145

11461146
if (calibrate_next) {
1147-
int64_t multiple = demo->next_present_id - past[count - 1].presentID;
1147+
int64_t multiple = demo->next_present_id - past[count - 1].presentID - 1;
11481148
demo->prev_desired_present_time = (past[count - 1].actualPresentTime + (multiple * demo->target_IPD));
11491149
}
11501150
free(past);

0 commit comments

Comments
 (0)