summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_context.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_context.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c
index 66d0cf7759..7e7015defc 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.c
+++ b/src/gallium/drivers/llvmpipe/lp_context.c
@@ -106,7 +106,7 @@ static void llvmpipe_destroy( struct pipe_context *pipe )
}
}
- FREE( llvmpipe );
+ align_free( llvmpipe );
}
static unsigned int
@@ -143,11 +143,17 @@ llvmpipe_is_buffer_referenced( struct pipe_context *pipe,
struct pipe_context *
llvmpipe_create( struct pipe_screen *screen )
{
- struct llvmpipe_context *llvmpipe = CALLOC_STRUCT(llvmpipe_context);
+ struct llvmpipe_context *llvmpipe;
uint i;
+ llvmpipe = align_malloc(sizeof(struct llvmpipe_context), 16);
+ if (!llvmpipe)
+ return NULL;
+
util_init_math();
+ memset(llvmpipe, 0, sizeof *llvmpipe);
+
llvmpipe->pipe.winsys = screen->winsys;
llvmpipe->pipe.screen = screen;
llvmpipe->pipe.destroy = llvmpipe_destroy;