dri: get rid of LIBGL_SHOW_FPS
The same functionnality can be achieved using GALLIUM_HUD=stdout,fps (and for now a fallback is doing this if LIBGL_SHOW_FPS=1 is used). This removes one entry from the vtable and simplify dri3_handle_present_event. Reviewed-by: Emma Anholt <emma@anholt.net> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20494>
This commit is contained in:
@@ -654,29 +654,6 @@ unsigned dri2GetSwapEventType(Display* dpy, XID drawable)
|
||||
return glx_dpy->codes.first_event + GLX_BufferSwapComplete;
|
||||
}
|
||||
|
||||
static void show_fps(struct dri2_drawable *draw)
|
||||
{
|
||||
const int interval =
|
||||
((struct dri2_screen *) draw->base.psc)->show_fps_interval;
|
||||
struct timeval tv;
|
||||
uint64_t current_time;
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
current_time = (uint64_t)tv.tv_sec*1000000 + (uint64_t)tv.tv_usec;
|
||||
|
||||
draw->frames++;
|
||||
|
||||
if (draw->previous_time + interval * 1000000 <= current_time) {
|
||||
if (draw->previous_time) {
|
||||
fprintf(stderr, "libGL: FPS = %.2f\n",
|
||||
((uint64_t)draw->frames * 1000000) /
|
||||
(double)(current_time - draw->previous_time));
|
||||
}
|
||||
draw->frames = 0;
|
||||
draw->previous_time = current_time;
|
||||
}
|
||||
}
|
||||
|
||||
static int64_t
|
||||
dri2XcbSwapBuffers(Display *dpy,
|
||||
__GLXDRIdrawable *pdraw,
|
||||
@@ -744,10 +721,6 @@ dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor,
|
||||
ret = dri2XcbSwapBuffers(pdraw->psc->dpy, pdraw,
|
||||
target_msc, divisor, remainder);
|
||||
|
||||
if (psc->show_fps_interval) {
|
||||
show_fps(priv);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user