Mesa (main): dzn: Check that no export is requested in the memory allocation path

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 14 23:17:14 UTC 2022


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

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Tue Apr 19 11:10:52 2022 +0200

dzn: Check that no export is requested in the memory allocation path

We don't support exporting memory objects yet, so let's make sure the
user doesn't request that.

Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16926>

---

 src/microsoft/vulkan/dzn_device.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/microsoft/vulkan/dzn_device.c b/src/microsoft/vulkan/dzn_device.c
index 83c47e32c58..65a113c1f1c 100644
--- a/src/microsoft/vulkan/dzn_device.c
+++ b/src/microsoft/vulkan/dzn_device.c
@@ -2142,13 +2142,20 @@ dzn_device_memory_create(struct dzn_device *device,
 
    mem->size = pAllocateInfo->allocationSize;
 
-#if 0
-   const VkExportMemoryAllocateInfo *export_info = NULL;
-   VkMemoryAllocateFlags vk_flags = 0;
-#endif
-
    vk_foreach_struct_const(ext, pAllocateInfo->pNext) {
-      dzn_debug_ignored_stype(ext->sType);
+      switch (ext->sType) {
+      case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: {
+         const VkExportMemoryAllocateInfo *exp =
+            (const VkExportMemoryAllocateInfo *)ext;
+
+         // TODO: support export
+         assert(exp->handleTypes == 0);
+         break;
+      }
+      default:
+         dzn_debug_ignored_stype(ext->sType);
+         break;
+      }
    }
 
    const VkMemoryType *mem_type =



More information about the mesa-commit mailing list