summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2015-06-29 14:05:27 -0700
committerMatt Turner <[email protected]>2015-11-12 11:00:10 -0800
commit93e371c140cb1aa438ce3c1a9946811d92032897 (patch)
treed102420ad1513e4c0c1147f845df4f45913eed71
parent9ab45b4df91fadcbbec62828265644d7463b78bb (diff)
i965: Set annotation_info's mem_ctx.
It was being memset to 0 previously. Reviewed-by: Topi Pohjolainen <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_generator.cpp2
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_generator.cpp2
-rw-r--r--src/mesa/drivers/dri/i965/intel_asm_annotation.c3
3 files changed, 5 insertions, 2 deletions
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);