From ee8370c766c46752de6fa6dbb58c63a6ed5c4310 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 19 Mar 2019 14:00:50 -0700 Subject: iris: Fix blits with S8_UINT destination For depth and stencil blits, we always want the main mask to be Z, and the secondary pass mask to be S. If asked to blit Z+S to S, we should handle the blit in the second pass which properly gets the stencil resources. Before, we were trying to handle S as the main mask, and accidentally blitting a Z source to a S destination, which doesn't work out well. Fixes Piglit's "framebuffer-blit-levels {draw,read} stencil" tests. --- src/gallium/drivers/iris/iris_blit.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/iris/iris_blit.c b/src/gallium/drivers/iris/iris_blit.c index c1f76ea006c..5568be937fb 100644 --- a/src/gallium/drivers/iris/iris_blit.c +++ b/src/gallium/drivers/iris/iris_blit.c @@ -399,9 +399,7 @@ iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info) blorp_batch_init(&ice->blorp, &blorp_batch, batch, blorp_flags); unsigned main_mask; - if (info->dst.format == PIPE_FORMAT_S8_UINT) - main_mask = PIPE_MASK_S; - else if (util_format_is_depth_or_stencil(info->dst.format)) + if (util_format_is_depth_or_stencil(info->dst.format)) main_mask = PIPE_MASK_Z; else main_mask = PIPE_MASK_RGBA; @@ -422,7 +420,7 @@ iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info) } if ((info->mask & PIPE_MASK_S) && - util_format_is_depth_and_stencil(info->dst.format) && + util_format_has_stencil(util_format_description(info->dst.format)) && util_format_has_stencil(util_format_description(info->src.format))) { struct iris_resource *src_res, *dst_res, *junk; iris_get_depth_stencil_resources(info->src.resource, &junk, &src_res); -- cgit v1.2.3