diff options
| author | Dave Parks <davep@lindenlab.com> | 2011-09-23 02:29:53 -0500 |
|---|---|---|
| committer | Dave Parks <davep@lindenlab.com> | 2011-09-23 02:29:53 -0500 |
| commit | b9926e8f57787eb146b06260cc3d0260e34330ce (patch) | |
| tree | 2f646a86a6e1b074a07ae97284c9f164d824d80f /indra/llrender/llvertexbuffer.h | |
| parent | d3f614e2e971fd442660ba6c1645830d3bf0b6cf (diff) | |
SH-2244 Better VAO support -- still slower than non-VAO implementation for some reason
Diffstat (limited to 'indra/llrender/llvertexbuffer.h')
| -rw-r--r-- | indra/llrender/llvertexbuffer.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index 60cfde39f5..eba10dbaa5 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -139,6 +139,7 @@ public: // 3 - modify LLVertexBuffer::setupVertexBuffer // 4 - modify LLVertexBuffer::setupClientArray // 5 - modify LLViewerShaderMgr::mReservedAttribs + // 6 - update LLVertexBuffer::setupVertexArray enum { TYPE_VERTEX, TYPE_NORMAL, @@ -154,10 +155,9 @@ public: TYPE_WEIGHT4, TYPE_CLOTHWEIGHT, TYPE_MAX, - TYPE_INDEX, - //no actual additional data, but indicates position.w is texture index TYPE_TEXTURE_INDEX, + TYPE_INDEX, }; enum { MAP_VERTEX = (1<<TYPE_VERTEX), @@ -181,10 +181,14 @@ protected: virtual ~LLVertexBuffer(); // use unref() - virtual void setupVertexBuffer(U32 data_mask) const; // pure virtual, called from mapBuffer() + virtual void setupVertexBuffer(U32 data_mask); // pure virtual, called from mapBuffer() + void setupVertexArray(); void genBuffer(); void genIndices(); + bool bindGLBuffer(bool force_bind = false); + bool bindGLIndices(bool force_bind = false); + bool bindGLArray(); void releaseBuffer(); void releaseIndices(); void createGLBuffer(); @@ -194,7 +198,7 @@ protected: void updateNumVerts(S32 nverts); void updateNumIndices(S32 nindices); virtual BOOL useVBOs() const; - void unmapBuffer(S32 type); + void unmapBuffer(); void freeClientBuffer() ; void allocateClientVertexBuffer() ; void allocateClientIndexBuffer() ; @@ -207,7 +211,8 @@ public: U8* mapIndexBuffer(S32 index, S32 count, bool map_range); // set for rendering - virtual void setBuffer(U32 data_mask, S32 type = -1); // calls setupVertexBuffer() if data_mask is not 0 + virtual void setBuffer(U32 data_mask); // calls setupVertexBuffer() if data_mask is not 0 + void flush(); //flush pending data to GL memory // allocate buffer void allocateBuffer(S32 nverts, S32 nindices, bool create); virtual void resizeBuffer(S32 newnverts, S32 newnindices); @@ -273,9 +278,7 @@ protected: U32 mGLBuffer; // GL VBO handle U32 mGLIndices; // GL IBO handle U32 mGLArray; // GL VAO handle - U32 mLastMask; - mutable void* mLastPointer[LL_MAX_VERTEX_ATTRIB_LOCATION]; - + U8* mMappedData; // pointer to currently mapped data (NULL if unmapped) U8* mMappedIndexData; // pointer to currently mapped indices (NULL if unmapped) BOOL mVertexLocked; // if TRUE, vertex buffer is being or has been written to in client memory |
