From 2cff6f4512a174a23ee6c1d2583c22e24ee1a240 Mon Sep 17 00:00:00 2001 From: Neha Bhende Date: Wed, 21 Sep 2016 12:27:14 -0700 Subject: [PATCH] svga: Allow DXPredCopyRegion for depth_and_stencil formats. DXPredCopyRegion supports copy between src and dst for depth_and_stencil formats if src and dst have same formats. tested ith piglit v2: As per Brian's comment, allow DXPredCopyRegion for depth+stencil buffers if the blit mask is PIPE_MASK_ZS. Tested with piglit tests and added new piglit test arb_framebuffer_object-depth-stencil-blit to test this particular testcase. Reviewed-by: Brian Paul --- src/gallium/drivers/svga/svga_pipe_blit.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/svga/svga_pipe_blit.c b/src/gallium/drivers/svga/svga_pipe_blit.c index 28b3c69ea40..75576f2d72c 100644 --- a/src/gallium/drivers/svga/svga_pipe_blit.c +++ b/src/gallium/drivers/svga/svga_pipe_blit.c @@ -165,7 +165,6 @@ svga_resource_copy_region(struct pipe_context *pipe, /* vgpu10 */ if (util_format_is_compressed(src_tex->format) == util_format_is_compressed(dst_tex->format) && - !util_format_is_depth_and_stencil(src_tex->format) && stex->handle != dtex->handle && svga_resource_type(src_tex->target) == svga_resource_type(dst_tex->target)) { @@ -260,9 +259,11 @@ can_blit_via_copy_region_vgpu10(struct svga_context *svga, blit_info->src.box.height != blit_info->dst.box.height) return false; - /* depth/stencil copies not supported at this time */ - if (blit_info->mask != PIPE_MASK_RGBA) - return false; + /* For depth+stencil formats, copy with maks != PIPE_MASK_ZS is not + * supported */ + if (util_format_is_depth_and_stencil(blit_info->src.format) && + blit_info->mask != (PIPE_MASK_ZS)) + return false; if (blit_info->alpha_blend || blit_info->render_condition_enable || blit_info->scissor_enable) -- 2.30.2