[Mesa-dev] [PATCH 0/1] gallium/hud: use double values for all graphs

Christoph Haag haagch+mesadev at frickel.club
Sat Jun 17 14:57:36 UTC 2017


I don't necessarily want this merged as is, but if nobody has objections
that is fine too.

I made this specifically because of the fps graph. If you run with a big
graph, e.g. GALLIUM_HUD='.h1000.w1000.c70fps',you will see the fps jump
between 59 and 60 fps with more values below 60 than at or above 60.

This is because hud_graph_add_value() takes an uint64_t value and fps
values like 59.99 get truncated to 59. Rounding would fix this too, but
drawing the differences between 59.51 and 59.99 fps might still be nice
to have.

The hud_graph struct stores the value as an uint64_t but curiously
hud_graph_add_value() casts the value to float for drawing the graph and
number_to_human_readable() casts the value to double for displaying the
number below the graph, so using always a double value doesn't even change
much.

Christoph Haag (1):
  gallium/hud: use double values for all graphs

 src/gallium/auxiliary/hud/hud_context.c | 6 +++---
 src/gallium/auxiliary/hud/hud_fps.c     | 4 ++--
 src/gallium/auxiliary/hud/hud_private.h | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

-- 
2.13.1



More information about the mesa-dev mailing list