From f117327a3f246713abfd4dc4320d4a1a7f1b811a Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 17 Sep 2007 09:47:41 -0400 Subject: Make sampler an immutable state object. Switch the sample to be an immutable state object. --- src/mesa/pipe/failover/fo_context.h | 2 +- src/mesa/pipe/failover/fo_state.c | 8 ++++---- src/mesa/pipe/failover/fo_state_emit.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/mesa/pipe/failover') diff --git a/src/mesa/pipe/failover/fo_context.h b/src/mesa/pipe/failover/fo_context.h index b065aa832a..fa336193a8 100644 --- a/src/mesa/pipe/failover/fo_context.h +++ b/src/mesa/pipe/failover/fo_context.h @@ -68,6 +68,7 @@ struct failover_context { /* The most recent drawing state as set by the driver: */ const struct pipe_blend_state *blend; + const struct pipe_sampler_state *sampler[PIPE_MAX_SAMPLERS]; struct pipe_alpha_test_state alpha_test; struct pipe_blend_color blend_color; @@ -79,7 +80,6 @@ struct failover_context { struct pipe_shader_state vertex_shader; struct pipe_poly_stipple poly_stipple; struct pipe_scissor_state scissor; - struct pipe_sampler_state sampler[PIPE_MAX_SAMPLERS]; struct pipe_setup_state setup; struct pipe_stencil_state stencil; struct pipe_mipmap_tree *texture[PIPE_MAX_SAMPLERS]; diff --git a/src/mesa/pipe/failover/fo_state.c b/src/mesa/pipe/failover/fo_state.c index 2357d7ef5c..f3a99e4198 100644 --- a/src/mesa/pipe/failover/fo_state.c +++ b/src/mesa/pipe/failover/fo_state.c @@ -196,16 +196,16 @@ failover_set_stencil_state(struct pipe_context *pipe, static void -failover_set_sampler_state(struct pipe_context *pipe, +failover_bind_sampler_state(struct pipe_context *pipe, unsigned unit, const struct pipe_sampler_state *sampler) { struct failover_context *failover = failover_context(pipe); - failover->sampler[unit] = *sampler; + failover->sampler[unit] = sampler; failover->dirty |= FO_NEW_SAMPLER; failover->dirty_sampler |= (1<hw->set_sampler_state( failover->hw, unit, sampler ); + failover->hw->bind_sampler_state( failover->hw, unit, sampler ); } @@ -267,6 +267,7 @@ void failover_init_state_functions( struct failover_context *failover ) { failover->pipe.bind_blend_state = failover_bind_blend_state; + failover->pipe.bind_sampler_state = failover_bind_sampler_state; failover->pipe.set_alpha_test_state = failover_set_alpha_test_state; failover->pipe.set_blend_color = failover_set_blend_color; @@ -277,7 +278,6 @@ failover_init_state_functions( struct failover_context *failover ) failover->pipe.set_fs_state = failover_set_fs_state; failover->pipe.set_vs_state = failover_set_vs_state; failover->pipe.set_polygon_stipple = failover_set_polygon_stipple; - failover->pipe.set_sampler_state = failover_set_sampler_state; failover->pipe.set_scissor_state = failover_set_scissor_state; failover->pipe.set_setup_state = failover_set_setup_state; failover->pipe.set_stencil_state = failover_set_stencil_state; diff --git a/src/mesa/pipe/failover/fo_state_emit.c b/src/mesa/pipe/failover/fo_state_emit.c index 77413d100b..9d462678c5 100644 --- a/src/mesa/pipe/failover/fo_state_emit.c +++ b/src/mesa/pipe/failover/fo_state_emit.c @@ -100,8 +100,8 @@ failover_state_emit( struct failover_context *failover ) if (failover->dirty & FO_NEW_SAMPLER) { for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { if (failover->dirty_sampler & (1<sw->set_sampler_state( failover->sw, i, - &failover->sampler[i] ); + failover->sw->bind_sampler_state( failover->sw, i, + failover->sampler[i] ); } } } -- cgit v1.2.3