Mesa (master): gallium/u_blitter: set sample mask to ~0

Marek Olšák mareko at kemper.freedesktop.org
Sat Aug 4 13:01:10 UTC 2012


Module: Mesa
Branch: master
Commit: 6c420b166814fccb160e39cc9ea8cbdaf4e7c830
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6c420b166814fccb160e39cc9ea8cbdaf4e7c830

Author: Marek Olšák <maraeo at gmail.com>
Date:   Sun Jul 22 20:27:04 2012 +0200

gallium/u_blitter: set sample mask to ~0

Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/gallium/auxiliary/util/u_blitter.c |   10 ++++++++++
 src/gallium/auxiliary/util/u_blitter.h |   10 ++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index 22a828f..b79ade6 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -439,6 +439,12 @@ static void blitter_restore_fragment_states(struct blitter_context_priv *ctx)
    pipe->bind_blend_state(pipe, ctx->base.saved_blend_state);
    ctx->base.saved_blend_state = INVALID_PTR;
 
+   /* Sample mask. */
+   if (ctx->base.is_sample_mask_saved) {
+      pipe->set_sample_mask(pipe, ctx->base.saved_sample_mask);
+      ctx->base.is_sample_mask_saved = FALSE;
+   }
+
    /* Miscellaneous states. */
    /* XXX check whether these are saved and whether they need to be restored
     * (depending on the operation) */
@@ -848,6 +854,7 @@ static void util_blitter_clear_custom(struct blitter_context *blitter,
       pipe->bind_vertex_elements_state(pipe, ctx->velem_state);
    }
    pipe->bind_fs_state(pipe, blitter_get_fs_col(ctx, num_cbufs, int_format));
+   pipe->set_sample_mask(pipe, ~0);
 
    blitter_set_common_draw_rect_state(ctx);
    blitter_set_dst_dimensions(ctx, width, height);
@@ -1097,6 +1104,7 @@ void util_blitter_copy_texture_view(struct blitter_context *blitter,
 
    pipe->bind_vertex_elements_state(pipe, ctx->velem_state);
    pipe->set_framebuffer_state(pipe, &fb_state);
+   pipe->set_sample_mask(pipe, ~0);
 
    blitter_set_common_draw_rect_state(ctx);
    blitter_set_dst_dimensions(ctx, dst->width, dst->height);
@@ -1184,6 +1192,7 @@ void util_blitter_clear_render_target(struct blitter_context *blitter,
    fb_state.cbufs[0] = dstsurf;
    fb_state.zsbuf = 0;
    pipe->set_framebuffer_state(pipe, &fb_state);
+   pipe->set_sample_mask(pipe, ~0);
 
    blitter_set_common_draw_rect_state(ctx);
    blitter_set_dst_dimensions(ctx, dstsurf->width, dstsurf->height);
@@ -1249,6 +1258,7 @@ void util_blitter_clear_depth_stencil(struct blitter_context *blitter,
    fb_state.cbufs[0] = 0;
    fb_state.zsbuf = dstsurf;
    pipe->set_framebuffer_state(pipe, &fb_state);
+   pipe->set_sample_mask(pipe, ~0);
 
    blitter_set_common_draw_rect_state(ctx);
    blitter_set_dst_dimensions(ctx, dstsurf->width, dstsurf->height);
diff --git a/src/gallium/auxiliary/util/u_blitter.h b/src/gallium/auxiliary/util/u_blitter.h
index 2db984c..8d6be78 100644
--- a/src/gallium/auxiliary/util/u_blitter.h
+++ b/src/gallium/auxiliary/util/u_blitter.h
@@ -94,6 +94,8 @@ struct blitter_context
    struct pipe_framebuffer_state saved_fb_state;  /**< framebuffer state */
    struct pipe_stencil_ref saved_stencil_ref;     /**< stencil ref */
    struct pipe_viewport_state saved_viewport;
+   boolean is_sample_mask_saved;
+   unsigned saved_sample_mask;
 
    int saved_num_sampler_states;
    void *saved_sampler_states[PIPE_MAX_SAMPLERS];
@@ -418,6 +420,14 @@ util_blitter_save_so_targets(struct blitter_context *blitter,
                                targets[i]);
 }
 
+static INLINE void
+util_blitter_save_sample_mask(struct blitter_context *blitter,
+                              unsigned sample_mask)
+{
+   blitter->is_sample_mask_saved = TRUE;
+   blitter->saved_sample_mask = sample_mask;
+}
+
 #ifdef __cplusplus
 }
 #endif




More information about the mesa-commit mailing list