mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-03-26 20:18:29 -06:00
Vulkan: Fixes for object refcounting
This commit is contained in:
parent
4ca4d1caed
commit
ceb9771a5c
@ -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<VKRMoveableRefCounterRef*> refs;
|
||||
#ifdef CEMU_DEBUG_ASSERT
|
||||
std::vector<VKRMoveableRefCounterRef*> 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
|
||||
|
||||
@ -1177,8 +1177,6 @@ void PipelineCompiler::CompileThreadPool_Stop()
|
||||
while (!s_pipelineCompileRequests.empty())
|
||||
{
|
||||
PipelineCompiler* pipelineCompiler = s_pipelineCompileRequests.pop();
|
||||
if (!pipelineCompiler)
|
||||
break;
|
||||
if (pipelineCompiler)
|
||||
delete pipelineCompiler;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user