Use memory_order_release for new descriptor set allocations

This commit is contained in:
Billy Laws 2022-10-09 13:16:50 +01:00
parent 34db5097da
commit 0e8ccf1e99

View File

@ -106,7 +106,7 @@ namespace skyline::gpu {
auto set{AllocateVkDescriptorSet(layout)}; auto set{AllocateVkDescriptorSet(layout)};
if (set.result == vk::Result::eSuccess) { if (set.result == vk::Result::eSuccess) {
auto &slot{slots.emplace_back(set.value)}; auto &slot{slots.emplace_back(set.value)};
slot.active.test_and_set(std::memory_order_relaxed); slot.active.test_and_set(std::memory_order_release);
return ActiveDescriptorSet{pool, &slot}; return ActiveDescriptorSet{pool, &slot};
} else { } else {
lastResult = set.result; lastResult = set.result;
@ -117,7 +117,7 @@ namespace skyline::gpu {
if (set.result == vk::Result::eSuccess) { if (set.result == vk::Result::eSuccess) {
auto &layoutSlots{pool->layoutSlots.try_emplace(layout).first->second}; auto &layoutSlots{pool->layoutSlots.try_emplace(layout).first->second};
auto &slot{layoutSlots.emplace_back(set.value)}; auto &slot{layoutSlots.emplace_back(set.value)};
slot.active.test_and_set(std::memory_order_relaxed); slot.active.test_and_set(std::memory_order_release);
return ActiveDescriptorSet{pool, &slot}; return ActiveDescriptorSet{pool, &slot};
} else { } else {
lastResult = set.result; lastResult = set.result;
@ -143,8 +143,8 @@ namespace skyline::gpu {
if (set.result == vk::Result::eSuccess) { if (set.result == vk::Result::eSuccess) {
auto &layoutSlots{pool->layoutSlots.try_emplace(layout).first->second}; auto &layoutSlots{pool->layoutSlots.try_emplace(layout).first->second};
auto &slot{layoutSlots.emplace_back(set.value)}; auto &slot{layoutSlots.emplace_back(set.value)};
slot.active.test_and_set(std::memory_order_relaxed); slot.active.test_and_set(std::memory_order_release);
return ActiveDescriptorSet{pool, &layoutSlots.emplace_back(set.value)}; return ActiveDescriptorSet{pool, &slot};
} else { } else {
lastResult = set.result; lastResult = set.result;
} }