softpipe: adapt to stencil ref changes
authorRoland Scheidegger <sroland@vmware.com>
Wed, 10 Feb 2010 17:59:43 +0000 (18:59 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Wed, 10 Feb 2010 17:59:43 +0000 (18:59 +0100)
src/gallium/drivers/softpipe/sp_context.c
src/gallium/drivers/softpipe/sp_context.h
src/gallium/drivers/softpipe/sp_quad_depth_test.c
src/gallium/drivers/softpipe/sp_state.h
src/gallium/drivers/softpipe/sp_state_blend.c
src/gallium/drivers/softpipe/sp_video_context.c

index 2b22ce256e6834734f893433b7ff20fec451fac8..ddc35bcd62902def99f2139d4be30885168876de 100644 (file)
@@ -246,6 +246,7 @@ softpipe_create_context( struct pipe_screen *screen,
    softpipe->pipe.delete_gs_state = softpipe_delete_gs_state;
 
    softpipe->pipe.set_blend_color = softpipe_set_blend_color;
+   softpipe->pipe.set_stencil_ref = softpipe_set_stencil_ref;
    softpipe->pipe.set_clip_state = softpipe_set_clip_state;
    softpipe->pipe.set_constant_buffer = softpipe_set_constant_buffer;
    softpipe->pipe.set_framebuffer_state = softpipe_set_framebuffer_state;
index 62f9e7aad3d7dc6b5aa74b995be7a792b41f7b68..95def72c54135d2836948c2b9a789db7c8ee7d15 100644 (file)
@@ -62,6 +62,7 @@ struct softpipe_context {
 
    /** Other rendering state */
    struct pipe_blend_color blend_color;
+   struct pipe_stencil_ref stencil_ref;
    struct pipe_clip_state clip;
    struct pipe_buffer *constants[PIPE_SHADER_TYPES][PIPE_MAX_CONSTANT_BUFFERS];
    struct pipe_framebuffer_state framebuffer;
index a981775cbd3c91f7c7d7147e51c6699ccbfbf109..499eebd671b8f32c38fc6f1b344ba7a788e6e70d 100644 (file)
@@ -519,7 +519,7 @@ depth_stencil_test_quad(struct quad_stage *qs,
    failOp  = softpipe->depth_stencil->stencil[face].fail_op;
    zFailOp = softpipe->depth_stencil->stencil[face].zfail_op;
    zPassOp = softpipe->depth_stencil->stencil[face].zpass_op;
-   ref     = softpipe->depth_stencil->stencil[face].ref_value;
+   ref     = softpipe->stencil_ref.ref_value[face];
    wrtMask = softpipe->depth_stencil->stencil[face].writemask;
    valMask = softpipe->depth_stencil->stencil[face].valuemask;
 
index a83cae73617561b42ea9ec202691851ae1964037..4370bbeaee2713de4aa78ed921419faeffe7a56a 100644 (file)
@@ -132,13 +132,16 @@ void softpipe_bind_rasterizer_state(struct pipe_context *, void *);
 void softpipe_delete_rasterizer_state(struct pipe_context *, void *);
 
 void softpipe_set_framebuffer_state( struct pipe_context *,
-                            const struct pipe_framebuffer_state * );
+                                     const struct pipe_framebuffer_state * );
 
 void softpipe_set_blend_color( struct pipe_context *pipe,
                                const struct pipe_blend_color *blend_color );
 
+void softpipe_set_stencil_ref( struct pipe_context *pipe,
+                               const struct pipe_stencil_ref *stencil_ref );
+
 void softpipe_set_clip_state( struct pipe_context *,
-                            const struct pipe_clip_state * );
+                              const struct pipe_clip_state * );
 
 void softpipe_set_constant_buffer(struct pipe_context *,
                                   uint shader, uint index,
index 95ab32343375aaf76c592a12e478b68fa3604d1f..c63a49e90b0ac99d3669b3ced7092059cb921c92 100644 (file)
@@ -61,7 +61,7 @@ void softpipe_delete_blend_state(struct pipe_context *pipe,
 
 
 void softpipe_set_blend_color( struct pipe_context *pipe,
-                            const struct pipe_blend_color *blend_color )
+                               const struct pipe_blend_color *blend_color )
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
 
@@ -80,7 +80,7 @@ void softpipe_set_blend_color( struct pipe_context *pipe,
 
 void *
 softpipe_create_depth_stencil_state(struct pipe_context *pipe,
-                                   const struct pipe_depth_stencil_alpha_state *depth_stencil)
+                                    const struct pipe_depth_stencil_alpha_state *depth_stencil)
 {
    return mem_dup(depth_stencil, sizeof(*depth_stencil));
 }
@@ -101,3 +101,13 @@ softpipe_delete_depth_stencil_state(struct pipe_context *pipe, void *depth)
 {
    FREE( depth );
 }
+
+void softpipe_set_stencil_ref( struct pipe_context *pipe,
+                               const struct pipe_stencil_ref *stencil_ref )
+{
+   struct softpipe_context *softpipe = softpipe_context(pipe);
+
+   softpipe->stencil_ref = *stencil_ref;
+
+   softpipe->dirty |= SP_NEW_DEPTH_STENCIL_ALPHA;
+}
index d8b5b31e954734b5facf98b6de9bdb8ef5de0221..7a3a6361670391a6b35a145a4db3fc5c337bf64f 100644 (file)
@@ -209,7 +209,6 @@ init_pipe_state(struct sp_mpeg12_context *ctx)
       dsa.stencil[i].fail_op = PIPE_STENCIL_OP_KEEP;
       dsa.stencil[i].zpass_op = PIPE_STENCIL_OP_KEEP;
       dsa.stencil[i].zfail_op = PIPE_STENCIL_OP_KEEP;
-      dsa.stencil[i].ref_value = 0;
       dsa.stencil[i].valuemask = 0;
       dsa.stencil[i].writemask = 0;
    }