summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/failover/fo_state.c
diff options
context:
space:
mode:
authorZack Rusin <zack@tungstengraphics.com>2007-09-19 14:01:18 -0400
committerZack Rusin <zack@tungstengraphics.com>2007-09-19 14:01:18 -0400
commitfe555c39bb7fd530298b5be4a8f06bff41726c86 (patch)
tree68b9b24eb883c822266f6ef82608de3a817549fc /src/mesa/pipe/failover/fo_state.c
parentb6d50abd7d483029469a0faaa28e8e2f2f742c6d (diff)
Convert the rasterizer cso to the new semantics.
Basically make cso hold the driver specific struct, while managing the template.
Diffstat (limited to 'src/mesa/pipe/failover/fo_state.c')
-rw-r--r--src/mesa/pipe/failover/fo_state.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/src/mesa/pipe/failover/fo_state.c b/src/mesa/pipe/failover/fo_state.c
index ba110a6e4f..25725625e0 100644
--- a/src/mesa/pipe/failover/fo_state.c
+++ b/src/mesa/pipe/failover/fo_state.c
@@ -183,17 +183,42 @@ failover_set_polygon_stipple( struct pipe_context *pipe,
failover->hw->set_polygon_stipple( failover->hw, stipple );
}
+static void *
+failover_create_rasterizer_state(struct pipe_context *pipe,
+ const struct pipe_rasterizer_state *templ)
+{
+ struct fo_state *state = malloc(sizeof(struct fo_state));
+ struct failover_context *failover = failover_context(pipe);
+ state->sw_state = failover->sw->create_rasterizer_state(pipe, templ);
+ state->hw_state = failover->hw->create_rasterizer_state(pipe, templ);
+
+ return state;
+}
static void
-failover_bind_rasterizer_state( struct pipe_context *pipe,
- const struct pipe_rasterizer_state *setup )
+failover_bind_rasterizer_state(struct pipe_context *pipe,
+ void *raster)
{
struct failover_context *failover = failover_context(pipe);
- failover->rasterizer = setup;
+ failover->rasterizer = (struct fo_state *)raster;
failover->dirty |= FO_NEW_RASTERIZER;
- failover->hw->bind_rasterizer_state( failover->hw, setup );
+ failover->hw->bind_rasterizer_state( failover->hw, raster );
+}
+
+static void
+failover_delete_rasterizer_state(struct pipe_context *pipe,
+ void *raster)
+{
+ struct fo_state *state = (struct fo_state*)raster;
+ struct failover_context *failover = failover_context(pipe);
+
+ failover->sw->delete_rasterizer_state(pipe, state->sw_state);
+ failover->hw->delete_rasterizer_state(pipe, state->hw_state);
+ state->sw_state = 0;
+ state->hw_state = 0;
+ free(state);
}
@@ -284,7 +309,9 @@ failover_init_state_functions( struct failover_context *failover )
failover->pipe.delete_blend_state = failover_delete_blend_state;
failover->pipe.bind_sampler_state = failover_bind_sampler_state;
failover->pipe.bind_depth_stencil_state = failover_bind_depth_stencil_state;
+ failover->pipe.create_rasterizer_state = failover_create_rasterizer_state;
failover->pipe.bind_rasterizer_state = failover_bind_rasterizer_state;
+ failover->pipe.delete_rasterizer_state = failover_delete_rasterizer_state;
failover->pipe.bind_fs_state = failover_bind_fs_state;
failover->pipe.bind_vs_state = failover_bind_vs_state;