cogl: Do not call glFlush in cogl_gl_create_timestamp_query

SwapBuffers will implicitly flush the query along with the other GPU
work for the frame.

The comment was about this function being called for direct scanout,
which hasn't been the case since 56580ea7c941 ("backends/native: Assume
zero rendering time for direct scanout buffers").

This eliminates one GPU work flush to the kernel per frame with the
Mesa radeonsi driver, leaving only a single flush per frame.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4158>
This commit is contained in:
Michel Dänzer 2024-11-28 18:21:22 +01:00 committed by Marge Bot
parent 33a9a1cace
commit 18fbea0b03

View File

@ -525,14 +525,7 @@ cogl_gl_create_timestamp_query (CoglContext *context)
GE (context, glGenQueries (1, &query->id));
GE (context, glQueryCounter (query->id, GL_TIMESTAMP));
/* Flush right away so GL knows about our timestamp query.
*
* E.g. the direct scanout path doesn't call SwapBuffers or any other
* glFlush-inducing operation, and skipping explicit glFlush here results in
* the timestamp query being placed at the point of glGetQueryObject much
* later, resulting in a GPU timestamp much later on in time.
*/
context->glFlush ();
/* Flushing the query is left to the caller */
return query;
}