cancel
Showing results for 
Search instead for 
Did you mean: 

xrConvertWin32PerformanceCounterToTimeKHR returns the wrong XrTime

Anonymous
Not applicable
Using the Oculus runtime, xrConvertWin32PerformanceCounterToTimeKHR() appears to have a bug (at least on my system).

QueryPerformanceFrequency() returns 10000000 (1e7) on my machine, while XrTime is in nanoseconds. So intervals expressed in XrDuration should always be exactly 100 times larger than the corresponding differences between values reported by QueryPerformanceCounter().

On my machine, instead, intervals computed from the XrTime values given by xrConvertWin32PerformanceCounterToTimeKHR() are always exactly 10 times larger than the differences in QPC values.

The bug might have gone unnoticed because the absolute value of XrTime computed by xrConvertWin32PerformanceCounterToTimeKHR() is more or less 100 times larger than the QPC value (something like 99.9945 at application start), but when you compute differences between successive calls it's clear that the relative times are off by a factor of 10.

The same function works correctly with the Microsoft WMR runtime: both absolute times and intervals are exactly 100 * QPC values.
4 REPLIES 4

2EyeGuy
Adventurer
Can confirm. Time deltas are off by a factor of 10 on Oculus Runtime, but work correctly on SteamVR runtime.
There must be a typo in Oculus's code where someone
 accidentally typed 100000000 instead of 1000000000, and nobody noticed (for obvious reasons).

Anonymous
Not applicable
I must be old-fashioned, but I have to say that I miss the times when companies making software used actual bug trackers, instead of custom forums with huge fonts that nobody actually monitors 😕

eah
Protege
@LukeRoss  thanks for reporting this, I've filed a bug. I'll ask about getting a direct interface to our task system for devs as well, I agree it would be better.

eah
Protege
@2EyeGuy it'll be 1e9 in the next release...