Mesa (staging/20.1): st/mesa: fix reporting of float perf counters max value
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jul 6 20:42:14 UTC 2020
Module: Mesa
Branch: staging/20.1
Commit: 08f24ef02946ea9160673803e5662a8202ed5103
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=08f24ef02946ea9160673803e5662a8202ed5103
Author: Marcin Ślusarz <marcin.slusarz at intel.com>
Date: Mon Jun 15 13:48:43 2020 +0200
st/mesa: fix reporting of float perf counters max value
Some Piglit tests (rightfully) fail because of min >= max when exposed
to perf counters that do not explicitly define their max value.
Failing tests:
spec/amd_performance_monitor/api/test_counter_info
spec/amd_performance_monitor/vc4/test_counter_info
u32/u64 changes are no-ops.
Fixes: 4cd1cfb9831d ("st/mesa: implement GL_AMD_performance_monitor")
Signed-off-by: Marcin Ślusarz <marcin.slusarz at intel.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5473>
(cherry picked from commit 2f4a112ec4a4c45bdc99634af113531ddd7914a2)
---
.pick_status.json | 2 +-
src/mesa/state_tracker/st_cb_perfmon.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index 62a82689934..76b22a1f223 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -202,7 +202,7 @@
"description": "st/mesa: fix reporting of float perf counters max value",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "4cd1cfb9831d4d4081cbe80b0d72b340c8fd0c2c"
},
diff --git a/src/mesa/state_tracker/st_cb_perfmon.c b/src/mesa/state_tracker/st_cb_perfmon.c
index 8025cb4a452..0f5aa371d6a 100644
--- a/src/mesa/state_tracker/st_cb_perfmon.c
+++ b/src/mesa/state_tracker/st_cb_perfmon.c
@@ -404,17 +404,17 @@ st_InitPerfMonitorGroups(struct gl_context *ctx)
case PIPE_DRIVER_QUERY_TYPE_MICROSECONDS:
case PIPE_DRIVER_QUERY_TYPE_HZ:
c->Minimum.u64 = 0;
- c->Maximum.u64 = info.max_value.u64 ? info.max_value.u64 : -1;
+ c->Maximum.u64 = info.max_value.u64 ? info.max_value.u64 : UINT64_MAX;
c->Type = GL_UNSIGNED_INT64_AMD;
break;
case PIPE_DRIVER_QUERY_TYPE_UINT:
c->Minimum.u32 = 0;
- c->Maximum.u32 = info.max_value.u32 ? info.max_value.u32 : -1;
+ c->Maximum.u32 = info.max_value.u32 ? info.max_value.u32 : UINT32_MAX;
c->Type = GL_UNSIGNED_INT;
break;
case PIPE_DRIVER_QUERY_TYPE_FLOAT:
c->Minimum.f = 0.0;
- c->Maximum.f = info.max_value.f ? info.max_value.f : -1;
+ c->Maximum.f = info.max_value.f ? info.max_value.f : FLT_MAX;
c->Type = GL_FLOAT;
break;
case PIPE_DRIVER_QUERY_TYPE_PERCENTAGE:
More information about the mesa-commit
mailing list