asahi: Refuse to transfer out-of-bounds mip levels

Fixes ail asserts on a pile of dEQP3 tests.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21063>
This commit is contained in:
Asahi Lina 2022-12-09 20:16:28 +09:00 committed by Marge Bot
parent 3706da1d1a
commit a88aa3e835

View file

@ -742,6 +742,10 @@ agx_transfer_map(struct pipe_context *pctx, struct pipe_resource *resource,
if ((usage & PIPE_MAP_DIRECTLY) && rsrc->modifier != DRM_FORMAT_MOD_LINEAR)
return NULL;
/* Can't transfer out of bounds mip levels */
if (level >= rsrc->layout.levels)
return NULL;
agx_prepare_for_map(ctx, rsrc, level, usage, box);
struct agx_transfer *transfer = CALLOC_STRUCT(agx_transfer);