From eb7a5da9755a750d01ac5e7e7976fb6dc7b6b804 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 26 Nov 2018 23:57:26 +0100 Subject: [PATCH] [dxvk] Rebalance descriptor set allocation This should more closely reflect what applications actually use. The basic idea here is that it is better for apps to run out of descriptors before running out of sets and thus reduce the overall memory footprint of the application. --- src/dxvk/dxvk_descriptor.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/dxvk/dxvk_descriptor.cpp b/src/dxvk/dxvk_descriptor.cpp index e3bd1dde..db3691ee 100644 --- a/src/dxvk/dxvk_descriptor.cpp +++ b/src/dxvk/dxvk_descriptor.cpp @@ -45,19 +45,19 @@ namespace dxvk { VkDescriptorPool DxvkDescriptorAlloc::createDescriptorPool() { - constexpr uint32_t MaxSets = 256; - constexpr uint32_t MaxDesc = 2048; - - std::array pools = {{ - { VK_DESCRIPTOR_TYPE_SAMPLER, MaxDesc }, - { VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, MaxDesc }, - { VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, MaxDesc }, - { VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, MaxDesc }, - { VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, MaxDesc }, - { VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, MaxDesc }, - { VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, MaxDesc }, - { VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, MaxDesc }, - { VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, MaxDesc } }}; + constexpr uint32_t MaxSets = 2048; + + std::array pools = {{ + { VK_DESCRIPTOR_TYPE_SAMPLER, MaxSets * 2 }, + { VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, MaxSets * 3 }, + { VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, MaxSets / 8 }, + { VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, MaxSets * 3 }, + { VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, MaxSets / 8 }, + { VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, MaxSets * 3 }, + { VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, MaxSets / 8 }, + { VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, MaxSets * 3 }, + { VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, MaxSets / 8 }, + { VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, MaxSets / 16 } }}; VkDescriptorPoolCreateInfo info; info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;