diff options
author | Kenneth Graunke <[email protected]> | 2019-03-19 14:00:50 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-03-28 10:47:26 -0700 |
commit | ee8370c766c46752de6fa6dbb58c63a6ed5c4310 (patch) | |
tree | 135163a708028d023f8dceb2a9bf9449f99938fb /src/gallium/drivers/iris | |
parent | ce89c19b88376bcc4752494d78e4eb220cde6930 (diff) |
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.
Diffstat (limited to 'src/gallium/drivers/iris')
-rw-r--r-- | src/gallium/drivers/iris/iris_blit.c | 6 |
1 files changed, 2 insertions, 4 deletions
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); |