summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_context.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-12-24 18:16:16 +0100
committerMarek Olšák <maraeo@gmail.com>2010-12-24 18:38:03 +0100
commit88550083b3857184445075e70fed8b2eed4952a1 (patch)
tree34a0dd9da7b1b9272dba842bf35bd2d7b2c2e8c5 /src/gallium/drivers/r300/r300_context.c
parent8fc6c5fb3684ba3f4a8810b8db09540de1187782 (diff)
r300g/swtcl: re-enable LLVM
Based on a patch from Drill <drill87@gmail.com>. NOTE: This is a candidate for the 7.10 branch.
Diffstat (limited to 'src/gallium/drivers/r300/r300_context.c')
-rw-r--r--src/gallium/drivers/r300/r300_context.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index bf1b8c33c0..848020c8be 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -35,6 +35,10 @@
#include "r300_screen_buffer.h"
#include "r300_winsys.h"
+#ifdef HAVE_LLVM
+#include "gallivm/lp_bld_init.h"
+#endif
+
static void r300_update_num_contexts(struct r300_screen *r300screen,
int diff)
{
@@ -101,9 +105,14 @@ static void r300_destroy_context(struct pipe_context* context)
if (r300->blitter)
util_blitter_destroy(r300->blitter);
- if (r300->draw)
+ if (r300->draw) {
draw_destroy(r300->draw);
+#ifdef HAVE_LLVM
+ gallivm_destroy(r300->gallivm);
+#endif
+ }
+
if (r300->upload_vb)
u_upload_destroy(r300->upload_vb);
if (r300->upload_ib)
@@ -422,7 +431,12 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
if (!r300screen->caps.has_tcl) {
/* Create a Draw. This is used for SW TCL. */
+#ifdef HAVE_LLVM
+ r300->gallivm = gallivm_create();
+ r300->draw = draw_create_gallivm(&r300->context, r300->gallivm);
+#else
r300->draw = draw_create(&r300->context);
+#endif
if (r300->draw == NULL)
goto fail;
/* Enable our renderer. */