diff options
author | chai <chaifix@163.com> | 2021-10-28 09:50:44 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-28 09:50:44 +0800 |
commit | d162d7711177c414e5ea9a3876dc6fa3414c937e (patch) | |
tree | d4cd251229bf4ef6f79860c32f936d1059ff206b /Runtime/Graphics/SharedVertexBuffer.h | |
parent | 80dca084b568e4e77d2a4031ce8625cdabc660ab (diff) |
*misc
Diffstat (limited to 'Runtime/Graphics/SharedVertexBuffer.h')
-rw-r--r-- | Runtime/Graphics/SharedVertexBuffer.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Runtime/Graphics/SharedVertexBuffer.h b/Runtime/Graphics/SharedVertexBuffer.h index 001eb2c..cc89752 100644 --- a/Runtime/Graphics/SharedVertexBuffer.h +++ b/Runtime/Graphics/SharedVertexBuffer.h @@ -18,13 +18,15 @@ public: // default layout void GetChunk(uint attrs, int maxVerts, int maxIndices, EPrimitive primitive, void **out_vb, void **out_ib); - void ReleaseChunk(int actualVerts, int actualIndices); void DrawChunk(); // custom layout void GetChunk(uint sizePerVert, uint sizePerIndex, int maxVerts, int maxIndices, EPrimitive primitive, void **out_vb, void **out_ib); void DrawChunk(CustomVertexLayout& layout); + // common + void ReleaseChunk(int actualVerts, int actualIndices); + private: void FillCustomVertexLayout(CustomVertexLayout& dst); @@ -32,14 +34,12 @@ private: void Clean(); - // if vertex databuffer size beyond this value, use pinned memory mapping, instead of glBufferData. + // 如果数据大小超过这个限制,用内存数据,而不是glBufferData enum { DataBufferThreshold = 1024 }; - // shared vbo and ibo GPU::DataBuffer *m_CurVB; GPU::DataBuffer *m_CurIB; - // restore vbo and ibo data if not using pinned memory mapping std::vector<byte> m_CurVBData; std::vector<uint16> m_CurIBData; |