diff options
| author | 2020-07-16 18:26:30 -0400 | |
|---|---|---|
| committer | 2020-07-16 18:26:30 -0400 | |
| commit | 7d5f93832cdec42d11057f20550a47325f47d3d3 (patch) | |
| tree | 122da2558437e6be7389e88e23f6320e8a33a0c2 | |
| parent | vk_image: Make use of designated initializers where applicable (diff) | |
| download | yuzu-7d5f93832cdec42d11057f20550a47325f47d3d3.tar.gz yuzu-7d5f93832cdec42d11057f20550a47325f47d3d3.tar.xz yuzu-7d5f93832cdec42d11057f20550a47325f47d3d3.zip | |
vk_memory_manager: Make use of designated initializers where applicable
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_memory_manager.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/video_core/renderer_vulkan/vk_memory_manager.cpp b/src/video_core/renderer_vulkan/vk_memory_manager.cpp index b4c650a63..24c8960ac 100644 --- a/src/video_core/renderer_vulkan/vk_memory_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_memory_manager.cpp | |||
| @@ -178,13 +178,12 @@ bool VKMemoryManager::AllocMemory(VkMemoryPropertyFlags wanted_properties, u32 t | |||
| 178 | }(); | 178 | }(); |
| 179 | 179 | ||
| 180 | // Try to allocate found type. | 180 | // Try to allocate found type. |
| 181 | VkMemoryAllocateInfo memory_ai; | 181 | vk::DeviceMemory memory = device.GetLogical().TryAllocateMemory({ |
| 182 | memory_ai.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; | 182 | .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, |
| 183 | memory_ai.pNext = nullptr; | 183 | .pNext = nullptr, |
| 184 | memory_ai.allocationSize = size; | 184 | .allocationSize = size, |
| 185 | memory_ai.memoryTypeIndex = type; | 185 | .memoryTypeIndex = type, |
| 186 | 186 | }); | |
| 187 | vk::DeviceMemory memory = device.GetLogical().TryAllocateMemory(memory_ai); | ||
| 188 | if (!memory) { | 187 | if (!memory) { |
| 189 | LOG_CRITICAL(Render_Vulkan, "Device allocation failed!"); | 188 | LOG_CRITICAL(Render_Vulkan, "Device allocation failed!"); |
| 190 | return false; | 189 | return false; |