summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-07-09 02:23:22 +0200
committerMarek Olšák <[email protected]>2012-07-12 02:08:30 +0200
commita7f3697eb849376dda23556df479127909cb7fd4 (patch)
treefb273f8b05212a3bc7194ae8e2b8c70538930f81 /src/gallium/auxiliary
parent5a74e17ab0f5ec864c18bc74f951e18d3ecc136f (diff)
st/mesa: set colormask to zero when blitting depth
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/util/u_blit.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c
index 6cdfbcaca3e..30f4a93d2dc 100644
--- a/src/gallium/auxiliary/util/u_blit.c
+++ b/src/gallium/auxiliary/util/u_blit.c
@@ -56,7 +56,7 @@ struct blit_state
struct pipe_context *pipe;
struct cso_context *cso;
- struct pipe_blend_state blend;
+ struct pipe_blend_state blend_write_color, blend_keep_color;
struct pipe_depth_stencil_alpha_state depthstencil_keep;
struct pipe_depth_stencil_alpha_state depthstencil_write;
struct pipe_rasterizer_state rasterizer;
@@ -94,7 +94,7 @@ util_create_blit(struct pipe_context *pipe, struct cso_context *cso)
ctx->cso = cso;
/* disabled blending/masking */
- ctx->blend.rt[0].colormask = PIPE_MASK_RGBA;
+ ctx->blend_write_color.rt[0].colormask = PIPE_MASK_RGBA;
/* no-op depth/stencil/alpha */
ctx->depthstencil_write.depth.enabled = 1;
@@ -564,7 +564,11 @@ util_blit_pixels(struct blit_state *ctx,
cso_save_vertex_buffers(ctx->cso);
/* set misc state we care about */
- cso_set_blend(ctx->cso, &ctx->blend);
+ if (writemask)
+ cso_set_blend(ctx->cso, &ctx->blend_write_color);
+ else
+ cso_set_blend(ctx->cso, &ctx->blend_keep_color);
+
cso_set_depth_stencil_alpha(ctx->cso,
dst_is_depth ? &ctx->depthstencil_write :
&ctx->depthstencil_keep);
@@ -721,7 +725,7 @@ util_blit_pixels_tex(struct blit_state *ctx,
cso_save_vertex_buffers(ctx->cso);
/* set misc state we care about */
- cso_set_blend(ctx->cso, &ctx->blend);
+ cso_set_blend(ctx->cso, &ctx->blend_write_color);
cso_set_depth_stencil_alpha(ctx->cso, &ctx->depthstencil_keep);
cso_set_rasterizer(ctx->cso, &ctx->rasterizer);
cso_set_vertex_elements(ctx->cso, 2, ctx->velem);