turnip: replace a memset(0) with zalloc in CreateRenderPass
authorJonathan Marek <jonathan@marek.ca>
Sat, 13 Jun 2020 01:43:24 +0000 (21:43 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 24 Jun 2020 22:12:33 +0000 (22:12 +0000)
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5451>

src/freedreno/vulkan/tu_pass.c

index 371e561cb86a5055e0d5d71807fdb8f3cad252b5..3c76c076c67895fc8cf0a56c00c4431f1540dda4 100644 (file)
@@ -561,12 +561,11 @@ tu_CreateRenderPass2(VkDevice _device,
    attachments_offset = size;
    size += pCreateInfo->attachmentCount * sizeof(pass->attachments[0]);
 
-   pass = vk_alloc2(&device->alloc, pAllocator, size, 8,
+   pass = vk_zalloc2(&device->alloc, pAllocator, size, 8,
                     VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
    if (pass == NULL)
       return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY);
 
-   memset(pass, 0, size);
    pass->attachment_count = pCreateInfo->attachmentCount;
    pass->subpass_count = pCreateInfo->subpassCount;
    pass->attachments = (void *) pass + attachments_offset;