diff options
Diffstat (limited to 'indra/llrender')
| -rw-r--r-- | indra/llrender/llimagegl.cpp | 6 | ||||
| -rw-r--r-- | indra/llrender/llshadermgr.cpp | 1 | ||||
| -rw-r--r-- | indra/llrender/llshadermgr.h | 1 | ||||
| -rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 22 |
4 files changed, 24 insertions, 6 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 3d3c94ef3e..7d73888151 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1116,7 +1116,7 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt U32* scratch = NULL; if (LLRender::sGLCoreProfile) { - if (intformat == GL_ALPHA8 && pixformat == GL_ALPHA && pixtype == GL_UNSIGNED_BYTE) + if (pixformat == GL_ALPHA && pixtype == GL_UNSIGNED_BYTE) { //GL_ALPHA is deprecated, convert to RGBA use_scratch = true; scratch = new U32[width*height]; @@ -1133,7 +1133,7 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt intformat = GL_RGBA8; } - if (intformat == GL_LUMINANCE8_ALPHA8 && pixformat == GL_LUMINANCE_ALPHA && pixtype == GL_UNSIGNED_BYTE) + if (pixformat == GL_LUMINANCE_ALPHA && pixtype == GL_UNSIGNED_BYTE) { //GL_LUMINANCE_ALPHA is deprecated, convert to RGBA use_scratch = true; scratch = new U32[width*height]; @@ -1153,7 +1153,7 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt intformat = GL_RGBA8; } - if (intformat == GL_LUMINANCE8 && pixformat == GL_LUMINANCE && pixtype == GL_UNSIGNED_BYTE) + if (pixformat == GL_LUMINANCE && pixtype == GL_UNSIGNED_BYTE) { //GL_LUMINANCE_ALPHA is deprecated, convert to RGB use_scratch = true; scratch = new U32[width*height]; diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 84dc768983..b390037a9c 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -1046,6 +1046,7 @@ void LLShaderMgr::initAttribsAndUniforms() mReservedUniforms.push_back("blur_constant"); mReservedUniforms.push_back("tan_pixel_angle"); mReservedUniforms.push_back("magnification"); + mReservedUniforms.push_back("max_cof"); mReservedUniforms.push_back("depthMap"); mReservedUniforms.push_back("shadowMap0"); diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h index a5150b3e51..82ce2dfff2 100644 --- a/indra/llrender/llshadermgr.h +++ b/indra/llrender/llshadermgr.h @@ -141,6 +141,7 @@ public: DOF_BLUR_CONSTANT, DOF_TAN_PIXEL_ANGLE, DOF_MAGNIFICATION, + DOF_MAX_COF, DEFERRED_DEPTH, DEFERRED_SHADOW0, diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 7f73977010..b426421f88 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -938,7 +938,7 @@ void LLVertexBuffer::releaseIndices() { sStreamIBOPool.release(mGLIndices, mMappedIndexData, mIndicesSize); } - else if (mUsage == GL_DYNAMIC_DRAW_ARB) + else { sDynamicIBOPool.release(mGLIndices, mMappedIndexData, mIndicesSize); } @@ -1122,6 +1122,8 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) } } +static LLFastTimer::DeclareTimer FTM_SETUP_VERTEX_ARRAY("Setup VAO"); + void LLVertexBuffer::setupVertexArray() { if (!mGLArray) @@ -1129,6 +1131,7 @@ void LLVertexBuffer::setupVertexArray() return; } + LLFastTimer t(FTM_SETUP_VERTEX_ARRAY); #if GL_ARB_vertex_array_object glBindVertexArray(mGLArray); #endif @@ -1201,6 +1204,9 @@ void LLVertexBuffer::setupVertexArray() } } + //draw a dummy triangle to set index array pointer + //glDrawElements(GL_TRIANGLES, 0, GL_UNSIGNED_SHORT, NULL); + unbind(); } @@ -1843,14 +1849,18 @@ bool LLVertexBuffer::getClothWeightStrider(LLStrider<LLVector4>& strider, S32 in //---------------------------------------------------------------------------- +static LLFastTimer::DeclareTimer FTM_BIND_GL_ARRAY("Bind Array"); bool LLVertexBuffer::bindGLArray() { if (mGLArray && sGLRenderArray != mGLArray) { + { + LLFastTimer t(FTM_BIND_GL_ARRAY); #if GL_ARB_vertex_array_object - glBindVertexArray(mGLArray); + glBindVertexArray(mGLArray); #endif - sGLRenderArray = mGLArray; + sGLRenderArray = mGLArray; + } //really shouldn't be necessary, but some drivers don't properly restore the //state of GL_ELEMENT_ARRAY_BUFFER_BINDING @@ -1862,6 +1872,8 @@ bool LLVertexBuffer::bindGLArray() return false; } +static LLFastTimer::DeclareTimer FTM_BIND_GL_BUFFER("Bind Buffer"); + bool LLVertexBuffer::bindGLBuffer(bool force_bind) { bindGLArray(); @@ -1870,6 +1882,7 @@ bool LLVertexBuffer::bindGLBuffer(bool force_bind) if (useVBOs() && (force_bind || (mGLBuffer && (mGLBuffer != sGLRenderBuffer || !sVBOActive)))) { + LLFastTimer t(FTM_BIND_GL_BUFFER); /*if (sMapped) { llerrs << "VBO bound while another VBO mapped!" << llendl; @@ -1891,6 +1904,8 @@ bool LLVertexBuffer::bindGLBuffer(bool force_bind) return ret; } +static LLFastTimer::DeclareTimer FTM_BIND_GL_INDICES("Bind Indices"); + bool LLVertexBuffer::bindGLIndices(bool force_bind) { bindGLArray(); @@ -1898,6 +1913,7 @@ bool LLVertexBuffer::bindGLIndices(bool force_bind) bool ret = false; if (useVBOs() && (force_bind || (mGLIndices && (mGLIndices != sGLRenderIndices || !sIBOActive)))) { + LLFastTimer t(FTM_BIND_GL_INDICES); /*if (sMapped) { llerrs << "VBO bound while another VBO mapped!" << llendl; |
