diff options
author | Roland Scheidegger <sroland@vmware.com> | 2010-02-12 21:39:29 +0100 |
---|---|---|
committer | Roland Scheidegger <sroland@vmware.com> | 2010-02-12 21:39:29 +0100 |
commit | 6602889d82d1402338f5d23e37a9f46db99e86c6 (patch) | |
tree | de80ae0d9607b02252043852fe385418e4c5379a /src/gallium/auxiliary/cso_cache/cso_context.c | |
parent | af1052e2804ee5fbcde3c8f8618feeb2c17b51fd (diff) | |
parent | 0087f9dc0690e5de139f89ea4577b1824b918757 (diff) |
Merge branch 'gallium-dynamicstencilref'
Diffstat (limited to 'src/gallium/auxiliary/cso_cache/cso_context.c')
-rw-r--r-- | src/gallium/auxiliary/cso_cache/cso_context.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index c638239e80..b5241fa64c 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, stencil_ref_saved; }; @@ -1057,8 +1058,6 @@ void cso_restore_viewport(struct cso_context *ctx) } - - enum pipe_error cso_set_blend_color(struct cso_context *ctx, const struct pipe_blend_color *bc) { @@ -1069,6 +1068,30 @@ 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; +} + +void cso_save_stencil_ref(struct cso_context *ctx) +{ + ctx->stencil_ref_saved = ctx->stencil_ref; +} + + +void cso_restore_stencil_ref(struct cso_context *ctx) +{ + if (memcmp(&ctx->stencil_ref, &ctx->stencil_ref_saved, sizeof(ctx->stencil_ref))) { + ctx->stencil_ref = ctx->stencil_ref_saved; + ctx->pipe->set_stencil_ref(ctx->pipe, &ctx->stencil_ref); + } +} + enum pipe_error cso_set_geometry_shader_handle(struct cso_context *ctx, void *handle) { |