summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/performance_monitor.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/main/performance_monitor.c b/src/mesa/main/performance_monitor.c
index c168bf5d423..6491b4200f5 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);