i965: Set annotation_info's mem_ctx.

It was being memset to 0 previously.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
Matt Turner
2015-06-29 14:05:27 -07:00
parent 9ab45b4df9
commit 93e371c140
3 changed files with 5 additions and 2 deletions
@@ -2267,7 +2267,7 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
dump_assembly(p->store, annotation.ann_count, annotation.ann,
p->devinfo);
ralloc_free(annotation.ann);
ralloc_free(annotation.mem_ctx);
}
compiler->shader_debug_log(log_data,
@@ -1560,7 +1560,7 @@ generate_code(struct brw_codegen *p,
dump_assembly(p->store, annotation.ann_count, annotation.ann,
p->devinfo);
ralloc_free(annotation.ann);
ralloc_free(annotation.mem_ctx);
}
compiler->shader_debug_log(log_data,
@@ -86,6 +86,9 @@ void annotate(const struct brw_device_info *devinfo,
struct annotation_info *annotation, const struct cfg_t *cfg,
struct backend_instruction *inst, unsigned offset)
{
if (annotation->mem_ctx == NULL)
annotation->mem_ctx = ralloc_context(NULL);
if (annotation->ann_size <= annotation->ann_count) {
int old_size = annotation->ann_size;
annotation->ann_size = MAX2(1024, annotation->ann_size * 2);