Skip to content

Draft: render/vulkan: Use host memory backed VkImages

Kenny Levinsen requested to merge kennylevinsen/wlroots:host_buffer_mr into master

If VK_EXT_external_memory_host is supported and the incoming buffer matches the alignment requirements of the device, try to create a VkImage bound directly to the host memory. Otherwise, fall back to maintaining a copy in device memory.

When host memory backed images are in use, we need to skip the shm immediate release optimization. Despite the client needing to maintain double buffers, the number of copies is still reduced as the data no longer goes through intermediate staging buffers.

The efficiency in using host memory like this might depend on architecture. Integrated GPUs already use the host memory as "device" memory, with the main issue being that the memory is linear.

Depends on mesa/drm!367 to be able import shm buffers.

Merge request reports