X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fllvmpipe%2Flp_context.c;h=e63720c99ab6a0c75ae045d33848cc5d45b64f2b;hb=0639765b2850739af1678f10fc0c5706d5827776;hp=383e4b0614d29bc61d46c06b806de0e9ebff1264;hpb=880e3fb09b538f6f0b6fad2db7e0e10e9df43555;p=mesa.git diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c index 383e4b0614d..e63720c99ab 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.c +++ b/src/gallium/drivers/llvmpipe/lp_context.c @@ -40,14 +40,13 @@ #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 static void llvmpipe_destroy( struct pipe_context *pipe ) @@ -78,35 +77,18 @@ 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 ) { struct llvmpipe_context *llvmpipe; - struct llvmpipe_screen *llvmscreen = llvmpipe_screen(screen); llvmpipe = align_malloc(sizeof(struct llvmpipe_context), 16); if (!llvmpipe) @@ -173,16 +155,18 @@ 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. */ - llvmpipe->draw = draw_create_with_llvm(llvmscreen->engine); +#if USE_DRAW_LLVM + llvmpipe->draw = draw_create_with_llvm(); +#else + llvmpipe->draw = draw_create(); +#endif if (!llvmpipe->draw) goto fail; @@ -200,6 +184,10 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv ) draw_install_aaline_stage(llvmpipe->draw, &llvmpipe->pipe); draw_install_aapoint_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? */ draw_install_pstipple_stage(llvmpipe->draw, &llvmpipe->pipe);