Blender V5.0
vk_memory_pool.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "vk_common.hh"
12
13namespace blender::gpu {
14class VKDevice;
15
16constexpr VkExternalMemoryHandleTypeFlags vk_external_memory_handle_type()
17{
18#ifdef _WIN32
19 return VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT;
20#else
21 return VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT;
22#endif
23}
24
29 /* NOTE: This attribute needs to be kept alive as it will be read by VMA when allocating inside
30 * the pool. */
31 VkExportMemoryAllocateInfoKHR info = {VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR};
32 VmaPool pool = VK_NULL_HANDLE;
33
34 void deinit(VKDevice &device);
35};
36
40
41 void init(VKDevice &device);
42 void deinit(VKDevice &device);
43
44 private:
45 void init_external_memory_image(VKDevice &device);
46 void init_external_memory_pixel_buffer(VKDevice &device);
47};
48
49} // namespace blender::gpu
void init()
constexpr VkExternalMemoryHandleTypeFlags vk_external_memory_handle_type()
VkExportMemoryAllocateInfoKHR info
void deinit(VKDevice &device)
void deinit(VKDevice &device)
VKMemoryPool external_memory_pixel_buffer