diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VKRBase.h b/src/Cafe/HW/Latte/Renderer/Vulkan/VKRBase.h index 7dcd3ebc..7d2cb653 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VKRBase.h +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VKRBase.h @@ -45,7 +45,7 @@ public: VKRMoveableRefCounter(VKRMoveableRefCounter&& rhs) noexcept { this->refs = std::move(rhs.refs); - this->m_refCount = rhs.m_refCount; + this->m_refCount.store(rhs.m_refCount); rhs.m_refCount = 0; this->selfRef = rhs.selfRef; rhs.selfRef = nullptr; @@ -88,21 +88,13 @@ protected: // does nothing by default } - int m_refCount{}; + std::atomic_int_least32_t m_refCount{}; private: VKRMoveableRefCounterRef* selfRef; std::vector refs; #ifdef CEMU_DEBUG_ASSERT std::vector reverseRefs; #endif - - void moveObj(VKRMoveableRefCounter&& rhs) - { - this->refs = std::move(rhs.refs); - this->m_refCount = rhs.m_refCount; - this->selfRef = rhs.selfRef; - this->selfRef->ref = this; - } }; class VKRDestructibleObject : public VKRMoveableRefCounter diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanPipelineCompiler.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanPipelineCompiler.cpp index 795d11c3..55b2330e 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanPipelineCompiler.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanPipelineCompiler.cpp @@ -1177,8 +1177,6 @@ void PipelineCompiler::CompileThreadPool_Stop() while (!s_pipelineCompileRequests.empty()) { PipelineCompiler* pipelineCompiler = s_pipelineCompileRequests.pop(); - if (!pipelineCompiler) - break; if (pipelineCompiler) delete pipelineCompiler; }