Skip to content
Commit aa741db0 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

opengl: Harden GLRenderTimeQuery against opengl providing bad timestamps

The end render timestamp can be slightly in the past before the start
render timestamp. This results in negative render times, which can make
kwin wait way more than just one vblank interval before starting the
next frame.

It appears that there is no way to detect if the gpu has performed a
disjoint operation in OpenGL. It's available only in GLES. As a way
around, this change makes the GLRenderTimeQuery insert two probes: one
queries gl timestamps when starting rendering and ending rendering;
another one just queries std::steady_clock before and after painting.
This hardens the GLRenderTimeQuery against OpenGL providing nonsensical
results sometimes.

BUG: 481721


(cherry picked from commit 0dc3f490)
parent 27d21535
Pipeline #618446 passed with stage
in 6 minutes and 30 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment