From dc05b042abc246a153db510e019613a418022014 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 20 Aug 2022 13:34:30 -0400 Subject: [PATCH] asahi: Assert that u_transfer_helper is well-behaved Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/asahi/agx_pipe.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index 9b59e235b38..c0aa7d84a92 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -169,6 +169,10 @@ agx_resource_create(struct pipe_screen *screen, nresource->mipmapped = (templ->last_level > 0); nresource->internal_format = nresource->base.format; + assert(templ->format != PIPE_FORMAT_Z24X8_UNORM && + templ->format != PIPE_FORMAT_Z24_UNORM_S8_UINT && + "u_transfer_helper should have lowered"); + nresource->layout = (struct ail_layout) { .tiling = (nresource->modifier == DRM_FORMAT_MOD_LINEAR) ? AIL_TILING_LINEAR : AIL_TILING_TWIDDLED,