summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/cso_cache
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-07-24 11:17:29 +0200
committerMarek Olšák <[email protected]>2012-08-04 13:53:06 +0200
commite7689303a8e4790c38cc69ae7a197712f98e8f5b (patch)
tree28a040134bba4ef8d01bfec7f450c4c484604087 /src/gallium/auxiliary/cso_cache
parentcd97a5f660399212a23b6dcd02906231f2dc5525 (diff)
gallium: set sample mask to ~0 for clear, blit and gen_mipmap
The sample mask affects single-sampled rendering too (it's orthogonal to the color mask). Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/cso_cache')
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.c13
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.h2
2 files changed, 14 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index b592c4f2feb..26c73fbe90f 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -114,7 +114,7 @@ struct cso_context {
struct pipe_framebuffer_state fb, fb_saved;
struct pipe_viewport_state vp, vp_saved;
struct pipe_blend_color blend_color;
- unsigned sample_mask;
+ unsigned sample_mask, sample_mask_saved;
struct pipe_stencil_ref stencil_ref, stencil_ref_saved;
};
@@ -265,6 +265,7 @@ struct cso_context *cso_create_context( struct pipe_context *pipe )
ctx);
ctx->pipe = pipe;
+ ctx->sample_mask_saved = ~0;
cso_init_vbuf(ctx);
@@ -691,6 +692,16 @@ enum pipe_error cso_set_sample_mask(struct cso_context *ctx,
return PIPE_OK;
}
+void cso_save_sample_mask(struct cso_context *ctx)
+{
+ ctx->sample_mask_saved = ctx->sample_mask;
+}
+
+void cso_restore_sample_mask(struct cso_context *ctx)
+{
+ cso_set_sample_mask(ctx, ctx->sample_mask_saved);
+}
+
enum pipe_error cso_set_stencil_ref(struct cso_context *ctx,
const struct pipe_stencil_ref *sr)
{
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.h b/src/gallium/auxiliary/cso_cache/cso_context.h
index f01a0f20c62..f49b2b706a4 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.h
+++ b/src/gallium/auxiliary/cso_cache/cso_context.h
@@ -161,6 +161,8 @@ enum pipe_error cso_set_blend_color(struct cso_context *cso,
enum pipe_error cso_set_sample_mask(struct cso_context *cso,
unsigned stencil_mask);
+void cso_save_sample_mask(struct cso_context *ctx);
+void cso_restore_sample_mask(struct cso_context *ctx);
enum pipe_error cso_set_stencil_ref(struct cso_context *cso,
const struct pipe_stencil_ref *sr);