mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-02 10:24:12 +01:00
[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.
This commit is contained in:
parent
08b403f655
commit
eb7a5da975
@ -45,19 +45,19 @@ namespace dxvk {
|
||||
|
||||
|
||||
VkDescriptorPool DxvkDescriptorAlloc::createDescriptorPool() {
|
||||
constexpr uint32_t MaxSets = 256;
|
||||
constexpr uint32_t MaxDesc = 2048;
|
||||
|
||||
std::array<VkDescriptorPoolSize, 9> 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<VkDescriptorPoolSize, 10> 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;
|
||||
|
Loading…
Reference in New Issue
Block a user