Mesa (master): turnip: replace a memset(0) with zalloc in CreateRenderPass

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 24 22:28:34 UTC 2020


Module: Mesa
Branch: master
Commit: e4099201bcd4e5c8e6c281368b5b75d5fc89b3ff
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e4099201bcd4e5c8e6c281368b5b75d5fc89b3ff

Author: Jonathan Marek <jonathan at marek.ca>
Date:   Fri Jun 12 21:43:24 2020 -0400

turnip: replace a memset(0) with zalloc in CreateRenderPass

Signed-off-by: Jonathan Marek <jonathan at marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5451>

---

 src/freedreno/vulkan/tu_pass.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/freedreno/vulkan/tu_pass.c b/src/freedreno/vulkan/tu_pass.c
index 371e561cb86..3c76c076c67 100644
--- a/src/freedreno/vulkan/tu_pass.c
+++ b/src/freedreno/vulkan/tu_pass.c
@@ -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;



More information about the mesa-commit mailing list