From 774fb90db3e83d5e7326b7a72e05ce805c306b24 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 16 May 2011 11:49:57 -0700 Subject: i965: Get a ralloc context into brw_compile. This would be so much easier if we were using C++; we could simply use constructors and destructors. Instead, we have to update all the callers. While we're at it, ralloc various brw_wm_compile fields rather than explicitly calloc/free'ing them. Signed-off-by: Kenneth Graunke Reviewed-by: Eric Anholt --- src/mesa/drivers/dri/i965/brw_gs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mesa/drivers/dri/i965/brw_gs.c') diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c index c6d3a09e06a..aaffe94e981 100644 --- a/src/mesa/drivers/dri/i965/brw_gs.c +++ b/src/mesa/drivers/dri/i965/brw_gs.c @@ -42,7 +42,7 @@ #include "brw_state.h" #include "brw_gs.h" - +#include "../glsl/ralloc.h" static void compile_gs_prog( struct brw_context *brw, struct brw_gs_prog_key *key ) @@ -50,6 +50,7 @@ static void compile_gs_prog( struct brw_context *brw, struct intel_context *intel = &brw->intel; struct brw_gs_compile c; const GLuint *program; + void *mem_ctx; GLuint program_size; /* Gen6: VF has already converted into polygon, and LINELOOP is @@ -73,10 +74,11 @@ static void compile_gs_prog( struct brw_context *brw, c.nr_bytes = c.nr_regs * REG_SIZE; + mem_ctx = NULL; /* Begin the compilation: */ - brw_init_compile(brw, &c.func); + brw_init_compile(brw, &c.func, mem_ctx); c.func.single_program_flow = 1; @@ -101,6 +103,7 @@ static void compile_gs_prog( struct brw_context *brw, brw_gs_lines( &c ); break; default: + ralloc_free(mem_ctx); return; } @@ -126,6 +129,7 @@ static void compile_gs_prog( struct brw_context *brw, program, program_size, &c.prog_data, sizeof(c.prog_data), &brw->gs.prog_data); + ralloc_free(mem_ctx); } static const GLenum gs_prim[GL_POLYGON+1] = { -- cgit v1.2.3