summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/cso_cache
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2010-02-11 04:06:01 +0100
committerRoland Scheidegger <[email protected]>2010-02-11 04:06:01 +0100
commitb75adabc89e34083ac302ac9bafc8d80b62ac14c (patch)
tree046265b87fbf22a3c00dec26f4edaec683ee3479 /src/gallium/auxiliary/cso_cache
parent9381a2777c1a36c1b88de9edf04141c485569259 (diff)
gallium: also save/restore stencil_ref in cso_save/restore_depth_stencil_alpha
makes life of state trackers easier
Diffstat (limited to 'src/gallium/auxiliary/cso_cache')
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index 47867e888a4..e110f051af4 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -93,7 +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;
+ struct pipe_stencil_ref stencil_ref, stencil_ref_saved;
};
@@ -746,6 +746,7 @@ void cso_save_depth_stencil_alpha(struct cso_context *ctx)
{
assert(!ctx->depth_stencil_saved);
ctx->depth_stencil_saved = ctx->depth_stencil;
+ ctx->stencil_ref_saved = ctx->stencil_ref;
}
void cso_restore_depth_stencil_alpha(struct cso_context *ctx)
@@ -755,6 +756,10 @@ void cso_restore_depth_stencil_alpha(struct cso_context *ctx)
ctx->pipe->bind_depth_stencil_alpha_state(ctx->pipe, ctx->depth_stencil_saved);
}
ctx->depth_stencil_saved = NULL;
+ 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);
+ }
}
@@ -1058,8 +1063,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)
{