freedreno/a6xx: Drop render condition check in blitter

We already check earlier in the call chain in fd_blit().
glBlitFramebuffer always sets render_condition_enable and thus we
would never try the blitter path for that.

Now that we get all of dEQP-GLES3.functional.fbo.blit.conversion.*
down this path, it turs out that the

  fail_if(info->mask != util_format_get_mask(info->src.format));
  fail_if(info->mask != util_format_get_mask(info->dst.format));

conditions weren't accurate.  util_format_get_mask() returns
PIPE_MASK_RGBA for any format with any color channels, while
info->mask is the exact set of channels to blit.  So we reject things
we could blit - for example, PIPE_FORMAT_R16G16_FLOAT where info->mask
is RG while util_format_get_mask() returns RGBA - and accept things we
can't.  It turns out that the blitter is happy to blit different
number of channels, but fails to blit formats with different numerical
formats and srgb formats.

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
Kristian H. Kristensen 2019-02-07 11:40:29 -08:00
parent 4f7a9c23ed
commit a201cb157d
1 changed files with 16 additions and 5 deletions

View File

@ -119,14 +119,25 @@ can_do_blit(const struct pipe_blit_info *info)
fail_if(info->window_rectangle_include);
fail_if(info->render_condition_enable);
fail_if(util_format_is_srgb(info->src.format));
fail_if(util_format_is_srgb(info->dst.format));
const struct util_format_description *src_desc =
util_format_description(info->src.format);
const struct util_format_description *dst_desc =
util_format_description(info->dst.format);
const int common_channels = MIN2(src_desc->nr_channels, dst_desc->nr_channels);
if (info->mask & PIPE_MASK_RGBA) {
for (int i = 0; i < common_channels; i++) {
fail_if(memcmp(&src_desc->channel[i],
&dst_desc->channel[i],
sizeof(src_desc->channel[0])));
}
}
fail_if(info->alpha_blend);
fail_if(info->mask != util_format_get_mask(info->src.format));
fail_if(info->mask != util_format_get_mask(info->dst.format));
return true;
}