Mesa (master): mesa: Handle !m-> Ended for performance monitor result availability.
Kenneth Graunke
kwg at kemper.freedesktop.org
Mon Nov 18 02:53:34 UTC 2013
Module: Mesa
Branch: master
Commit: d12e0e8972e13addf37c2ad885ea3ae5357d69f4
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d12e0e8972e13addf37c2ad885ea3ae5357d69f4
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Wed Nov 13 17:15:23 2013 -0800
mesa: Handle !m->Ended for performance monitor result availability.
If a performance monitor has never ended, then no result can be
available. Core Mesa can easily handle this, saving drivers a tiny bit
of complexity.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/mesa/main/performance_monitor.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/src/mesa/main/performance_monitor.c b/src/mesa/main/performance_monitor.c
index c168bf5..6491b42 100644
--- a/src/mesa/main/performance_monitor.c
+++ b/src/mesa/main/performance_monitor.c
@@ -568,8 +568,12 @@ _mesa_GetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname,
return;
}
+ /* If the monitor has never ended, there is no result. */
+ bool result_available = m->Ended &&
+ ctx->Driver.IsPerfMonitorResultAvailable(ctx, m);
+
/* AMD appears to return 0 for all queries unless a result is available. */
- if (!ctx->Driver.IsPerfMonitorResultAvailable(ctx, m)) {
+ if (!result_available) {
*data = 0;
if (bytesWritten != NULL)
*bytesWritten = sizeof(GLuint);
More information about the mesa-commit
mailing list