llvmpipe: enable draw llvm by default
[mesa.git] / src / gallium / drivers / llvmpipe / lp_context.c
index d94c2da2ff1daa20b95d32e719bca83015148ff8..efdc2450f79d3ba030715e46f9b4e5ed339a4f2b 100644 (file)
 #include "lp_context.h"
 #include "lp_flush.h"
 #include "lp_perf.h"
-#include "lp_screen.h"
 #include "lp_state.h"
 #include "lp_surface.h"
 #include "lp_query.h"
 #include "lp_setup.h"
 
 
-#define USE_DRAW_LLVM 0
+#define USE_DRAW_LLVM 1
 
 
 static void llvmpipe_destroy( struct pipe_context *pipe )
@@ -78,29 +77,13 @@ static void llvmpipe_destroy( struct pipe_context *pipe )
 
    for (i = 0; i < Elements(llvmpipe->constants); i++) {
       if (llvmpipe->constants[i]) {
-         pipe_buffer_reference(&llvmpipe->constants[i], NULL);
+         pipe_resource_reference(&llvmpipe->constants[i], NULL);
       }
    }
 
    align_free( llvmpipe );
 }
 
-static unsigned int
-llvmpipe_is_texture_referenced( struct pipe_context *pipe,
-                               struct pipe_texture *texture,
-                               unsigned face, unsigned level)
-{
-   struct llvmpipe_context *llvmpipe = llvmpipe_context( pipe );
-
-   return lp_setup_is_texture_referenced(llvmpipe->setup, texture);
-}
-
-static unsigned int
-llvmpipe_is_buffer_referenced( struct pipe_context *pipe,
-                              struct pipe_buffer *buf)
-{
-   return PIPE_UNREFERENCED;
-}
 
 struct pipe_context *
 llvmpipe_create_context( struct pipe_screen *screen, void *priv )
@@ -172,19 +155,17 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv )
    llvmpipe->pipe.clear = llvmpipe_clear;
    llvmpipe->pipe.flush = llvmpipe_flush;
 
-   llvmpipe->pipe.is_texture_referenced = llvmpipe_is_texture_referenced;
-   llvmpipe->pipe.is_buffer_referenced = llvmpipe_is_buffer_referenced;
 
    llvmpipe_init_query_funcs( llvmpipe );
-   llvmpipe_init_context_texture_funcs( &llvmpipe->pipe );
+   llvmpipe_init_context_resource_funcs( &llvmpipe->pipe );
 
    /*
     * Create drawing context and plug our rendering stage into it.
     */
 #if USE_DRAW_LLVM
-   llvmpipe->draw = draw_create_with_llvm();
+   llvmpipe->draw = draw_create_with_llvm(&llvmpipe->pipe);
 #else
-   llvmpipe->draw = draw_create();
+   llvmpipe->draw = draw_create(&llvmpipe->pipe);
 #endif
    if (!llvmpipe->draw)
       goto fail;
@@ -202,6 +183,11 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv )
    /* plug in AA line/point stages */
    draw_install_aaline_stage(llvmpipe->draw, &llvmpipe->pipe);
    draw_install_aapoint_stage(llvmpipe->draw, &llvmpipe->pipe);
+   draw_install_pstipple_stage(llvmpipe->draw, &llvmpipe->pipe);
+
+   /* convert points and lines into triangles: */
+   draw_wide_point_threshold(llvmpipe->draw, 0.0);
+   draw_wide_line_threshold(llvmpipe->draw, 0.0);
 
 #if USE_DRAW_STAGE_PSTIPPLE
    /* Do polygon stipple w/ texture map + frag prog? */