mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-30 01:01:21 +00:00
graphics: use budget-aware preferred-device image allocation
This commit is contained in:
1 parent
25f3ba4eae
commit
6ff6e7551d
2 files changed
+4
-3
No files matched your search
@@ -151,7 +151,8 @@ bool GraphicContext::CreateImage(const vk::ImageCreateInfo& image_info, VulkanIm
|
|||||||
EXIT_IF(allocator == nullptr || image.image != nullptr || image.allocation != nullptr);
|
EXIT_IF(allocator == nullptr || image.image != nullptr || image.allocation != nullptr);
|
||||||
|
|
||||||
VmaAllocationCreateInfo alloc_info {};
|
VmaAllocationCreateInfo alloc_info {};
|
||||||
alloc_info.requiredFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
|
alloc_info.flags = VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT;
|
||||||
|
alloc_info.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE;
|
||||||
|
|
||||||
vk::Image::CType native_image = VK_NULL_HANDLE;
|
vk::Image::CType native_image = VK_NULL_HANDLE;
|
||||||
const auto result = static_cast<vk::Result>(
|
const auto result = static_cast<vk::Result>(
|
||||||
|
|||||||
@@ -2186,9 +2186,9 @@ public:
|
|||||||
VkMemoryPropertyFlags properties{};
|
VkMemoryPropertyFlags properties{};
|
||||||
vmaGetAllocationMemoryProperties(graphics.allocator, image.allocation,
|
vmaGetAllocationMemoryProperties(graphics.allocator, image.allocation,
|
||||||
&properties);
|
&properties);
|
||||||
Require(name, "allocation policy",
|
Require(name, "small allocation preference",
|
||||||
(properties & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0,
|
(properties & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0,
|
||||||
"native image lost its device-local memory requirement");
|
"native image did not prefer available device-local memory");
|
||||||
|
|
||||||
// A reused presentation image may still describe its previous recording.
|
// A reused presentation image may still describe its previous recording.
|
||||||
// No commands use this fixture; seed that bookkeeping before retirement.
|
// No commands use this fixture; seed that bookkeeping before retirement.
|
||||||
|
|||||||
Reference in new issue
Block a user