From 9b75627fab5bf2ea90f27ddd31b60c54895f6de6 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Wed, 15 Apr 2009 15:53:34 +0200 Subject: gallium: Make sure we flush before some texture / buffer operations. Also implement context member functions to optimize away those flushes whenever possible. Signed-off-by: Thomas Hellstrom --- src/gallium/drivers/failover/fo_context.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/gallium/drivers/failover') diff --git a/src/gallium/drivers/failover/fo_context.c b/src/gallium/drivers/failover/fo_context.c index fcad717cf8..37184eac7b 100644 --- a/src/gallium/drivers/failover/fo_context.c +++ b/src/gallium/drivers/failover/fo_context.c @@ -105,7 +105,28 @@ static boolean failover_draw_arrays( struct pipe_context *pipe, return failover_draw_elements(pipe, NULL, 0, prim, start, count); } +static unsigned int +failover_is_texture_referenced( struct pipe_context *_pipe, + struct pipe_texture *texture, + unsigned face, unsigned level) +{ + struct failover_context *failover = failover_context( _pipe ); + struct pipe_context *pipe = (failover->mode == FO_HW) ? + failover->hw : failover->sw; + + return pipe->is_texture_referenced(pipe, texture, face, level); +} +static unsigned int +failover_is_buffer_referenced( struct pipe_context *_pipe, + struct pipe_buffer *buf) +{ + struct failover_context *failover = failover_context( _pipe ); + struct pipe_context *pipe = (failover->mode == FO_HW) ? + failover->hw : failover->sw; + + return pipe->is_buffer_referenced(pipe, buf); +} struct pipe_context *failover_create( struct pipe_context *hw, struct pipe_context *sw ) @@ -151,6 +172,8 @@ struct pipe_context *failover_create( struct pipe_context *hw, #endif failover->pipe.flush = hw->flush; + failover->pipe.is_texture_referenced = failover_is_texture_referenced; + failover->pipe.is_buffer_referenced = failover_is_buffer_referenced; failover->dirty = 0; -- cgit v1.2.3