Bug ID 89014
Summary PIPE_QUERY_GPU_FINISHED is not acting as expected on SI
Product Mesa
Version git
Hardware Other
OS All
Status NEW
Severity normal
Priority medium
Component Drivers/Gallium/radeonsi
Assignee dri-devel@lists.freedesktop.org
Reporter axel.davy@ens.fr
QA Contact dri-devel@lists.freedesktop.org

I put it as radeonsi bug, but it is probably r600 bug given the implementation
seems shared there.

Some d3d9 games do manual throttling as advised at the end of:
http://www.nvidia.com/object/General_FAQ.html#G4

"A second solution is to use DirectX 9's Asynchronous Query functionality
(analogous to using fences in OpenGL).  At the end of your frame, insert a
D3DQUERYTYPE_EVENT query into your rendering stream.  You can then poll whether
the GPU has reached this event yet by using GetData."

Games like Heroes V of Might and Magic uses two d3d9 event queries (mapped to
PIPE_QUERY_GPU_FINISHED) to do manual throttling:

end query A
loop until query B is OK (d3d9: loop on GetData /pipe: loop on
pipe->get_query_result)
render
present frame
end query B
loop until query A is OK
render
present frame
etc

Only old apps seems to do this manual throttling, as likely recent drivers do
it automatically, like Mesa.

Both Gallium Nine and Wine get poor performance with this scheme and get same
performance (and is the same performance than by forcing a glfinish)

Not advertising the query under Gallium Nine gives a enormous performance boost
to the app. Similarly advertising the query, but not using
PIPE_QUERY_GPU_FINISHED but rather a custom implementation with pipe fences,
gives the correct performance.
In both cases, forcing glFinish gives the same bad performance than before.

Thus PIPE_QUERY_GPU_FINISHED implementation seems to have a bug that makes it
acts as glFinish instead of just waiting what was before the end query is
rendered.

What seems strange is that Wine uses ARB_sync to implement the query, and it
doesn't seem to be implemented in Mesa with PIPE_QUERY_GPU_FINISHED.


You are receiving this mail because: