1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-20 19:54:19 +01:00

[dxvk] Add function to import existing Vulkan image

This commit is contained in:
Philip Rebohle 2024-09-26 01:31:29 +02:00 committed by Philip Rebohle
parent eec4f0fb35
commit d7e1794e29
2 changed files with 22 additions and 0 deletions

View File

@ -969,6 +969,17 @@ namespace dxvk {
}
Rc<DxvkResourceAllocation> DxvkMemoryAllocator::importImageResource(
const VkImageCreateInfo& createInfo,
VkImage imageHandle) {
Rc<DxvkResourceAllocation> allocation = m_allocationPool.create(this, nullptr);
allocation->m_flags.set(DxvkAllocationFlag::Imported);
allocation->m_image = imageHandle;
return allocation;
}
DxvkDeviceMemory DxvkMemoryAllocator::allocateDeviceMemory(
DxvkMemoryType& type,
VkDeviceSize size,

View File

@ -1167,6 +1167,17 @@ namespace dxvk {
const VkBufferCreateInfo& createInfo,
const DxvkBufferImportInfo& importInfo);
/**
* \brief Imports existing image resource
*
* \param [in] createInfo Image create info
* \param [in] imageHandle Image handle
* \returns Image resource
*/
Rc<DxvkResourceAllocation> importImageResource(
const VkImageCreateInfo& createInfo,
VkImage imageHandle);
/**
* \brief Queries memory stats
*