ctx->PerfMonitor.Groups = NULL;
}
+static inline void
+init_groups(struct gl_context *ctx)
+{
+ if (unlikely(!ctx->PerfMonitor.Groups))
+ ctx->Driver.InitPerfMonitorGroups(ctx);
+}
+
static struct gl_perf_monitor_object *
new_performance_monitor(struct gl_context *ctx, GLuint index)
{
GLuint *groups)
{
GET_CURRENT_CONTEXT(ctx);
+ init_groups(ctx);
if (numGroups != NULL)
*numGroups = ctx->PerfMonitor.NumGroups;
GLsizei countersSize, GLuint *counters)
{
GET_CURRENT_CONTEXT(ctx);
- const struct gl_perf_monitor_group *group_obj = get_group(ctx, group);
+ const struct gl_perf_monitor_group *group_obj;
+
+ init_groups(ctx);
+
+ group_obj = get_group(ctx, group);
if (group_obj == NULL) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glGetPerfMonitorCountersAMD(invalid group)");
GLsizei *length, GLchar *groupString)
{
GET_CURRENT_CONTEXT(ctx);
+ const struct gl_perf_monitor_group *group_obj;
- const struct gl_perf_monitor_group *group_obj = get_group(ctx, group);
+ init_groups(ctx);
+ group_obj = get_group(ctx, group);
if (group_obj == NULL) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetPerfMonitorGroupStringAMD");
return;
const struct gl_perf_monitor_group *group_obj;
const struct gl_perf_monitor_counter *counter_obj;
+ init_groups(ctx);
+
group_obj = get_group(ctx, group);
if (group_obj == NULL) {
const struct gl_perf_monitor_group *group_obj;
const struct gl_perf_monitor_counter *counter_obj;
+ init_groups(ctx);
+
group_obj = get_group(ctx, group);
if (group_obj == NULL) {
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glGenPerfMonitorsAMD(%d)\n", n);
+ init_groups(ctx);
+
if (n < 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGenPerfMonitorsAMD(n < 0)");
return;
GET_CURRENT_CONTEXT(ctx);
unsigned numGroups;
+ init_groups(ctx);
+
/* The GL_INTEL_performance_query spec says:
*
* "If queryId pointer is equal to 0, INVALID_VALUE error is generated."
_mesa_GetNextPerfQueryIdINTEL(GLuint queryId, GLuint *nextQueryId)
{
GET_CURRENT_CONTEXT(ctx);
+ init_groups(ctx);
/* The GL_INTEL_performance_query spec says:
*
GET_CURRENT_CONTEXT(ctx);
unsigned i;
+ init_groups(ctx);
+
/* The GL_INTEL_performance_query spec says:
*
* "If queryName does not reference a valid query name, an INVALID_VALUE
GET_CURRENT_CONTEXT(ctx);
unsigned i;
- const struct gl_perf_monitor_group *group_obj =
- get_group(ctx, queryid_to_index(queryId));
+ const struct gl_perf_monitor_group *group_obj;
+ init_groups(ctx);
+
+ group_obj = get_group(ctx, queryid_to_index(queryId));
if (group_obj == NULL) {
/* The GL_INTEL_performance_query spec says:
*
unsigned counterIndex;
unsigned i;
+ init_groups(ctx);
+
group_obj = get_group(ctx, queryid_to_index(queryId));
/* The GL_INTEL_performance_query spec says:
struct gl_perf_monitor_object *m;
unsigned i;
+ init_groups(ctx);
+
/* This is not specified in the extension, but is the only sane thing to
* do.
*/