Mesa (main): anv: use vk_object_zalloc for wsi fences created

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Oct 13 12:16:57 UTC 2021


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

Author: Tapani Pälli <tapani.palli at intel.com>
Date:   Wed Oct 13 10:37:32 2021 +0300

anv: use vk_object_zalloc for wsi fences created

Otherwise we hit assert in vk_object_base_assert_valid when attemping to
create handle from anv_fence with unknown base type.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13330>

---

 src/intel/vulkan/anv_wsi_display.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/intel/vulkan/anv_wsi_display.c b/src/intel/vulkan/anv_wsi_display.c
index 4c3199f657b..9f54d213e61 100644
--- a/src/intel/vulkan/anv_wsi_display.c
+++ b/src/intel/vulkan/anv_wsi_display.c
@@ -37,8 +37,8 @@ anv_RegisterDeviceEventEXT(VkDevice _device,
    struct anv_fence *fence;
    VkResult ret;
 
-   fence = vk_zalloc2(&device->vk.alloc, allocator, sizeof (*fence), 8,
-                      VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
+   fence = vk_object_zalloc(&device->vk, allocator, sizeof (*fence),
+                            VK_OBJECT_TYPE_FENCE);
    if (!fence)
       return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
 
@@ -68,8 +68,8 @@ anv_RegisterDisplayEventEXT(VkDevice _device,
    struct anv_fence *fence;
    VkResult ret;
 
-   fence = vk_zalloc2(&device->vk.alloc, allocator, sizeof (*fence), 8,
-                      VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
+   fence = vk_object_zalloc(&device->vk, allocator, sizeof (*fence),
+                            VK_OBJECT_TYPE_FENCE);
    if (!fence)
       return VK_ERROR_OUT_OF_HOST_MEMORY;
 



More information about the mesa-commit mailing list