summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llrender.cpp2
-rw-r--r--indra/llrender/llvertexbuffer.cpp72
-rw-r--r--indra/llrender/llvertexbuffer.h12
3 files changed, 86 insertions, 0 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index f26764cc42..b0ddacbb05 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1434,6 +1434,8 @@ void LLRender::loadIdentity()
flush();
{
+ llassert_always(mMatrixMode < NUM_MATRIX_MODES) ;
+
mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].make_identity();
mMatHash[mMatrixMode]++;
}
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index a7151afeb1..230c1faa40 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -204,14 +204,26 @@ void LLVBOPool::release(U32 name, volatile U8* buffer, U32 size)
Record rec;
rec.mGLName = name;
rec.mClientData = buffer;
+<<<<<<< local
+=======
+
+ sBytesPooled += size;
+>>>>>>> other
+<<<<<<< local
if (buffer == NULL)
+=======
+ if (!LLVertexBuffer::sDisableVBOMapping && mUsage == GL_DYNAMIC_DRAW_ARB)
+>>>>>>> other
{
glDeleteBuffersARB(1, &rec.mGLName);
}
else
{
+<<<<<<< local
sBytesPooled += size;
+=======
+>>>>>>> other
mFreeList[i].push_back(rec);
}
}
@@ -547,7 +559,11 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of
void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indices_offset) const
{
validateRange(start, end, count, indices_offset);
+<<<<<<< local
mMappable = false;
+=======
+ mMappable = FALSE;
+>>>>>>> other
gGL.syncMatrices();
llassert(mNumVerts >= 0);
@@ -602,7 +618,11 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
{
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
+<<<<<<< local
mMappable = false;
+=======
+ mMappable = FALSE;
+>>>>>>> other
gGL.syncMatrices();
llassert(mNumIndices >= 0);
@@ -648,7 +668,11 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
{
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
+<<<<<<< local
mMappable = false;
+=======
+ mMappable = FALSE;
+>>>>>>> other
gGL.syncMatrices();
llassert(mNumVerts >= 0);
@@ -822,6 +846,46 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
mMappable = false;
}
+<<<<<<< local
+=======
+ if (mUsage == GL_STREAM_DRAW_ARB && !sUseStreamDraw)
+ {
+ mUsage = 0;
+ }
+
+ if (mUsage == GL_DYNAMIC_DRAW_ARB && sPreferStreamDraw)
+ {
+ mUsage = GL_STREAM_DRAW_ARB;
+ }
+
+ if (mUsage == 0 && LLRender::sGLCoreProfile)
+ { //MUST use VBOs for all rendering
+ mUsage = GL_STREAM_DRAW_ARB;
+ }
+
+ if (mUsage && mUsage != GL_STREAM_DRAW_ARB)
+ { //only stream_draw and dynamic_draw are supported when using VBOs, dynamic draw is the default
+ if (sDisableVBOMapping)
+ { //always use stream draw if VBO mapping is disabled
+ mUsage = GL_STREAM_DRAW_ARB;
+ }
+ else
+ {
+ mUsage = GL_DYNAMIC_DRAW_ARB;
+ }
+ }
+
+
+ if (mUsage == GL_DYNAMIC_DRAW_ARB && !sDisableVBOMapping)
+ {
+ mMappable = TRUE;
+ }
+ else
+ {
+ mMappable = FALSE;
+ }
+
+>>>>>>> other
//zero out offsets
for (U32 i = 0; i < TYPE_MAX; i++)
{
@@ -1072,7 +1136,11 @@ void LLVertexBuffer::destroyGLBuffer()
}
else
{
+<<<<<<< local
FREE_MEM(sPrivatePoolp, (void*) mMappedData);
+=======
+ FREE_MEM(sPrivatePoolp, (void*) mMappedData) ;
+>>>>>>> other
mMappedData = NULL;
mEmpty = true;
}
@@ -1093,7 +1161,11 @@ void LLVertexBuffer::destroyGLIndices()
}
else
{
+<<<<<<< local
FREE_MEM(sPrivatePoolp, (void*) mMappedIndexData);
+=======
+ FREE_MEM(sPrivatePoolp, (void*) mMappedIndexData) ;
+>>>>>>> other
mMappedIndexData = NULL;
mEmpty = true;
}
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index 0bf689bfad..036f535d81 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -260,7 +260,11 @@ public:
volatile U8* getMappedIndices() const { return mMappedIndexData; }
S32 getOffset(S32 type) const { return mOffsets[type]; }
S32 getUsage() const { return mUsage; }
+<<<<<<< local
bool isWriteable() const { return (mMappable || mUsage == GL_STREAM_DRAW_ARB) ? true : false; }
+=======
+ BOOL isWriteable() const { return (mMappable || mUsage == GL_STREAM_DRAW_ARB) ? TRUE : FALSE; }
+>>>>>>> other
void draw(U32 mode, U32 count, U32 indices_offset) const;
void drawArrays(U32 mode, U32 offset, U32 count) const;
@@ -289,6 +293,7 @@ protected:
volatile U8* mMappedData; // pointer to currently mapped data (NULL if unmapped)
volatile U8* mMappedIndexData; // pointer to currently mapped indices (NULL if unmapped)
+<<<<<<< local
U32 mMappedDataUsingVBOs : 1;
U32 mMappedIndexDataUsingVBOs : 1;
@@ -298,6 +303,13 @@ protected:
U32 mEmpty : 1; // if true, client buffer is empty (or NULL). Old values have been discarded.
mutable bool mMappable; // if true, use memory mapping to upload data (otherwise doublebuffer and use glBufferSubData)
+=======
+ BOOL mVertexLocked; // if TRUE, vertex buffer is being or has been written to in client memory
+ BOOL mIndexLocked; // if TRUE, index buffer is being or has been written to in client memory
+ BOOL mFinal; // if TRUE, buffer can not be mapped again
+ BOOL mEmpty; // if TRUE, client buffer is empty (or NULL). Old values have been discarded.
+ mutable BOOL mMappable; // if TRUE, use memory mapping to upload data (otherwise doublebuffer and use glBufferSubData)
+>>>>>>> other
S32 mOffsets[TYPE_MAX];
std::vector<MappedRegion> mMappedVertexRegions;