27TEST(DescriptorPoolRecyclerVKTest, ReclaimMakesDescriptorPoolAvailable) {
33 pool.AllocateDescriptorSets({}, *context);
42 for (
auto i = 0u; i < 2; i++) {
50 context->GetResourceManager(), std::move(rattle));
55 auto const pool = context->GetDescriptorPoolRecycler()->Get();
60 std::count(called->begin(), called->end(),
"vkCreateDescriptorPool"), 1u);
65TEST(DescriptorPoolRecyclerVKTest, ReclaimDropsDescriptorPoolIfSizeIsExceeded) {
70 std::vector<std::unique_ptr<DescriptorPoolVK>> pools;
71 for (
auto i = 0u; i < 33; i++) {
72 auto pool = std::make_unique<DescriptorPoolVK>(context);
73 pool->AllocateDescriptorSets({}, *context);
74 pools.push_back(std::move(
pool));
79 for (
auto i = 0u; i < 2; i++) {
84 context->GetResourceManager(), std::move(rattle));
91 std::count(called->begin(), called->end(),
"vkCreateDescriptorPool"),
93 EXPECT_EQ(std::count(called->begin(), called->end(),
"vkResetDescriptorPool"),
99 std::vector<std::unique_ptr<DescriptorPoolVK>> pools;
100 for (
auto i = 0u; i < 33; i++) {
101 auto pool = std::make_unique<DescriptorPoolVK>(context);
102 pool->AllocateDescriptorSets({}, *context);
103 pools.push_back(std::move(
pool));
107 for (
auto i = 0u; i < 2; i++) {
112 context->GetResourceManager(), std::move(rattle));
120 std::count(called->begin(), called->end(),
"vkCreateDescriptorPool"),
std::shared_ptr< ContextVK > Build()
Create a Vulkan context with Vulkan functions mocked. The caller is given a chance to tinker on the s...