From 78ddd03d1f67fe0bae16da6a4d6090feae1f6fb4 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Thu, 29 Sep 2022 20:36:10 +0100 Subject: [PATCH] Mark newly allocated descriptor slots as active --- app/src/main/cpp/skyline/gpu/descriptor_allocator.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/cpp/skyline/gpu/descriptor_allocator.cpp b/app/src/main/cpp/skyline/gpu/descriptor_allocator.cpp index 6efaca98..4b0d3e32 100644 --- a/app/src/main/cpp/skyline/gpu/descriptor_allocator.cpp +++ b/app/src/main/cpp/skyline/gpu/descriptor_allocator.cpp @@ -116,7 +116,9 @@ namespace skyline::gpu { auto set{AllocateVkDescriptorSet(layout)}; if (set.result == vk::Result::eSuccess) { auto &layoutSlots{pool->layoutSlots.try_emplace(layout).first->second}; - return ActiveDescriptorSet{pool, &layoutSlots.emplace_back(set.value)}; + auto &slot{layoutSlots.emplace_back(set.value)}; + slot.active.test_and_set(std::memory_order_relaxed); + return ActiveDescriptorSet{pool, &slot}; } else { lastResult = set.result; } @@ -140,6 +142,8 @@ namespace skyline::gpu { auto set{AllocateVkDescriptorSet(layout)}; if (set.result == vk::Result::eSuccess) { auto &layoutSlots{pool->layoutSlots.try_emplace(layout).first->second}; + auto &slot{layoutSlots.emplace_back(set.value)}; + slot.active.test_and_set(std::memory_order_relaxed); return ActiveDescriptorSet{pool, &layoutSlots.emplace_back(set.value)}; } else { lastResult = set.result;