diff options
author | Marcin Ślusarz <[email protected]> | 2020-06-15 14:26:26 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-07-06 08:40:32 +0000 |
commit | 00d3b13837c5edd299dc40cbd84505c8d1d5927f (patch) | |
tree | 9f623fdbb994bb011e276ccf36afa2f96ca93d21 /src/gallium/drivers/iris | |
parent | 2f4a112ec4a4c45bdc99634af113531ddd7914a2 (diff) |
iris: return max counter value for AMD_performance_monitor
glGetPerfMonitorCounterInfoAMD(..., ..., GL_COUNTER_RANGE_AMD, ...)
returned NAN (binary representation of uint64_t(-1) as float) as
a max value.
Fixes: 0fd4359733e6 ("iris/perf: implement routines to return counter info")
Signed-off-by: Marcin Ślusarz <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5473>
Diffstat (limited to 'src/gallium/drivers/iris')
-rw-r--r-- | src/gallium/drivers/iris/iris_monitor.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/iris/iris_monitor.c b/src/gallium/drivers/iris/iris_monitor.c index c4194052def..a8409607c7a 100644 --- a/src/gallium/drivers/iris/iris_monitor.c +++ b/src/gallium/drivers/iris/iris_monitor.c @@ -72,16 +72,17 @@ iris_get_monitor_info(struct pipe_screen *pscreen, unsigned index, case GEN_PERF_COUNTER_DATA_TYPE_BOOL32: case GEN_PERF_COUNTER_DATA_TYPE_UINT32: info->type = PIPE_DRIVER_QUERY_TYPE_UINT; - info->max_value.u32 = 0; + assert(counter->raw_max <= UINT32_MAX); + info->max_value.u32 = (uint32_t)counter->raw_max; break; case GEN_PERF_COUNTER_DATA_TYPE_UINT64: info->type = PIPE_DRIVER_QUERY_TYPE_UINT64; - info->max_value.u64 = 0; + info->max_value.u64 = counter->raw_max; break; case GEN_PERF_COUNTER_DATA_TYPE_FLOAT: case GEN_PERF_COUNTER_DATA_TYPE_DOUBLE: info->type = PIPE_DRIVER_QUERY_TYPE_FLOAT; - info->max_value.u64 = -1; + info->max_value.f = counter->raw_max; break; default: assert(false); |