From 4d802e45680a98a66b0072983d0ba19984cb652c Mon Sep 17 00:00:00 2001 From: Roland Hill Date: Thu, 7 Sep 2023 12:53:45 +1000 Subject: [PATCH 1/9] Reserve maxSets OR descriptorPoolSizes if either are required. Ensure at least 1 maxSet is reserved. --- src/vsg/vk/Context.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vsg/vk/Context.cpp b/src/vsg/vk/Context.cpp index 1f778d8f1..6a77976a7 100644 --- a/src/vsg/vk/Context.cpp +++ b/src/vsg/vk/Context.cpp @@ -161,6 +161,7 @@ void Context::getDescriptorPoolSizesToUse(uint32_t& maxSets, DescriptorPoolSizes { maxSets = minimum_maxSets; } + maxSets = std::max(1u, maxSets); for (auto& [minimum_type, minimum_descriptorCount] : minimum_descriptorPoolSizes) { @@ -244,7 +245,7 @@ void Context::reserve(const ResourceRequirements& requirements) if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { getDescriptorPoolSizesToUse(required_maxSets, required_descriptorPoolSizes); - if (required_maxSets > 0 && !required_descriptorPoolSizes.empty()) + if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { descriptorPools.push_back(vsg::DescriptorPool::create(device, required_maxSets, required_descriptorPoolSizes)); } From 714e006452be28d4257cc99e2a03f0cae85a5dfd Mon Sep 17 00:00:00 2001 From: Roland Hill Date: Thu, 7 Sep 2023 12:53:45 +1000 Subject: [PATCH 2/9] Reserve maxSets OR descriptorPoolSizes if either are required. Ensure at least 1 maxSet is reserved. --- src/vsg/vk/Context.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vsg/vk/Context.cpp b/src/vsg/vk/Context.cpp index 47646470d..eea97239f 100644 --- a/src/vsg/vk/Context.cpp +++ b/src/vsg/vk/Context.cpp @@ -162,6 +162,7 @@ void Context::getDescriptorPoolSizesToUse(uint32_t& maxSets, DescriptorPoolSizes { maxSets = minimum_maxSets; } + maxSets = std::max(1u, maxSets); for (auto& [minimum_type, minimum_descriptorCount] : minimum_descriptorPoolSizes) { @@ -250,7 +251,7 @@ void Context::reserve(const ResourceRequirements& requirements) if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { getDescriptorPoolSizesToUse(required_maxSets, required_descriptorPoolSizes); - if (required_maxSets > 0 && !required_descriptorPoolSizes.empty()) + if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { descriptorPools.push_back(vsg::DescriptorPool::create(device, required_maxSets, required_descriptorPoolSizes)); } From ccf7ce46a2315c7132eae763165718d60ed86cd9 Mon Sep 17 00:00:00 2001 From: Roland Hill Date: Thu, 7 Sep 2023 12:53:45 +1000 Subject: [PATCH 3/9] Reserve maxSets OR descriptorPoolSizes if either are required. Ensure at least 1 maxSet is reserved. --- src/vsg/vk/Context.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vsg/vk/Context.cpp b/src/vsg/vk/Context.cpp index 47646470d..eea97239f 100644 --- a/src/vsg/vk/Context.cpp +++ b/src/vsg/vk/Context.cpp @@ -162,6 +162,7 @@ void Context::getDescriptorPoolSizesToUse(uint32_t& maxSets, DescriptorPoolSizes { maxSets = minimum_maxSets; } + maxSets = std::max(1u, maxSets); for (auto& [minimum_type, minimum_descriptorCount] : minimum_descriptorPoolSizes) { @@ -250,7 +251,7 @@ void Context::reserve(const ResourceRequirements& requirements) if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { getDescriptorPoolSizesToUse(required_maxSets, required_descriptorPoolSizes); - if (required_maxSets > 0 && !required_descriptorPoolSizes.empty()) + if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { descriptorPools.push_back(vsg::DescriptorPool::create(device, required_maxSets, required_descriptorPoolSizes)); } From 7fe517bd41dd303c869a034314937aad07ab8a1a Mon Sep 17 00:00:00 2001 From: Roland Hill Date: Thu, 7 Sep 2023 12:53:45 +1000 Subject: [PATCH 4/9] Reserve maxSets OR descriptorPoolSizes if either are required. Ensure at least 1 maxSet is reserved. --- src/vsg/vk/Context.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vsg/vk/Context.cpp b/src/vsg/vk/Context.cpp index 47646470d..eea97239f 100644 --- a/src/vsg/vk/Context.cpp +++ b/src/vsg/vk/Context.cpp @@ -162,6 +162,7 @@ void Context::getDescriptorPoolSizesToUse(uint32_t& maxSets, DescriptorPoolSizes { maxSets = minimum_maxSets; } + maxSets = std::max(1u, maxSets); for (auto& [minimum_type, minimum_descriptorCount] : minimum_descriptorPoolSizes) { @@ -250,7 +251,7 @@ void Context::reserve(const ResourceRequirements& requirements) if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { getDescriptorPoolSizesToUse(required_maxSets, required_descriptorPoolSizes); - if (required_maxSets > 0 && !required_descriptorPoolSizes.empty()) + if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { descriptorPools.push_back(vsg::DescriptorPool::create(device, required_maxSets, required_descriptorPoolSizes)); } From 4fc8c7d35fadfca9d235013596bcd7760d233c17 Mon Sep 17 00:00:00 2001 From: Roland Hill Date: Mon, 8 Jan 2024 13:13:04 +1100 Subject: [PATCH 5/9] Reserve maxSets OR descriptorPoolSizes if either are required. Ensure at least 1 maxSet is reserved. --- src/vsg/vk/Context.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vsg/vk/Context.cpp b/src/vsg/vk/Context.cpp index b07a517ba..d7e1e6da5 100644 --- a/src/vsg/vk/Context.cpp +++ b/src/vsg/vk/Context.cpp @@ -163,6 +163,7 @@ void Context::getDescriptorPoolSizesToUse(uint32_t& maxSets, DescriptorPoolSizes { maxSets = minimum_maxSets; } + maxSets = std::max(1u, maxSets); for (auto& [minimum_type, minimum_descriptorCount] : minimum_descriptorPoolSizes) { @@ -255,7 +256,7 @@ void Context::reserve(const ResourceRequirements& requirements) if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { getDescriptorPoolSizesToUse(required_maxSets, required_descriptorPoolSizes); - if (required_maxSets > 0 && !required_descriptorPoolSizes.empty()) + if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { descriptorPools.push_back(vsg::DescriptorPool::create(device, required_maxSets, required_descriptorPoolSizes)); } From 90250b915a022126ec2f814b23d0302218f00ab2 Mon Sep 17 00:00:00 2001 From: Roland Hill Date: Mon, 8 Jan 2024 13:13:04 +1100 Subject: [PATCH 6/9] Reserve maxSets OR descriptorPoolSizes if either are required. Ensure at least 1 maxSet is reserved. --- src/vsg/vk/Context.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vsg/vk/Context.cpp b/src/vsg/vk/Context.cpp index b07a517ba..d7e1e6da5 100644 --- a/src/vsg/vk/Context.cpp +++ b/src/vsg/vk/Context.cpp @@ -163,6 +163,7 @@ void Context::getDescriptorPoolSizesToUse(uint32_t& maxSets, DescriptorPoolSizes { maxSets = minimum_maxSets; } + maxSets = std::max(1u, maxSets); for (auto& [minimum_type, minimum_descriptorCount] : minimum_descriptorPoolSizes) { @@ -255,7 +256,7 @@ void Context::reserve(const ResourceRequirements& requirements) if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { getDescriptorPoolSizesToUse(required_maxSets, required_descriptorPoolSizes); - if (required_maxSets > 0 && !required_descriptorPoolSizes.empty()) + if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { descriptorPools.push_back(vsg::DescriptorPool::create(device, required_maxSets, required_descriptorPoolSizes)); } From 8b3e6602fa44f256e3cc08d2df36a6145dff5899 Mon Sep 17 00:00:00 2001 From: Roland Hill Date: Mon, 8 Jan 2024 13:13:04 +1100 Subject: [PATCH 7/9] Reserve maxSets OR descriptorPoolSizes if either are required. Ensure at least 1 maxSet is reserved. --- src/vsg/vk/Context.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vsg/vk/Context.cpp b/src/vsg/vk/Context.cpp index b07a517ba..d7e1e6da5 100644 --- a/src/vsg/vk/Context.cpp +++ b/src/vsg/vk/Context.cpp @@ -163,6 +163,7 @@ void Context::getDescriptorPoolSizesToUse(uint32_t& maxSets, DescriptorPoolSizes { maxSets = minimum_maxSets; } + maxSets = std::max(1u, maxSets); for (auto& [minimum_type, minimum_descriptorCount] : minimum_descriptorPoolSizes) { @@ -255,7 +256,7 @@ void Context::reserve(const ResourceRequirements& requirements) if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { getDescriptorPoolSizesToUse(required_maxSets, required_descriptorPoolSizes); - if (required_maxSets > 0 && !required_descriptorPoolSizes.empty()) + if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { descriptorPools.push_back(vsg::DescriptorPool::create(device, required_maxSets, required_descriptorPoolSizes)); } From 6d95eb35d543e0f68a54bfd7a540c109f356ffa1 Mon Sep 17 00:00:00 2001 From: Roland Hill Date: Wed, 29 May 2024 08:56:13 +1000 Subject: [PATCH 8/9] Reserve maxSets OR descriptorPoolSizes if either are required. Ensure at least 1 maxSet is reserved. --- src/vsg/vk/Context.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vsg/vk/Context.cpp b/src/vsg/vk/Context.cpp index b07a517ba..d7e1e6da5 100644 --- a/src/vsg/vk/Context.cpp +++ b/src/vsg/vk/Context.cpp @@ -163,6 +163,7 @@ void Context::getDescriptorPoolSizesToUse(uint32_t& maxSets, DescriptorPoolSizes { maxSets = minimum_maxSets; } + maxSets = std::max(1u, maxSets); for (auto& [minimum_type, minimum_descriptorCount] : minimum_descriptorPoolSizes) { @@ -255,7 +256,7 @@ void Context::reserve(const ResourceRequirements& requirements) if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { getDescriptorPoolSizesToUse(required_maxSets, required_descriptorPoolSizes); - if (required_maxSets > 0 && !required_descriptorPoolSizes.empty()) + if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { descriptorPools.push_back(vsg::DescriptorPool::create(device, required_maxSets, required_descriptorPoolSizes)); } From 660576f995d29036734b163db5d401f4d66ca008 Mon Sep 17 00:00:00 2001 From: Roland Hill Date: Thu, 27 Jun 2024 09:53:47 +1000 Subject: [PATCH 9/9] Reserve maxSets OR descriptorPoolSizes if either are required. Ensure at least 1 maxSet is reserved. --- src/vsg/vk/Context.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vsg/vk/Context.cpp b/src/vsg/vk/Context.cpp index b07a517ba..d7e1e6da5 100644 --- a/src/vsg/vk/Context.cpp +++ b/src/vsg/vk/Context.cpp @@ -163,6 +163,7 @@ void Context::getDescriptorPoolSizesToUse(uint32_t& maxSets, DescriptorPoolSizes { maxSets = minimum_maxSets; } + maxSets = std::max(1u, maxSets); for (auto& [minimum_type, minimum_descriptorCount] : minimum_descriptorPoolSizes) { @@ -255,7 +256,7 @@ void Context::reserve(const ResourceRequirements& requirements) if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { getDescriptorPoolSizesToUse(required_maxSets, required_descriptorPoolSizes); - if (required_maxSets > 0 && !required_descriptorPoolSizes.empty()) + if (required_maxSets > 0 || !required_descriptorPoolSizes.empty()) { descriptorPools.push_back(vsg::DescriptorPool::create(device, required_maxSets, required_descriptorPoolSizes)); }