Finish object tracker for remaining platforms

This commit is contained in:
Jack Andersen
2017-11-05 20:53:54 -10:00
parent 3a7987bb21
commit 6c3a35f15d
6 changed files with 789 additions and 1000 deletions

View File

@@ -62,6 +62,8 @@ struct BaseGraphicsData : IObj
GraphicsDataNode<ITextureR, BaseGraphicsData>* m_RTexs = nullptr;
GraphicsDataNode<IVertexFormat, BaseGraphicsData>* m_VFmts = nullptr;
template<class T> GraphicsDataNode<T, BaseGraphicsData>*& getHead();
template<class T> size_t countForward()
{ auto* head = getHead<T>(); return head ? head->countForward() : 0; }
explicit BaseGraphicsData(GraphicsDataFactoryHead& head)
: m_head(head)
@@ -123,6 +125,8 @@ struct BaseGraphicsPool : IObj
BaseGraphicsPool* m_prev = nullptr;
GraphicsDataNode<IGraphicsBufferD, BaseGraphicsPool>* m_DBufs = nullptr;
template<class T> GraphicsDataNode<T, BaseGraphicsPool>*& getHead();
template<class T> size_t countForward()
{ auto* head = getHead<T>(); return head ? head->countForward() : 0; }
explicit BaseGraphicsPool(GraphicsDataFactoryHead& head)
: m_head(head)
@@ -213,6 +217,14 @@ struct GraphicsDataNode : NodeCls
iterator begin() { return iterator(this); }
iterator end() { return iterator(nullptr); }
size_t countForward()
{
size_t ret = 0;
for (auto& n : *this)
++ret;
return ret;
}
};
/** Hash table entry for owning sharable shader objects */