mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 06:40:11 +01:00
freedreno/a6xx: Disable sample averaging on z/s or integer blits.
We can't generally force fd_blitter_blit() to not average in our fallback blits, but this should at help some cases. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13867>
This commit is contained in:
parent
c98adc56f4
commit
93eb697a8d
2 changed files with 27 additions and 17 deletions
|
|
@ -261,6 +261,9 @@ spec@egl_ext_protected_content@conformance,Fail
|
|||
spec@egl_khr_surfaceless_context@viewport,Fail
|
||||
spec@egl_mesa_configless_context@basic,Fail
|
||||
spec@ext_framebuffer_blit@fbo-blit-check-limits,Fail
|
||||
|
||||
# "MESA: warning: sample averaging on fallback z24s8 blit when we shouldn't."
|
||||
# on glBlitFramebuffer() from the MSAA FB to non-MSAA.
|
||||
spec@ext_framebuffer_multisample@accuracy 2 depth_resolve depthstencil,Fail
|
||||
spec@ext_framebuffer_multisample@accuracy 2 depth_resolve small depthstencil,Fail
|
||||
spec@ext_framebuffer_multisample@accuracy 2 stencil_resolve depthstencil,Fail
|
||||
|
|
@ -273,6 +276,7 @@ spec@ext_framebuffer_multisample@accuracy all_samples depth_resolve depthstencil
|
|||
spec@ext_framebuffer_multisample@accuracy all_samples depth_resolve small depthstencil,Fail
|
||||
spec@ext_framebuffer_multisample@accuracy all_samples stencil_resolve depthstencil,Fail
|
||||
spec@ext_framebuffer_multisample@accuracy all_samples stencil_resolve small depthstencil,Fail
|
||||
|
||||
spec@ext_framebuffer_multisample@alpha-to-coverage-dual-src-blend 2,Fail
|
||||
spec@ext_framebuffer_multisample@alpha-to-coverage-dual-src-blend 4,Fail
|
||||
spec@ext_framebuffer_multisample@alpha-to-coverage-no-draw-buffer-zero 2,Fail
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "util/format_srgb.h"
|
||||
#include "util/half_float.h"
|
||||
#include "util/u_dump.h"
|
||||
#include "util/u_log.h"
|
||||
|
||||
#include "freedreno_blitter.h"
|
||||
#include "freedreno_fence.h"
|
||||
|
|
@ -569,7 +570,7 @@ emit_blit_dst(struct fd_ringbuffer *ring, struct pipe_resource *prsc,
|
|||
|
||||
static void
|
||||
emit_blit_src(struct fd_ringbuffer *ring, const struct pipe_blit_info *info,
|
||||
unsigned layer, unsigned nr_samples)
|
||||
unsigned layer, unsigned nr_samples, bool sample_0)
|
||||
{
|
||||
struct fd_resource *src = fd_resource(info->src.resource);
|
||||
enum a6xx_format sfmt = fd6_texture_format(info->src.format, src->layout.tile_mode);
|
||||
|
|
@ -596,7 +597,7 @@ emit_blit_src(struct fd_ringbuffer *ring, const struct pipe_blit_info *info,
|
|||
A6XX_SP_PS_2D_SRC_INFO_TILE_MODE(stile) |
|
||||
A6XX_SP_PS_2D_SRC_INFO_COLOR_SWAP(sswap) |
|
||||
A6XX_SP_PS_2D_SRC_INFO_SAMPLES(samples) |
|
||||
COND(samples > MSAA_ONE && (info->mask & PIPE_MASK_RGBA),
|
||||
COND(samples > MSAA_ONE && !sample_0,
|
||||
A6XX_SP_PS_2D_SRC_INFO_SAMPLES_AVERAGE) |
|
||||
COND(subwc_enabled, A6XX_SP_PS_2D_SRC_INFO_FLAGS) |
|
||||
COND(util_format_is_srgb(info->src.format),
|
||||
|
|
@ -625,7 +626,7 @@ emit_blit_src(struct fd_ringbuffer *ring, const struct pipe_blit_info *info,
|
|||
|
||||
static void
|
||||
emit_blit_texture(struct fd_context *ctx, struct fd_ringbuffer *ring,
|
||||
const struct pipe_blit_info *info)
|
||||
const struct pipe_blit_info *info, bool sample_0)
|
||||
{
|
||||
const struct pipe_box *sbox = &info->src.box;
|
||||
const struct pipe_box *dbox = &info->dst.box;
|
||||
|
|
@ -674,7 +675,7 @@ emit_blit_texture(struct fd_context *ctx, struct fd_ringbuffer *ring,
|
|||
|
||||
for (unsigned i = 0; i < info->dst.box.depth; i++) {
|
||||
|
||||
emit_blit_src(ring, info, sbox->z + i, nr_samples);
|
||||
emit_blit_src(ring, info, sbox->z + i, nr_samples, sample_0);
|
||||
emit_blit_dst(ring, info->dst.resource, info->dst.format, info->dst.level,
|
||||
dbox->z + i);
|
||||
|
||||
|
|
@ -900,7 +901,7 @@ fd6_resolve_tile(struct fd_batch *batch, struct fd_ringbuffer *ring,
|
|||
|
||||
static bool
|
||||
handle_rgba_blit(struct fd_context *ctx,
|
||||
const struct pipe_blit_info *info) assert_dt
|
||||
const struct pipe_blit_info *info, bool sample_0) assert_dt
|
||||
{
|
||||
struct fd_batch *batch;
|
||||
|
||||
|
|
@ -951,7 +952,7 @@ handle_rgba_blit(struct fd_context *ctx,
|
|||
/* I don't *think* we need to handle blits between buffer <-> !buffer */
|
||||
debug_assert(info->src.resource->target != PIPE_BUFFER);
|
||||
debug_assert(info->dst.resource->target != PIPE_BUFFER);
|
||||
emit_blit_texture(ctx, batch->draw, info);
|
||||
emit_blit_texture(ctx, batch->draw, info, sample_0);
|
||||
}
|
||||
|
||||
trace_end_blit(&batch->trace, batch->draw);
|
||||
|
|
@ -983,11 +984,14 @@ handle_rgba_blit(struct fd_context *ctx,
|
|||
*/
|
||||
static bool
|
||||
do_rewritten_blit(struct fd_context *ctx,
|
||||
const struct pipe_blit_info *info) assert_dt
|
||||
const struct pipe_blit_info *info, bool sample_0) assert_dt
|
||||
{
|
||||
bool success = handle_rgba_blit(ctx, info);
|
||||
if (!success)
|
||||
bool success = handle_rgba_blit(ctx, info, sample_0);
|
||||
if (!success) {
|
||||
if (sample_0 && !util_format_is_pure_integer(info->src.format))
|
||||
mesa_logw("sample averaging on fallback blit when we shouldn't.");
|
||||
success = fd_blitter_blit(ctx, info);
|
||||
}
|
||||
debug_assert(success); /* fallback should never fail! */
|
||||
return success;
|
||||
}
|
||||
|
|
@ -1019,14 +1023,14 @@ handle_zs_blit(struct fd_context *ctx,
|
|||
blit.mask = PIPE_MASK_R;
|
||||
blit.src.format = PIPE_FORMAT_R8_UINT;
|
||||
blit.dst.format = PIPE_FORMAT_R8_UINT;
|
||||
return do_rewritten_blit(ctx, &blit);
|
||||
return do_rewritten_blit(ctx, &blit, true);
|
||||
|
||||
case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT:
|
||||
if (info->mask & PIPE_MASK_Z) {
|
||||
blit.mask = PIPE_MASK_R;
|
||||
blit.src.format = PIPE_FORMAT_R32_FLOAT;
|
||||
blit.dst.format = PIPE_FORMAT_R32_FLOAT;
|
||||
do_rewritten_blit(ctx, &blit);
|
||||
do_rewritten_blit(ctx, &blit, true);
|
||||
}
|
||||
|
||||
if (info->mask & PIPE_MASK_S) {
|
||||
|
|
@ -1035,7 +1039,7 @@ handle_zs_blit(struct fd_context *ctx,
|
|||
blit.dst.format = PIPE_FORMAT_R8_UINT;
|
||||
blit.src.resource = &src->stencil->b.b;
|
||||
blit.dst.resource = &dst->stencil->b.b;
|
||||
do_rewritten_blit(ctx, &blit);
|
||||
do_rewritten_blit(ctx, &blit, true);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -1044,7 +1048,7 @@ handle_zs_blit(struct fd_context *ctx,
|
|||
blit.mask = PIPE_MASK_R;
|
||||
blit.src.format = PIPE_FORMAT_R16_UNORM;
|
||||
blit.dst.format = PIPE_FORMAT_R16_UNORM;
|
||||
return do_rewritten_blit(ctx, &blit);
|
||||
return do_rewritten_blit(ctx, &blit, true);
|
||||
|
||||
case PIPE_FORMAT_Z32_UNORM:
|
||||
case PIPE_FORMAT_Z32_FLOAT:
|
||||
|
|
@ -1052,7 +1056,7 @@ handle_zs_blit(struct fd_context *ctx,
|
|||
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);
|
||||
return do_rewritten_blit(ctx, &blit, true);
|
||||
|
||||
case PIPE_FORMAT_Z24X8_UNORM:
|
||||
case PIPE_FORMAT_Z24_UNORM_S8_UINT:
|
||||
|
|
@ -1072,6 +1076,8 @@ handle_zs_blit(struct fd_context *ctx,
|
|||
if (!dst->layout.ubwc)
|
||||
blit.dst.format = PIPE_FORMAT_RGBA8888_UNORM;
|
||||
}
|
||||
if (info->src.resource->nr_samples > 1)
|
||||
mesa_logw("sample averaging on fallback z24s8 blit when we shouldn't.");
|
||||
return fd_blitter_blit(ctx, &blit);
|
||||
|
||||
default:
|
||||
|
|
@ -1124,7 +1130,7 @@ handle_compressed_blit(struct fd_context *ctx,
|
|||
blit.dst.box.width = DIV_ROUND_UP(blit.dst.box.width, bw);
|
||||
blit.dst.box.height = DIV_ROUND_UP(blit.dst.box.height, bh);
|
||||
|
||||
return do_rewritten_blit(ctx, &blit);
|
||||
return do_rewritten_blit(ctx, &blit, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1146,7 +1152,7 @@ handle_snorm_copy_blit(struct fd_context *ctx,
|
|||
|
||||
blit.src.format = blit.dst.format = util_format_snorm_to_unorm(info->src.format);
|
||||
|
||||
return do_rewritten_blit(ctx, &blit);
|
||||
return do_rewritten_blit(ctx, &blit, false);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -1163,7 +1169,7 @@ fd6_blit(struct fd_context *ctx, const struct pipe_blit_info *info) assert_dt
|
|||
util_format_is_snorm(info->src.format))
|
||||
return handle_snorm_copy_blit(ctx, info);
|
||||
|
||||
return handle_rgba_blit(ctx, info);
|
||||
return handle_rgba_blit(ctx, info, false);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue