i965: Set annotation_info's mem_ctx.
authorMatt Turner <mattst88@gmail.com>
Mon, 29 Jun 2015 21:05:27 +0000 (14:05 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 12 Nov 2015 19:00:10 +0000 (11:00 -0800)
It was being memset to 0 previously.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
src/mesa/drivers/dri/i965/intel_asm_annotation.c

index 974219f3ece7e79103809d2bf89bd0ab7afc2262..34fdc16cc66f78266c86ebd228efeef126e69b4e 100644 (file)
@@ -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,
index 693f5835412dc3f21c0e22fbc3fe816287ebeb4f..f5e493efc8fb53f3f13df73391a2f33645c51978 100644 (file)
@@ -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,
index b3d6324a5fe3154ab8d262a0ca443b9aec34bd46..f87a9bbe967338092cc02ba1a7c95f11a0115dcd 100644 (file)
@@ -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);