Addresses some resource lifetime issues in OpenGL and Vulkan

This commit is contained in:
Jack Andersen
2017-11-01 23:24:50 -10:00
parent 10364557b9
commit 0f96af94f6
6 changed files with 369 additions and 255 deletions

View File

@@ -95,6 +95,7 @@ public:
{ m_parent = other.m_parent; other.m_parent = nullptr; return *this; }
Token(Token&& other)
{ m_parent = other.m_parent; other.m_parent = nullptr; }
void reset() { if (m_parent) m_parent->decrement(); m_parent = nullptr; }
~Token() { if (m_parent) m_parent->decrement(); }
operator bool() const { return m_parent != nullptr; }
ShaderImpl& get() const { return static_cast<ShaderImpl&>(*m_parent); }