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

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Sep 11 23:23:39 UTC 2017


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

--- Comment #3 from Niklas Haas <bugs.freedesktop at haasn.xyz> ---
Hello, this is the author of the affected `mpv` code.

I've reproduced and bisected the mesa issue, and the first bad commit is:

bd4b224fa6630262df2b70fd6a6fc8080ad59086 is the first bad commit
commit bd4b224fa6630262df2b70fd6a6fc8080ad59086
Author: Marek Olšák <marek.olsak at amd.com>
Date:   Mon May 15 17:27:25 2017 +0200

    gallium/radeon: use a top-of-pipe timestamp for the start of TIME_ELAPSED

    Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

:040000 040000 22f52d00a837608d7a43e50498519850bf6ccdf6
eebe49b7fe167a7d6f96fe2a18218f350dededce M      src

This leads me to believe it's just a cosmetic issue, rather than a geneuine
performance regression. In order to figure out whether the results were more
correct before or after the change, I compared the numbers of all of my render
passes (added together) against the measurements of a single TIME_ELAPSED query
that surrounds the entire frame. The numbers matched perfectly before this
commit. Since the commit, the per-pass numbers are all way higher than they
should be.

I suspect this is because the driver is now “over-estimating” the amount of
time taken in between successive passes. Consider the following call sequence:

glBeginQuery(GL_TIME_ELAPSED)
// submit some draw calls
glEndQuery(GL_TIME_ELAPSED)
glBeginQuery(GL_TIME_ELAPSED)
// submit some more draw calls
glEndQuery(GL_TIME_ELAPSED)

If what I suspect is right, and these are assembled into the same command
buffer, then the “record TOP_OF_PIPE timestamp” for both queries would possibly
fire at the same time (out of order with the draw calls), leading to an
over-counting of the time taken for the second set of draw calls.

Perhaps it would be more correct to submit all of the timestamps with the
pipeline stage set to BOTTOM_OF_PIPE bit, so that the timestamps are
(respectively) only recorded once the previous commands in the command buffer
have been fully realized?

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


More information about the mesa-dev mailing list