diff options
author | Roland Scheidegger <sroland@vmware.com> | 2010-02-09 21:23:27 +0100 |
---|---|---|
committer | Roland Scheidegger <sroland@vmware.com> | 2010-02-09 21:23:27 +0100 |
commit | 1a859ecf4a4728cb321b1f68d51491cd285a3c03 (patch) | |
tree | b6f45938d009e46ff16226b9cd514cdb4b01c7a8 /src/gallium/auxiliary/cso_cache | |
parent | 653a83445f94620673f747a4ace6847a2c7fdb4d (diff) |
gallium: don't put stencil ref value in pipe_depth_stencil_alpha_state
This will make driver's life a bit harder, however it makes sense that stencil
reference value is not part of the pipe_depth_stencil_alpha_state, because
it often (there are some algorithms which require this) changes more frequently
than the rest of the dsa state. This is also encouraged by some graphic APIs.
Treat it similar to pipe_blend_color.
Diffstat (limited to 'src/gallium/auxiliary/cso_cache')
-rw-r--r-- | src/gallium/auxiliary/cso_cache/cso_context.c | 11 | ||||
-rw-r--r-- | src/gallium/auxiliary/cso_cache/cso_context.h | 4 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index c638239e80..47867e888a 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -93,6 +93,7 @@ struct cso_context { struct pipe_framebuffer_state fb, fb_saved; struct pipe_viewport_state vp, vp_saved; struct pipe_blend_color blend_color; + struct pipe_stencil_ref stencil_ref; }; @@ -1069,6 +1070,16 @@ enum pipe_error cso_set_blend_color(struct cso_context *ctx, return PIPE_OK; } +enum pipe_error cso_set_stencil_ref(struct cso_context *ctx, + const struct pipe_stencil_ref *sr) +{ + if (memcmp(&ctx->stencil_ref, sr, sizeof(ctx->stencil_ref))) { + ctx->stencil_ref = *sr; + ctx->pipe->set_stencil_ref(ctx->pipe, sr); + } + return PIPE_OK; +} + enum pipe_error cso_set_geometry_shader_handle(struct cso_context *ctx, void *handle) { diff --git a/src/gallium/auxiliary/cso_cache/cso_context.h b/src/gallium/auxiliary/cso_cache/cso_context.h index d2089b1c88..3a6fff21e2 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.h +++ b/src/gallium/auxiliary/cso_cache/cso_context.h @@ -174,6 +174,10 @@ enum pipe_error cso_set_blend_color(struct cso_context *cso, const struct pipe_blend_color *bc); +enum pipe_error cso_set_stencil_ref(struct cso_context *cso, + const struct pipe_stencil_ref *sr); + + #ifdef __cplusplus } #endif |