[Mesa-dev] [Bug 102597] [Regression] mpv, high rendering times (two to three times higher)

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Sep 12 00:10:55 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=102597

--- Comment #6 from Marek Olšák <maraeo at gmail.com> ---
Here's why the times are different: Draw calls are not executed sequentially,
but instead they are executed in parallel when it's possible. If you start 10
draw calls wrapped around 10 TIME_ELAPSED queries, the start times will be
similar (they all should start quickly if compute units aren't overloaded), but
the end times will be different. The TIME_ELAPSED query then returns (end -
start).

Now some theory. The top-of-pipe timestamp means "before the next draw call
started". The bottom-of-pipe timestamp means "after the last draw call
finished". The driver subtracts top-of-pipe from bottom-of-pipe to get
TIME_ELAPSED.

That is an accurate implementation for measuring how much time each draw call
spent in this highly pipelined and parallel system that is the GPU. However,
it's actually not what the spec "suggests" in the Issues section of
ARB_timer_query. It suggests that TIME_ELAPSED should record both start and end
timestamps at bottom-of-pipe. That seems kinda silly, because it means that
TIME_ELAPSED should be (draw_finish_time - previous_draw_finish_time). What if
they finish nearly at the same time? TIME_ELAPSED would be close to 0, and that
is not how much time the draw call spent in the system.

This all becomes a non-issue if we simply assume that TIME_ELAPSED results are
not additive.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170912/a068a7a1/attachment.html>


More information about the mesa-dev mailing list