Files
test/source/blender/gpu/vulkan/vk_memory.hh
Jeroen Bakker a46643af0f Vulkan/OpenXR: Add support for VK_KHR_external_memory_fd
Current implementation uses a CPU roundtrip to transfer render result
to the Xr Swapchain. This PR adds support for sharing the render result
on Linux systems by using file descriptors.

To extend this solution to win32 or dx handles can be done by extending
the data transfer modes, register the correct extensions. When not
using the same GPU between Blender and OpenXR the CPU roundtrip
will still be used.

Solution has been validated with monado simulator and seems to be as
fast as OpenGL.

Performance can be improved by using GPU based synchronization.
Current API is limited as we cannot chain the different renders and
swapchains.

Pull Request: https://projects.blender.org/blender/blender/pulls/136933
2025-04-04 16:01:06 +02:00

31 lines
760 B
C++

/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup gpu
*/
#pragma once
#include "vk_common.hh"
namespace blender::gpu {
/** Information about an exported buffer/image. */
struct VKMemoryExport {
/** Handle that has been exported. */
uint64_t handle;
/**
* Allocated memory size. Allocation size can be larger than actually requested due to memory
* alignment/allocation rules.
*/
VkDeviceSize memory_size;
/**
* Actually content offset inside the exported memory. A memory allocation can contain multiple
* buffers or images. The offset points to the specific buffer/image that is exported.
*/
VkDeviceSize memory_offset;
};
} // namespace blender::gpu