diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2013-11-13 17:15:23 -0800 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2013-11-17 18:51:07 -0800 |
commit | d12e0e8972e13addf37c2ad885ea3ae5357d69f4 (patch) | |
tree | 3258b94a0645a6b0517d7f3fae60b1fe6aa92025 /src | |
parent | bde5e4a1e64cd0ddd89556f654185d256743728f (diff) |
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@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | 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 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); |