mirror of
https://github.com/stenzek/duckstation.git
synced 2026-02-04 05:04:33 +00:00
[PR #3092] [CLOSED] VulkanDevice: Accelerate texture downloads with VK_EXT_external_memory_host
#1589
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/stenzek/duckstation/pull/3092
Author: @Wunkolo
Created: 1/21/2024
Status: ❌ Closed
Base:
master← Head:vk-memory-import📝 Commits (3)
8b5f40eVulkanDevice: OptionalVK_EXT_external_memory_hostenablementf88447fVulkanDevice: AddTryImportHostMemory24ec546VulkanDevice: Attempt to importout_datafor texture Downloads📊 Changes
4 files changed (+140 additions, -13 deletions)
View changed files
📝
src/util/vulkan_device.cpp(+97 -0)📝
src/util/vulkan_device.h(+4 -0)📝
src/util/vulkan_entry_points.inl(+4 -0)📝
src/util/vulkan_texture.cpp(+35 -13)📄 Description
With VK_EXT_external_memory_host, host memory can be directly imported into a
VkDeviceMemory/VkBufferwithout the need to allocate or copy from staging memory. When minImportedHostPointerAlignment matches the page-size of the system, then basically any host pointer can be imported into Vulkan by importing the entire span ofPAGE_SIZE-chunks of memory into Vulkan and offsetting into it.In the case of large texture downloads like upscaled screenshots, this saves a good chunk of memory from having to be allocated by directly writing texture-data into
void* out_data.This could work for any kind of CPU<->GPU transfer too.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.