mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
tu: Fix clear_values leak
When no attachments are used in a renderpass we should ignore the clear values. It seems to be valid applications to still pass clear values in such a case. Fixes memory leaks in some tests from: dEQP-VK.image.texel_view_compatible.graphic.basic.*d_image.texture_read.* dEQP-VK.image.texel_view_compatible.graphic.extended.*d_image.texture_read.* Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32968>
This commit is contained in:
parent
a1af33775e
commit
cfc09517b6
2 changed files with 15 additions and 13 deletions
|
|
@ -22,5 +22,3 @@ asan-dEQP-VK.wsi.*
|
|||
|
||||
# Leaky in Turnip
|
||||
asan-dEQP-VK.dynamic_rendering.*_cmd_buff.fragment_density_map.*
|
||||
asan-dEQP-VK.image.texel_view_compatible.graphic.basic.*d_image.texture_read.*
|
||||
asan-dEQP-VK.image.texel_view_compatible.graphic.extended.*d_image.texture_read.*
|
||||
|
|
|
|||
|
|
@ -4725,15 +4725,17 @@ tu_CmdBeginRenderPass2(VkCommandBuffer commandBuffer,
|
|||
cmd->state.framebuffer = fb;
|
||||
cmd->state.render_area = pRenderPassBegin->renderArea;
|
||||
|
||||
VK_MULTIALLOC(ma);
|
||||
vk_multialloc_add(&ma, &cmd->state.attachments,
|
||||
const struct tu_image_view *, pass->attachment_count);
|
||||
vk_multialloc_add(&ma, &cmd->state.clear_values, VkClearValue,
|
||||
pRenderPassBegin->clearValueCount);
|
||||
if (ma.size && !vk_multialloc_alloc(&ma, &cmd->vk.pool->alloc,
|
||||
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)) {
|
||||
vk_command_buffer_set_error(&cmd->vk, VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||
return;
|
||||
if (pass->attachment_count > 0) {
|
||||
VK_MULTIALLOC(ma);
|
||||
vk_multialloc_add(&ma, &cmd->state.attachments,
|
||||
const struct tu_image_view *, pass->attachment_count);
|
||||
vk_multialloc_add(&ma, &cmd->state.clear_values, VkClearValue,
|
||||
pRenderPassBegin->clearValueCount);
|
||||
if (!vk_multialloc_alloc(&ma, &cmd->vk.pool->alloc,
|
||||
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)) {
|
||||
vk_command_buffer_set_error(&cmd->vk, VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd->device->dbg_renderpass_stomp_cs) {
|
||||
|
|
@ -4745,8 +4747,10 @@ tu_CmdBeginRenderPass2(VkCommandBuffer commandBuffer,
|
|||
tu_image_view_from_handle(pAttachmentInfo->pAttachments[i]) :
|
||||
cmd->state.framebuffer->attachments[i].attachment;
|
||||
}
|
||||
for (unsigned i = 0; i < pRenderPassBegin->clearValueCount; i++)
|
||||
cmd->state.clear_values[i] = pRenderPassBegin->pClearValues[i];
|
||||
if (pass->attachment_count) {
|
||||
for (unsigned i = 0; i < pRenderPassBegin->clearValueCount; i++)
|
||||
cmd->state.clear_values[i] = pRenderPassBegin->pClearValues[i];
|
||||
}
|
||||
|
||||
tu_choose_gmem_layout(cmd);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue