diff options
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_cb_texture.c')
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_texture.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c index 67c3f9590..a7f57b96f 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_texture.c +++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c @@ -944,7 +944,7 @@ st_CopyTexSubImage(struct gl_context *ctx, GLuint dims, struct pipe_screen *screen = pipe->screen; enum pipe_format dest_format, src_format; GLboolean matching_base_formats; - GLuint format_writemask, sample_count; + GLuint color_writemask, zs_writemask, sample_count; struct pipe_surface *dest_surface = NULL; GLboolean do_flip = (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP); struct pipe_surface surf_tmpl; @@ -1025,15 +1025,17 @@ st_CopyTexSubImage(struct gl_context *ctx, GLuint dims, } if (texBaseFormat == GL_DEPTH_COMPONENT) { - format_writemask = TGSI_WRITEMASK_XYZW; + color_writemask = 0; + zs_writemask = BLIT_WRITEMASK_Z; dst_usage = PIPE_BIND_DEPTH_STENCIL; } else { - format_writemask = compatible_src_dst_formats(ctx, &strb->Base, texImage); + color_writemask = compatible_src_dst_formats(ctx, &strb->Base, texImage); + zs_writemask = 0; dst_usage = PIPE_BIND_RENDER_TARGET; } - if (!format_writemask || + if ((!color_writemask && !zs_writemask) || !screen->is_format_supported(screen, src_format, PIPE_TEXTURE_2D, sample_count, PIPE_BIND_SAMPLER_VIEW) || @@ -1066,17 +1068,17 @@ st_CopyTexSubImage(struct gl_context *ctx, GLuint dims, dest_surface = pipe->create_surface(pipe, stImage->pt, &surf_tmpl); - util_blit_pixels_writemask(st->blit, - strb->texture, - strb->surface->u.tex.level, - srcX, srcY0, - srcX + width, srcY1, - strb->surface->u.tex.first_layer, - dest_surface, - destX, destY, - destX + width, destY + height, - 0.0, PIPE_TEX_MIPFILTER_NEAREST, - format_writemask); + util_blit_pixels(st->blit, + strb->texture, + strb->surface->u.tex.level, + srcX, srcY0, + srcX + width, srcY1, + strb->surface->u.tex.first_layer, + dest_surface, + destX, destY, + destX + width, destY + height, + 0.0, PIPE_TEX_MIPFILTER_NEAREST, + color_writemask, zs_writemask); pipe_surface_reference(&dest_surface, NULL); /* Restore conditional rendering state. */ |