diff options
| author | 2020-07-16 18:19:45 -0400 | |
|---|---|---|
| committer | 2020-07-16 18:19:45 -0400 | |
| commit | 6d165481ad4b6385286def93e64b89637fdd54a3 (patch) | |
| tree | 59bdf55f34f52b9dbac7aade6bf1174f0994fa8e /src | |
| parent | vk_compute_pipeline: Make use of designated initializers where applicable (diff) | |
| download | yuzu-6d165481ad4b6385286def93e64b89637fdd54a3.tar.gz yuzu-6d165481ad4b6385286def93e64b89637fdd54a3.tar.xz yuzu-6d165481ad4b6385286def93e64b89637fdd54a3.zip | |
vk_descriptor_pool: Make use of designated initializers where applicable
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_descriptor_pool.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp b/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp index 9259b618d..ac4a0884e 100644 --- a/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp | |||
| @@ -43,27 +43,30 @@ vk::DescriptorPool* VKDescriptorPool::AllocateNewPool() { | |||
| 43 | {VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, num_sets * 64}, | 43 | {VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, num_sets * 64}, |
| 44 | {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, num_sets * 64}, | 44 | {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, num_sets * 64}, |
| 45 | {VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, num_sets * 64}, | 45 | {VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, num_sets * 64}, |
| 46 | {VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, num_sets * 40}}; | 46 | {VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, num_sets * 40}, |
| 47 | 47 | }; | |
| 48 | VkDescriptorPoolCreateInfo ci; | 48 | |
| 49 | ci.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO; | 49 | const VkDescriptorPoolCreateInfo ci{ |
| 50 | ci.pNext = nullptr; | 50 | .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, |
| 51 | ci.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT; | 51 | .pNext = nullptr, |
| 52 | ci.maxSets = num_sets; | 52 | .flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, |
| 53 | ci.poolSizeCount = static_cast<u32>(std::size(pool_sizes)); | 53 | .maxSets = num_sets, |
| 54 | ci.pPoolSizes = std::data(pool_sizes); | 54 | .poolSizeCount = static_cast<u32>(std::size(pool_sizes)), |
| 55 | .pPoolSizes = std::data(pool_sizes), | ||
| 56 | }; | ||
| 55 | return &pools.emplace_back(device.GetLogical().CreateDescriptorPool(ci)); | 57 | return &pools.emplace_back(device.GetLogical().CreateDescriptorPool(ci)); |
| 56 | } | 58 | } |
| 57 | 59 | ||
| 58 | vk::DescriptorSets VKDescriptorPool::AllocateDescriptors(VkDescriptorSetLayout layout, | 60 | vk::DescriptorSets VKDescriptorPool::AllocateDescriptors(VkDescriptorSetLayout layout, |
| 59 | std::size_t count) { | 61 | std::size_t count) { |
| 60 | const std::vector layout_copies(count, layout); | 62 | const std::vector layout_copies(count, layout); |
| 61 | VkDescriptorSetAllocateInfo ai; | 63 | VkDescriptorSetAllocateInfo ai{ |
| 62 | ai.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO; | 64 | .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, |
| 63 | ai.pNext = nullptr; | 65 | .pNext = nullptr, |
| 64 | ai.descriptorPool = **active_pool; | 66 | .descriptorPool = **active_pool, |
| 65 | ai.descriptorSetCount = static_cast<u32>(count); | 67 | .descriptorSetCount = static_cast<u32>(count), |
| 66 | ai.pSetLayouts = layout_copies.data(); | 68 | .pSetLayouts = layout_copies.data(), |
| 69 | }; | ||
| 67 | 70 | ||
| 68 | vk::DescriptorSets sets = active_pool->Allocate(ai); | 71 | vk::DescriptorSets sets = active_pool->Allocate(ai); |
| 69 | if (!sets.IsOutOfPoolMemory()) { | 72 | if (!sets.IsOutOfPoolMemory()) { |