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.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user