diff options
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llglslshader.cpp | 6 | ||||
-rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 6 | ||||
-rw-r--r-- | indra/llrender/llvertexbuffer.h | 2 |
3 files changed, 14 insertions, 0 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index ca92cb6580..2b3179116d 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -343,8 +343,11 @@ BOOL LLGLSLShader::link(BOOL suppress_errors) return LLShaderMgr::instance()->linkProgramObject(mProgramObject, suppress_errors); } +static LLFastTimer::DeclareTimer FTM_BIND_SHADER("Bind Shader"); + void LLGLSLShader::bind() { + LLFastTimer ftm(FTM_BIND_SHADER); if (gGLManager.mHasShaderObjects) { glUseProgramObjectARB(mProgramObject); @@ -357,8 +360,11 @@ void LLGLSLShader::bind() } } +static LLFastTimer::DeclareTimer FTM_UNBIND_SHADER("Unbind Shader"); + void LLGLSLShader::unbind() { + LLFastTimer ftm(FTM_UNBIND_SHADER); if (gGLManager.mHasShaderObjects) { stop_glerror(); diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index bf5eda21eb..ae43915a9d 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -61,6 +61,7 @@ BOOL LLVertexBuffer::sVBOActive = FALSE; BOOL LLVertexBuffer::sIBOActive = FALSE; U32 LLVertexBuffer::sAllocatedBytes = 0; BOOL LLVertexBuffer::sMapped = FALSE; +BOOL LLVertexBuffer::sUseStreamDraw = TRUE; std::vector<U32> LLVertexBuffer::sDeleteList; @@ -381,6 +382,11 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) : { mUsage = 0 ; } + + if (mUsage == GL_STREAM_DRAW_ARB && !sUseStreamDraw) + { + mUsage = 0; + } S32 stride = calcStride(typemask, mOffsets); diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index b785a22976..e2fecdffef 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -83,6 +83,8 @@ public: static LLVBOPool sDynamicVBOPool; static LLVBOPool sStreamIBOPool; static LLVBOPool sDynamicIBOPool; + + static BOOL sUseStreamDraw; static void initClass(bool use_vbo); static void cleanupClass(); |