From: Matt Turner Date: Mon, 29 Jun 2015 21:05:27 +0000 (-0700) Subject: i965: Set annotation_info's mem_ctx. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=93e371c140cb1aa438ce3c1a9946811d92032897;p=mesa.git i965: Set annotation_info's mem_ctx. It was being memset to 0 previously. Reviewed-by: Topi Pohjolainen --- diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp index 974219f3ece..34fdc16cc66 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp @@ -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, diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp index 693f5835412..f5e493efc8f 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp @@ -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, diff --git a/src/mesa/drivers/dri/i965/intel_asm_annotation.c b/src/mesa/drivers/dri/i965/intel_asm_annotation.c index b3d6324a5fe..f87a9bbe967 100644 --- a/src/mesa/drivers/dri/i965/intel_asm_annotation.c +++ b/src/mesa/drivers/dri/i965/intel_asm_annotation.c @@ -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);