aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/failover
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2010-05-18 16:20:44 +0200
committerRoland Scheidegger <[email protected]>2010-05-18 16:20:44 +0200
commit43234cee40c48e14a3eab4268181d9b0b2b7cf79 (patch)
tree4eafa9bb75559f0502038796491da1f6ee0ffea3 /src/gallium/drivers/failover
parent2a15553e431f04d13b757a3a76e4eb7d794f1219 (diff)
gallium: implement set_sample_mask() in all drivers
prevents segfault when state trackers try to set default mask. Other option would be to make this required only for drivers supporting multisampling, but this seems more clean. Only dummy implementations (for normal drivers) provided (no driver supports multisampling yet neither).
Diffstat (limited to 'src/gallium/drivers/failover')
-rw-r--r--src/gallium/drivers/failover/fo_context.h2
-rw-r--r--src/gallium/drivers/failover/fo_state.c14
-rw-r--r--src/gallium/drivers/failover/fo_state_emit.c3
3 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/drivers/failover/fo_context.h b/src/gallium/drivers/failover/fo_context.h
index 88ae5ad60d5..9d3e0d0dba0 100644
--- a/src/gallium/drivers/failover/fo_context.h
+++ b/src/gallium/drivers/failover/fo_context.h
@@ -55,6 +55,7 @@
#define FO_NEW_CLEAR_COLOR 0x20000
#define FO_NEW_VERTEX_BUFFER 0x40000
#define FO_NEW_VERTEX_ELEMENT 0x80000
+#define FO_NEW_SAMPLE_MASK 0x100000
@@ -90,6 +91,7 @@ struct failover_context {
struct pipe_blend_color blend_color;
struct pipe_stencil_ref stencil_ref;
struct pipe_clip_state clip;
+ unsigned sample_mask;
struct pipe_framebuffer_state framebuffer;
struct pipe_poly_stipple poly_stipple;
struct pipe_scissor_state scissor;
diff --git a/src/gallium/drivers/failover/fo_state.c b/src/gallium/drivers/failover/fo_state.c
index 272e683067e..12e42379f98 100644
--- a/src/gallium/drivers/failover/fo_state.c
+++ b/src/gallium/drivers/failover/fo_state.c
@@ -125,6 +125,19 @@ failover_set_clip_state( struct pipe_context *pipe,
failover->hw->set_clip_state( failover->hw, clip );
}
+static void
+failover_set_sample_mask(struct pipe_context *pipe,
+ unsigned sample_mask)
+{
+ struct failover_context *failover = failover_context(pipe);
+
+ failover->sample_mask = sample_mask;
+ failover->dirty |= FO_NEW_SAMPLE_MASK;
+ failover->sw->set_sample_mask( failover->sw, sample_mask );
+ failover->hw->set_sample_mask( failover->hw, sample_mask );
+
+}
+
static void *
failover_create_depth_stencil_state(struct pipe_context *pipe,
@@ -614,6 +627,7 @@ failover_init_state_functions( struct failover_context *failover )
failover->pipe.set_blend_color = failover_set_blend_color;
failover->pipe.set_stencil_ref = failover_set_stencil_ref;
failover->pipe.set_clip_state = failover_set_clip_state;
+ failover->pipe.set_sample_mask = failover_set_sample_mask;
failover->pipe.set_framebuffer_state = failover_set_framebuffer_state;
failover->pipe.set_polygon_stipple = failover_set_polygon_stipple;
failover->pipe.set_scissor_state = failover_set_scissor_state;
diff --git a/src/gallium/drivers/failover/fo_state_emit.c b/src/gallium/drivers/failover/fo_state_emit.c
index 42bd6929a7f..147f23269ca 100644
--- a/src/gallium/drivers/failover/fo_state_emit.c
+++ b/src/gallium/drivers/failover/fo_state_emit.c
@@ -63,6 +63,9 @@ failover_state_emit( struct failover_context *failover )
if (failover->dirty & FO_NEW_CLIP)
failover->sw->set_clip_state( failover->sw, &failover->clip );
+ if (failover->dirty & FO_NEW_SAMPLE_MASK)
+ failover->sw->set_sample_mask( failover->sw, failover->sample_mask );
+
if (failover->dirty & FO_NEW_DEPTH_STENCIL)
failover->sw->bind_depth_stencil_alpha_state( failover->sw,
failover->depth_stencil->sw_state );