diff options
author | Kenneth Graunke <[email protected]> | 2011-05-16 11:49:57 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2011-05-17 23:32:58 -0700 |
commit | 774fb90db3e83d5e7326b7a72e05ce805c306b24 (patch) | |
tree | 6d729d4fc538835cbe4fef4134c8721cd4befe9c /src/mesa/drivers/dri/i965/brw_gs.c | |
parent | ebeea9857339da5f0f0455c45a8350190bbad189 (diff) |
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 <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_gs.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_gs.c | 8 |
1 files changed, 6 insertions, 2 deletions
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] = { |