}
if (obj->oa.bo) {
- brw_bo_unreference(obj->oa.bo);
+ brw->perfquery.perf->vtbl.bo_unreference(obj->oa.bo);
obj->oa.bo = NULL;
}
case GEN_PERF_QUERY_TYPE_PIPELINE:
if (obj->pipeline_stats.bo) {
- brw_bo_unreference(obj->pipeline_stats.bo);
+ brw->perfquery.perf->vtbl.bo_unreference(obj->pipeline_stats.bo);
obj->pipeline_stats.bo = NULL;
}
{
struct brw_context *brw = brw_context(ctx);
struct brw_perf_query_object *obj = brw_perf_query(o);
+ struct gen_perf_config *perf_cfg = brw->perfquery.perf;
/* We can assume that the frontend waits for a query to complete
* before ever calling into here, so we don't have to worry about
dec_n_oa_users(brw);
}
- brw_bo_unreference(obj->oa.bo);
+ perf_cfg->vtbl.bo_unreference(obj->oa.bo);
obj->oa.bo = NULL;
}
case GEN_PERF_QUERY_TYPE_PIPELINE:
if (obj->pipeline_stats.bo) {
- brw_bo_unreference(obj->pipeline_stats.bo);
+ perf_cfg->vtbl.bo_unreference(obj->pipeline_stats.bo);
obj->pipeline_stats.bo = NULL;
}
break;
return brw_bo_alloc(bufmgr, name, size, BRW_MEMZONE_OTHER);
}
+typedef void (*bo_unreference_t)(void *);
+
static unsigned
brw_init_perf_query_info(struct gl_context *ctx)
{
struct gen_perf_config *perf_cfg = brw->perfquery.perf;
perf_cfg->vtbl.bo_alloc = brw_oa_bo_alloc;
+ perf_cfg->vtbl.bo_unreference = (bo_unreference_t)brw_bo_unreference;
init_pipeline_statistic_query_registers(brw);
brw_perf_query_register_mdapi_statistic_query(brw);