summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_sf.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2011-05-16 11:49:57 -0700
committerKenneth Graunke <kenneth@whitecape.org>2011-05-17 23:32:58 -0700
commit774fb90db3e83d5e7326b7a72e05ce805c306b24 (patch)
tree6d729d4fc538835cbe4fef4134c8721cd4befe9c /src/mesa/drivers/dri/i965/brw_sf.c
parentebeea9857339da5f0f0455c45a8350190bbad189 (diff)
downloadexternal_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_sf.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_sf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c
index 5a03851..9b82fe1 100644
--- a/src/mesa/drivers/dri/i965/brw_sf.c
+++ b/src/mesa/drivers/dri/i965/brw_sf.c
@@ -43,20 +43,24 @@
#include "brw_sf.h"
#include "brw_state.h"
+#include "../glsl/ralloc.h"
+
static void compile_sf_prog( struct brw_context *brw,
struct brw_sf_prog_key *key )
{
struct intel_context *intel = &brw->intel;
struct brw_sf_compile c;
const GLuint *program;
+ void *mem_ctx;
GLuint program_size;
GLuint i, idx;
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.key = *key;
c.nr_attrs = brw_count_bits(c.key.attrs);
@@ -124,6 +128,7 @@ static void compile_sf_prog( struct brw_context *brw,
program, program_size,
&c.prog_data, sizeof(c.prog_data),
&brw->sf.prog_data);
+ ralloc_free(mem_ctx);
}
/* Calculate interpolants for triangle and line rasterization.