diff options
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_context.c')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_context.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c index f3ac6760db..2b22ce256e 100644 --- a/src/gallium/drivers/softpipe/sp_context.c +++ b/src/gallium/drivers/softpipe/sp_context.c @@ -35,6 +35,7 @@ #include "pipe/p_defines.h" #include "util/u_math.h" #include "util/u_memory.h" +#include "util/u_inlines.h" #include "sp_clear.h" #include "sp_context.h" #include "sp_flush.h" @@ -43,8 +44,6 @@ #include "sp_surface.h" #include "sp_tile_cache.h" #include "sp_tex_tile_cache.h" -#include "sp_texture.h" -#include "sp_winsys.h" #include "sp_query.h" @@ -112,9 +111,13 @@ softpipe_destroy( struct pipe_context *pipe ) pipe_texture_reference(&softpipe->vertex_textures[i], NULL); } - for (i = 0; i < Elements(softpipe->constants); i++) { - if (softpipe->constants[i].buffer) { - pipe_buffer_reference(&softpipe->constants[i].buffer, NULL); + for (i = 0; i < PIPE_SHADER_TYPES; i++) { + uint j; + + for (j = 0; j < PIPE_MAX_CONSTANT_BUFFERS; j++) { + if (softpipe->constants[i][j]) { + pipe_buffer_reference(&softpipe->constants[i][j], NULL); + } } } @@ -190,7 +193,8 @@ softpipe_render_condition( struct pipe_context *pipe, struct pipe_context * -softpipe_create( struct pipe_screen *screen ) +softpipe_create_context( struct pipe_screen *screen, + void *priv ) { struct softpipe_context *softpipe = CALLOC_STRUCT(softpipe_context); uint i; @@ -209,6 +213,7 @@ softpipe_create( struct pipe_screen *screen ) softpipe->pipe.winsys = screen->winsys; softpipe->pipe.screen = screen; softpipe->pipe.destroy = softpipe_destroy; + softpipe->pipe.priv = priv; /* state setters */ softpipe->pipe.create_blend_state = softpipe_create_blend_state; @@ -256,6 +261,8 @@ softpipe_create( struct pipe_screen *screen ) softpipe->pipe.draw_arrays = softpipe_draw_arrays; softpipe->pipe.draw_elements = softpipe_draw_elements; softpipe->pipe.draw_range_elements = softpipe_draw_range_elements; + softpipe->pipe.draw_arrays_instanced = softpipe_draw_arrays_instanced; + softpipe->pipe.draw_elements_instanced = softpipe_draw_elements_instanced; softpipe->pipe.clear = softpipe_clear; softpipe->pipe.flush = softpipe_flush; |