diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2011-05-16 11:49:57 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2011-05-17 23:32:58 -0700 |
commit | 774fb90db3e83d5e7326b7a72e05ce805c306b24 (patch) | |
tree | 6d729d4fc538835cbe4fef4134c8721cd4befe9c /src/mesa/drivers/dri/i965/brw_clip.c | |
parent | ebeea9857339da5f0f0455c45a8350190bbad189 (diff) | |
download | external_mesa3d-774fb90db3e83d5e7326b7a72e05ce805c306b24.zip external_mesa3d-774fb90db3e83d5e7326b7a72e05ce805c306b24.tar.gz external_mesa3d-774fb90db3e83d5e7326b7a72e05ce805c306b24.tar.bz2 |
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 <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_clip.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_clip.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c index 3c17551..c7d428b 100644 --- a/src/mesa/drivers/dri/i965/brw_clip.c +++ b/src/mesa/drivers/dri/i965/brw_clip.c @@ -42,6 +42,8 @@ #include "brw_state.h" #include "brw_clip.h" +#include "../glsl/ralloc.h" + #define FRONT_UNFILLED_BIT 0x1 #define BACK_UNFILLED_BIT 0x2 @@ -52,16 +54,19 @@ static void compile_clip_prog( struct brw_context *brw, struct intel_context *intel = &brw->intel; struct brw_clip_compile c; const GLuint *program; + void *mem_ctx; GLuint program_size; GLuint delta; GLuint i; GLuint header_regs; memset(&c, 0, sizeof(c)); + + mem_ctx = ralloc_context(NULL); /* Begin the compilation: */ - brw_init_compile(brw, &c.func); + brw_init_compile(brw, &c.func, mem_ctx); c.func.single_program_flow = 1; @@ -150,6 +155,7 @@ static void compile_clip_prog( struct brw_context *brw, program, program_size, &c.prog_data, sizeof(c.prog_data), &brw->clip.prog_data); + ralloc_free(mem_ctx); } /* Calculate interpolants for triangle and line rasterization. |