| 26 | } |
| 27 | |
| 28 | const VulkanTypedHandle* vvl::StateObject::InUse() const { |
| 29 | // NOTE: for performance reasons, this method calls up the tree |
| 30 | // with the read lock held. |
| 31 | auto guard = ReadLockTree(); |
| 32 | for (auto& item : parent_nodes_) { |
| 33 | auto node = item.second.lock(); |
| 34 | if (!node) { |
| 35 | continue; |
| 36 | } |
| 37 | if (node->InUse()) { |
| 38 | return &node->Handle(); |
| 39 | } |
| 40 | } |
| 41 | return nullptr; |
| 42 | } |
| 43 | |
| 44 | bool vvl::StateObject::AddParent(StateObject* parent_node) { |
| 45 | auto guard = WriteLockTree(); |