X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fsvga%2Fsvga_pipe_depthstencil.c;h=cb07dbe09a33ef2a35e42e628b1661acded80e6e;hb=52381a7ffba908410f7a53855f082401fca7293a;hp=df636c08a0592fc7c13b7f0d9757752b3f712d8d;hpb=a3eb0f718e19653a2ad8e49396c904183be456f3;p=mesa.git diff --git a/src/gallium/drivers/svga/svga_pipe_depthstencil.c b/src/gallium/drivers/svga/svga_pipe_depthstencil.c index df636c08a05..cb07dbe09a3 100644 --- a/src/gallium/drivers/svga/svga_pipe_depthstencil.c +++ b/src/gallium/drivers/svga/svga_pipe_depthstencil.c @@ -23,13 +23,12 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "util/u_math.h" #include "util/u_memory.h" #include "svga_context.h" -#include "svga_state.h" #include "svga_hw_reg.h" @@ -58,10 +57,10 @@ svga_translate_stencil_op(unsigned op) case PIPE_STENCIL_OP_KEEP: return SVGA3D_STENCILOP_KEEP; case PIPE_STENCIL_OP_ZERO: return SVGA3D_STENCILOP_ZERO; case PIPE_STENCIL_OP_REPLACE: return SVGA3D_STENCILOP_REPLACE; - case PIPE_STENCIL_OP_INCR: return SVGA3D_STENCILOP_INCR; - case PIPE_STENCIL_OP_DECR: return SVGA3D_STENCILOP_DECR; - case PIPE_STENCIL_OP_INCR_WRAP: return SVGA3D_STENCILOP_INCRSAT; /* incorrect? */ - case PIPE_STENCIL_OP_DECR_WRAP: return SVGA3D_STENCILOP_DECRSAT; /* incorrect? */ + case PIPE_STENCIL_OP_INCR: return SVGA3D_STENCILOP_INCRSAT; + case PIPE_STENCIL_OP_DECR: return SVGA3D_STENCILOP_DECRSAT; + case PIPE_STENCIL_OP_INCR_WRAP: return SVGA3D_STENCILOP_INCR; + case PIPE_STENCIL_OP_DECR_WRAP: return SVGA3D_STENCILOP_DECR; case PIPE_STENCIL_OP_INVERT: return SVGA3D_STENCILOP_INVERT; default: assert(0); @@ -90,7 +89,6 @@ svga_create_depth_stencil_state(struct pipe_context *pipe, /* SVGA3D has one ref/mask/writemask triple shared between front & * back face stencil. We really need two: */ - ds->stencil_ref = templ->stencil[0].ref_value & 0xff; ds->stencil_mask = templ->stencil[0].valuemask & 0xff; ds->stencil_writemask = templ->stencil[0].writemask & 0xff; } @@ -103,7 +101,6 @@ svga_create_depth_stencil_state(struct pipe_context *pipe, ds->stencil[1].zfail = svga_translate_stencil_op(templ->stencil[1].zfail_op); ds->stencil[1].pass = svga_translate_stencil_op(templ->stencil[1].zpass_op); - ds->stencil_ref = templ->stencil[1].ref_value & 0xff; ds->stencil_mask = templ->stencil[1].valuemask & 0xff; ds->stencil_writemask = templ->stencil[1].writemask & 0xff; } @@ -140,12 +137,31 @@ static void svga_delete_depth_stencil_state(struct pipe_context *pipe, } +static void svga_set_stencil_ref( struct pipe_context *pipe, + const struct pipe_stencil_ref *stencil_ref ) +{ + struct svga_context *svga = svga_context(pipe); + + svga->curr.stencil_ref = *stencil_ref; + + svga->dirty |= SVGA_NEW_STENCIL_REF; +} + +static void +svga_set_sample_mask(struct pipe_context *pipe, + unsigned sample_mask) +{ +} + void svga_init_depth_stencil_functions( struct svga_context *svga ) { svga->pipe.create_depth_stencil_alpha_state = svga_create_depth_stencil_state; svga->pipe.bind_depth_stencil_alpha_state = svga_bind_depth_stencil_state; svga->pipe.delete_depth_stencil_alpha_state = svga_delete_depth_stencil_state; + + svga->pipe.set_stencil_ref = svga_set_stencil_ref; + svga->pipe.set_sample_mask = svga_set_sample_mask; }