diff options
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_blitter.c | 33 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_format.c | 3 |
2 files changed, 11 insertions, 25 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c index a196a4c427e..3b7020510b0 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c @@ -638,32 +638,15 @@ handle_zs_blit(struct fd_context *ctx, const struct pipe_blit_info *info) return do_rewritten_blit(ctx, &blit); case PIPE_FORMAT_Z24X8_UNORM: - blit.mask = PIPE_MASK_R; - blit.src.format = PIPE_FORMAT_R32_UINT; - blit.dst.format = PIPE_FORMAT_R32_UINT; - return do_rewritten_blit(ctx, &blit); - case PIPE_FORMAT_Z24_UNORM_S8_UINT: - switch (info->mask) { - case PIPE_MASK_ZS: - blit.mask = PIPE_MASK_R; - blit.src.format = PIPE_FORMAT_R32_UINT; - blit.dst.format = PIPE_FORMAT_R32_UINT; - return do_rewritten_blit(ctx, &blit); - case PIPE_MASK_Z: - blit.mask = PIPE_MASK_R | PIPE_MASK_G | PIPE_MASK_B; - blit.src.format = PIPE_FORMAT_R8G8B8A8_UNORM; - blit.dst.format = PIPE_FORMAT_R8G8B8A8_UNORM; - return fd_blitter_blit(ctx, &blit); - case PIPE_MASK_S: - blit.mask = PIPE_MASK_A; - blit.src.format = PIPE_FORMAT_R8G8B8A8_UNORM; - blit.dst.format = PIPE_FORMAT_R8G8B8A8_UNORM; - return fd_blitter_blit(ctx, &blit); - default: - unreachable(""); - } - return true; + blit.mask = 0; + if (info->mask & PIPE_MASK_Z) + blit.mask |= PIPE_MASK_R | PIPE_MASK_G | PIPE_MASK_B; + if (info->mask & PIPE_MASK_S) + blit.mask |= PIPE_MASK_A; + blit.src.format = PIPE_FORMAT_Z24_UNORM_S8_UINT_AS_R8G8B8A8; + blit.dst.format = PIPE_FORMAT_Z24_UNORM_S8_UINT_AS_R8G8B8A8; + return fd_blitter_blit(ctx, &blit); default: return false; diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_format.c b/src/gallium/drivers/freedreno/a6xx/fd6_format.c index 9448ff18e54..492de2edfcd 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_format.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_format.c @@ -222,6 +222,9 @@ static struct fd6_format formats[PIPE_FORMAT_COUNT] = { _T(Z32_FLOAT_S8X24_UINT, 32_FLOAT, R32_FLOAT, WZYX), _T(X32_S8X24_UINT, 8_UINT, R8_UINT, WZYX), + /* special format for blits: */ + _T(Z24_UNORM_S8_UINT_AS_R8G8B8A8, Z24_UNORM_S8_UINT, Z24_UNORM_S8_UINT, WZYX), + /* 48-bit */ V_(R16G16B16_UNORM, 16_16_16_UNORM, NONE, WZYX), V_(R16G16B16_SNORM, 16_16_16_SNORM, NONE, WZYX), |