diff options
author | Marek Olšák <[email protected]> | 2020-01-23 21:01:56 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2020-02-10 19:02:33 -0500 |
commit | 01443dc7383f4634e4a66fa194ed51db74186128 (patch) | |
tree | e7b1bbf6412331e92e940824e7b5aafeed4680aa | |
parent | 1082e6fcb87d723986b640b5c077d05692df3511 (diff) |
glx: print FPS with 2 decimal places
useful if FPS is low.
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3590>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3590>
-rw-r--r-- | src/glx/dri2_glx.c | 2 | ||||
-rw-r--r-- | src/glx/dri3_glx.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 9c222d81312..f7e306e5dbc 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -776,7 +776,7 @@ static void show_fps(struct dri2_drawable *draw) if (draw->previous_time + interval * 1000000 <= current_time) { if (draw->previous_time) { - fprintf(stderr, "libGL: FPS = %.1f\n", + fprintf(stderr, "libGL: FPS = %.2f\n", ((uint64_t)draw->frames * 1000000) / (double)(current_time - draw->previous_time)); } diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index a5cf0e3bf32..4664733c655 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -147,7 +147,7 @@ glx_dri3_show_fps(struct loader_dri3_drawable *draw, uint64_t current_ust) /* DRI3+Present together uses microseconds for UST. */ if (priv->previous_ust + interval * 1000000 <= current_ust) { if (priv->previous_ust) { - fprintf(stderr, "libGL: FPS = %.1f\n", + fprintf(stderr, "libGL: FPS = %.2f\n", ((uint64_t) priv->frames * 1000000) / (double)(current_ust - priv->previous_ust)); } |