From d162d7711177c414e5ea9a3876dc6fa3414c937e Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 28 Oct 2021 09:50:44 +0800 Subject: *misc --- Runtime/Graphics/SharedVertexBuffer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Runtime/Graphics/SharedVertexBuffer.h') 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 m_CurVBData; std::vector m_CurIBData; -- cgit v1.1-26-g67d0