mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
lavapipe: clamp attachment clear rect sizes
this is a spec violation, but crashing isn't cool, so do a little clamping Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13349>
This commit is contained in:
parent
67dd6b9f0f
commit
4cad3da409
1 changed files with 3 additions and 0 deletions
|
|
@ -2996,6 +2996,9 @@ static void handle_clear_attachments(struct vk_cmd_queue_entry *cmd,
|
|||
for (uint32_t r = 0; r < cmd->u.clear_attachments.rect_count; r++) {
|
||||
|
||||
VkClearRect *rect = &cmd->u.clear_attachments.rects[r];
|
||||
/* avoid crashing on spec violations */
|
||||
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) {
|
||||
u_foreach_bit(i, subpass->view_mask)
|
||||
clear_attachment_layers(state, imgv, &rect->rect,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue