summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/failover
diff options
context:
space:
mode:
authorZack Rusin <zack@tungstengraphics.com>2007-09-17 11:55:18 -0400
committerZack Rusin <zack@tungstengraphics.com>2007-09-18 06:31:22 -0400
commitd6ac959833a8e40a27907940969c622692f749b1 (patch)
treeddb0c6d886142d66aabb27a3ca00c683f55dbc4c /src/mesa/pipe/failover
parent56edb98d975041cca2e4a3712126b151d80a045a (diff)
Combing depth and stencil objects and making them immutable.
Converting depth and stencil objects into a single state object (d3d10 like) and making it immutable.
Diffstat (limited to 'src/mesa/pipe/failover')
-rw-r--r--src/mesa/pipe/failover/fo_context.h40
-rw-r--r--src/mesa/pipe/failover/fo_state.c25
-rw-r--r--src/mesa/pipe/failover/fo_state_emit.c7
3 files changed, 27 insertions, 45 deletions
diff --git a/src/mesa/pipe/failover/fo_context.h b/src/mesa/pipe/failover/fo_context.h
index fa336193a8..63ec7239ab 100644
--- a/src/mesa/pipe/failover/fo_context.h
+++ b/src/mesa/pipe/failover/fo_context.h
@@ -36,25 +36,24 @@
-#define FO_NEW_VIEWPORT 0x1
-#define FO_NEW_SETUP 0x2
-#define FO_NEW_FRAGMENT_SHADER 0x4
-#define FO_NEW_BLEND 0x8
-#define FO_NEW_CLIP 0x10
-#define FO_NEW_SCISSOR 0x20
-#define FO_NEW_STIPPLE 0x40
-#define FO_NEW_FRAMEBUFFER 0x80
-#define FO_NEW_ALPHA_TEST 0x100
-#define FO_NEW_DEPTH_TEST 0x200
-#define FO_NEW_SAMPLER 0x400
-#define FO_NEW_TEXTURE 0x800
-#define FO_NEW_STENCIL 0x1000
-#define FO_NEW_VERTEX 0x2000
-#define FO_NEW_VERTEX_SHADER 0x4000
-#define FO_NEW_BLEND_COLOR 0x8000
-#define FO_NEW_CLEAR_COLOR 0x10000
-#define FO_NEW_VERTEX_BUFFER 0x20000
-#define FO_NEW_VERTEX_ELEMENT 0x40000
+#define FO_NEW_VIEWPORT 0x1
+#define FO_NEW_SETUP 0x2
+#define FO_NEW_FRAGMENT_SHADER 0x4
+#define FO_NEW_BLEND 0x8
+#define FO_NEW_CLIP 0x10
+#define FO_NEW_SCISSOR 0x20
+#define FO_NEW_STIPPLE 0x40
+#define FO_NEW_FRAMEBUFFER 0x80
+#define FO_NEW_ALPHA_TEST 0x100
+#define FO_NEW_DEPTH_STENCIL 0x200
+#define FO_NEW_SAMPLER 0x400
+#define FO_NEW_TEXTURE 0x800
+#define FO_NEW_VERTEX 0x2000
+#define FO_NEW_VERTEX_SHADER 0x4000
+#define FO_NEW_BLEND_COLOR 0x8000
+#define FO_NEW_CLEAR_COLOR 0x10000
+#define FO_NEW_VERTEX_BUFFER 0x20000
+#define FO_NEW_VERTEX_ELEMENT 0x40000
@@ -69,19 +68,18 @@ struct failover_context {
*/
const struct pipe_blend_state *blend;
const struct pipe_sampler_state *sampler[PIPE_MAX_SAMPLERS];
+ const struct pipe_depth_stencil_state *depth_stencil;
struct pipe_alpha_test_state alpha_test;
struct pipe_blend_color blend_color;
struct pipe_clear_color_state clear_color;
struct pipe_clip_state clip;
- struct pipe_depth_state depth_test;
struct pipe_framebuffer_state framebuffer;
struct pipe_shader_state fragment_shader;
struct pipe_shader_state vertex_shader;
struct pipe_poly_stipple poly_stipple;
struct pipe_scissor_state scissor;
struct pipe_setup_state setup;
- struct pipe_stencil_state stencil;
struct pipe_mipmap_tree *texture[PIPE_MAX_SAMPLERS];
struct pipe_viewport_state viewport;
struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX];
diff --git a/src/mesa/pipe/failover/fo_state.c b/src/mesa/pipe/failover/fo_state.c
index f3a99e4198..43b9757b31 100644
--- a/src/mesa/pipe/failover/fo_state.c
+++ b/src/mesa/pipe/failover/fo_state.c
@@ -103,14 +103,14 @@ failover_set_clear_color_state( struct pipe_context *pipe,
}
static void
-failover_set_depth_test_state(struct pipe_context *pipe,
- const struct pipe_depth_state *depth)
+failover_bind_depth_stencil_state(struct pipe_context *pipe,
+ const struct pipe_depth_stencil_state *depth_stencil)
{
struct failover_context *failover = failover_context(pipe);
- failover->depth_test = *depth;
- failover->dirty |= FO_NEW_DEPTH_TEST;
- failover->hw->set_depth_state( failover->hw, depth );
+ failover->depth_stencil = depth_stencil;
+ failover->dirty |= FO_NEW_DEPTH_STENCIL;
+ failover->hw->bind_depth_stencil_state( failover->hw, depth_stencil );
}
static void
@@ -184,18 +184,6 @@ failover_set_scissor_state( struct pipe_context *pipe,
}
static void
-failover_set_stencil_state(struct pipe_context *pipe,
- const struct pipe_stencil_state *stencil)
-{
- struct failover_context *failover = failover_context(pipe);
-
- failover->stencil = *stencil;
- failover->dirty |= FO_NEW_STENCIL;
- failover->hw->set_stencil_state( failover->hw, stencil );
-}
-
-
-static void
failover_bind_sampler_state(struct pipe_context *pipe,
unsigned unit,
const struct pipe_sampler_state *sampler)
@@ -268,19 +256,18 @@ 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.bind_depth_stencil_state = failover_bind_depth_stencil_state;
failover->pipe.set_alpha_test_state = failover_set_alpha_test_state;
failover->pipe.set_blend_color = failover_set_blend_color;
failover->pipe.set_clip_state = failover_set_clip_state;
failover->pipe.set_clear_color_state = failover_set_clear_color_state;
- failover->pipe.set_depth_state = failover_set_depth_test_state;
failover->pipe.set_framebuffer_state = failover_set_framebuffer_state;
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_scissor_state = failover_set_scissor_state;
failover->pipe.set_setup_state = failover_set_setup_state;
- failover->pipe.set_stencil_state = failover_set_stencil_state;
failover->pipe.set_texture_state = failover_set_texture_state;
failover->pipe.set_viewport_state = failover_set_viewport_state;
failover->pipe.set_vertex_buffer = failover_set_vertex_buffer;
diff --git a/src/mesa/pipe/failover/fo_state_emit.c b/src/mesa/pipe/failover/fo_state_emit.c
index 9d462678c5..3a1865d766 100644
--- a/src/mesa/pipe/failover/fo_state_emit.c
+++ b/src/mesa/pipe/failover/fo_state_emit.c
@@ -70,8 +70,8 @@ failover_state_emit( struct failover_context *failover )
if (failover->dirty & FO_NEW_CLEAR_COLOR)
failover->sw->set_clear_color_state( failover->sw, &failover->clear_color );
- if (failover->dirty & FO_NEW_DEPTH_TEST)
- failover->sw->set_depth_state( failover->sw, &failover->depth_test );
+ if (failover->dirty & FO_NEW_DEPTH_STENCIL)
+ failover->sw->bind_depth_stencil_state( failover->sw, failover->depth_stencil );
if (failover->dirty & FO_NEW_FRAMEBUFFER)
failover->sw->set_framebuffer_state( failover->sw, &failover->framebuffer );
@@ -91,9 +91,6 @@ failover_state_emit( struct failover_context *failover )
if (failover->dirty & FO_NEW_SCISSOR)
failover->sw->set_scissor_state( failover->sw, &failover->scissor );
- if (failover->dirty & FO_NEW_STENCIL)
- failover->sw->set_stencil_state( failover->sw, &failover->stencil );
-
if (failover->dirty & FO_NEW_VIEWPORT)
failover->sw->set_viewport_state( failover->sw, &failover->viewport );