25 if (buffer_initialized_ && buffer_memory_export_ == memory_export) {
34 VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT,
35 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
36 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
37 VmaAllocationCreateFlags(0),
42 buffer_initialized_ =
true;
43 buffer_memory_export_ = memory_export;
73 size_t memory_size = 0;
75 if (memory ==
nullptr) {
76 CLOG_ERROR(&
LOG,
"Failed to get device memory for Vulkan pixel buffer");
82 VkMemoryGetWin32HandleInfoKHR
info = {};
83 info.sType = VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR;
86 info.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT;
90 CLOG_ERROR(&
LOG,
"Failed to get Windows handle for Vulkan pixel buffer");
95 native_handle.
size = memory_size;
98 VkMemoryGetFdInfoKHR
info = {};
99 info.sType = VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR;
100 info.pNext =
nullptr;
101 info.memory = memory;
102 info.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT;
106 CLOG_ERROR(&
LOG,
"Failed to get file descriptor for Vulkan pixel buffer");
107 return native_handle;
111 native_handle.
size = memory_size;
114 return native_handle;
#define CLOG_ERROR(clg_ref,...)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
bool is_allocated() const
bool create(size_t size, VkBufferUsageFlags buffer_usage, VkMemoryPropertyFlags required_flags, VkMemoryPropertyFlags preferred_flags, VmaAllocationCreateFlags vma_allocation_flags, float priority, bool export_memory=false)
VkBuffer vk_handle() const
VkDeviceMemory export_memory_get(size_t &memory_size)
void * mapped_memory_get() const
PFN_vkGetMemoryFdKHR vkGetMemoryFd
VkDevice vk_handle() const
const VKExtensions & extensions_get() const
struct blender::gpu::VKDevice::@630 functions
GPUPixelBufferNativeHandle get_native_handle() override
VKPixelBuffer(size_t size)
void create(bool memory_export)
size_t get_size() override
void object_label(GLenum type, GLuint object, const char *name)