gallium/hud: Fix support for PIPE_DRIVER_QUERY_TYPE_FLOAT
authorBrian Paul <brianp@vmware.com>
Thu, 11 Jan 2018 18:11:04 +0000 (11:11 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 17 Jan 2018 18:17:56 +0000 (11:17 -0700)
commit92840bd27683996d1de86fbc5b95be798f99796b
tree6cf1801677dc430639a5db9dff44e0a08fab7d16
parent23a5fae317c40285956cee383b2ab774f84058d6
gallium/hud: Fix support for PIPE_DRIVER_QUERY_TYPE_FLOAT

Evidently, nobody has used PIPE_DRIVER_QUERY_TYPE_FLOAT up to this
point.  Adding a driver query of this type which returns the query
value in pipe_query_result::f resulted in garbage output in the HUD.

The problem is the pipe_query_result::f field was being accessed as
through the u64 field and being added to the query_info::results_cumulative
field.  This patch checks for PIPE_DRIVER_QUERY_TYPE_FLOAT in a few
places and scales the float by 1000 before converting to uint64_t.

Also, add some comments to explain the query_info::result_index field.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/hud/hud_context.c
src/gallium/auxiliary/hud/hud_driver_query.c