mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
anv/cmd_buffer: Properly handle render passes with 0 attachments
We were early returning and never created the NULL surface state.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: James Legg <jlegg@feralinteractive.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit bd41564746)
This commit is contained in:
parent
dd241abbe0
commit
0a0289d73d
1 changed files with 11 additions and 12 deletions
|
|
@ -407,19 +407,18 @@ genX(cmd_buffer_setup_attachments)(struct anv_cmd_buffer *cmd_buffer,
|
|||
|
||||
vk_free(&cmd_buffer->pool->alloc, state->attachments);
|
||||
|
||||
if (pass->attachment_count == 0) {
|
||||
if (pass->attachment_count > 0) {
|
||||
state->attachments = vk_alloc(&cmd_buffer->pool->alloc,
|
||||
pass->attachment_count *
|
||||
sizeof(state->attachments[0]),
|
||||
8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
|
||||
if (state->attachments == NULL) {
|
||||
/* Propagate VK_ERROR_OUT_OF_HOST_MEMORY to vkEndCommandBuffer */
|
||||
return anv_batch_set_error(&cmd_buffer->batch,
|
||||
VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||
}
|
||||
} else {
|
||||
state->attachments = NULL;
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
state->attachments = vk_alloc(&cmd_buffer->pool->alloc,
|
||||
pass->attachment_count *
|
||||
sizeof(state->attachments[0]),
|
||||
8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
|
||||
if (state->attachments == NULL) {
|
||||
/* Propagate VK_ERROR_OUT_OF_HOST_MEMORY to vkEndCommandBuffer */
|
||||
return anv_batch_set_error(&cmd_buffer->batch,
|
||||
VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||
}
|
||||
|
||||
/* Reserve one for the NULL state. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue