gallium: make u_blitter code save/restore stencil ref values
authorRoland Scheidegger <sroland@vmware.com>
Thu, 11 Feb 2010 18:01:10 +0000 (19:01 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Thu, 11 Feb 2010 18:01:10 +0000 (19:01 +0100)
src/gallium/auxiliary/util/u_blitter.c
src/gallium/auxiliary/util/u_blitter.h
src/gallium/drivers/r300/r300_blit.c

index 0504538258da29b55111804c8b1522aaeffccbc6..1f7e25b84f2e7ebe28eeee2399ac46baff5eda1d 100644 (file)
@@ -262,6 +262,8 @@ static void blitter_restore_CSOs(struct blitter_context_priv *ctx)
    ctx->blitter.saved_fs = INVALID_PTR;
    ctx->blitter.saved_vs = INVALID_PTR;
 
+   pipe->set_stencil_ref(pipe, &ctx->blitter.saved_stencil_ref);
+
    /* restore the state objects which are required to be saved before copy/fill
     */
    if (ctx->blitter.saved_fb_state.nr_cbufs != ~0) {
index 3da5a6ca52583b0ade3f3b06c9e4ae6897ac840c..a2f17073ac6f6cdc9e9cba28bc52d5a40110f400 100644 (file)
@@ -47,6 +47,7 @@ struct blitter_context
    void *saved_fs, *saved_vs; /**< fragment shader, vertex shader */
 
    struct pipe_framebuffer_state saved_fb_state;  /**< framebuffer state */
+   struct pipe_stencil_ref saved_stencil_ref;     /**< stencil ref */
 
    int saved_num_sampler_states;
    void *saved_sampler_states[32];
@@ -169,6 +170,13 @@ void util_blitter_save_depth_stencil_alpha(struct blitter_context *blitter,
    blitter->saved_dsa_state = state;
 }
 
+static INLINE
+void util_blitter_save_stencil_ref(struct blitter_context *blitter,
+                                   const struct pipe_stencil_ref *state)
+{
+   blitter->saved_stencil_ref = *state;
+}
+
 static INLINE
 void util_blitter_save_rasterizer(struct blitter_context *blitter,
                                   void *state)
index cdedb3022097c64fbb272fb99e60c8e17641325f..faaf9523cb22c57719476feea95344e1eca7ea56 100644 (file)
@@ -27,6 +27,7 @@ static void r300_blitter_save_states(struct r300_context* r300)
 {
     util_blitter_save_blend(r300->blitter, r300->blend_state.state);
     util_blitter_save_depth_stencil_alpha(r300->blitter, r300->dsa_state.state);
+    util_blitter_save_stencil_ref(r300->blitter, &(r300->stencil_ref));
     util_blitter_save_rasterizer(r300->blitter, r300->rs_state.state);
     util_blitter_save_fragment_shader(r300->blitter, r300->fs);
     util_blitter_save_vertex_shader(r300->blitter, r300->vs);