there is at least one unnamed game which has problems with this, so try
to avoid crashing
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14655>
VkClearRect *rect = &cmd->u.clear_attachments.rects[r];
/* avoid crashing on spec violations */
+ rect->rect.offset.x = MAX2(rect->rect.offset.x, 0);
+ rect->rect.offset.y = MAX2(rect->rect.offset.y, 0);
rect->rect.extent.width = MIN2(rect->rect.extent.width, state->framebuffer.width - rect->rect.offset.x);
rect->rect.extent.height = MIN2(rect->rect.extent.height, state->framebuffer.height - rect->rect.offset.y);
if (subpass->view_mask) {