If a monitor has ended, it means a result should eventually become
available, pending some flushing.
This is distinct from !m->Active; if a monitor has not been started,
then m->Active == false and m->Ended == false.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
{
GLuint Name;
+ /** True if the monitor is currently active (Begin called but not End). */
GLboolean Active;
+ /**
+ * True if the monitor has ended.
+ *
+ * This is distinct from !Active because it may never have began.
+ */
+ GLboolean Ended;
+
/**
* A list of groups with currently active counters.
*
if (m) {
/* Give the driver a chance to stop the monitor if it's active. */
- if (m->Active)
+ if (m->Active) {
ctx->Driver.ResetPerfMonitor(ctx, m);
+ m->Ended = false;
+ }
_mesa_HashRemove(ctx->PerfMonitor.Monitors, monitors[i]);
ralloc_free(m->ActiveGroups);
*/
if (ctx->Driver.BeginPerfMonitor(ctx, m)) {
m->Active = true;
+ m->Ended = false;
} else {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glBeginPerfMonitor(driver unable to begin monitoring)");
ctx->Driver.EndPerfMonitor(ctx, m);
m->Active = false;
+ m->Ended = true;
}
/**