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: 0fd4359733 ("iris/perf: implement routines to return counter info")

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5473>
This commit is contained in:
Marcin Ślusarz 2020-06-15 14:26:26 +02:00 committed by Marge Bot
parent 2f4a112ec4
commit 00d3b13837

View file

@ -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);