diff options
author | simon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com> | 2013-01-30 15:25:09 -0800 |
---|---|---|
committer | simon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com> | 2013-01-30 15:25:09 -0800 |
commit | ee87ef23037f5e2904dfea3da061a9548cc113f5 (patch) | |
tree | d3aaa5405c97866529e2029572d81ebbd90b8d4a /indra/llrender | |
parent | 07b557cef909d74cd514b2d7e6b666edbfae3ef2 (diff) | |
parent | 60d1404b212824939b8bcd17fd2cc1e46e9bac55 (diff) |
merge downstream code from viewer-lion
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llgl.cpp | 5 | ||||
-rw-r--r-- | indra/llrender/llgl.h | 1 | ||||
-rw-r--r-- | indra/llrender/llrendertarget.cpp | 4 | ||||
-rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 27 |
4 files changed, 5 insertions, 32 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 0b56b3889c..9d06dd6904 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -44,7 +44,6 @@ #include "llmath.h" #include "m4math.h" #include "llstring.h" -#include "llmemtype.h" #include "llstacktrace.h" #include "llglheaders.h" @@ -1133,7 +1132,8 @@ void LLGLManager::initExtensions() // Misc glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, (GLint*) &mGLMaxVertexRange); glGetIntegerv(GL_MAX_ELEMENTS_INDICES, (GLint*) &mGLMaxIndexRange); - + glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*) &mGLMaxTextureSize); + #if (LL_WINDOWS || LL_LINUX || LL_SOLARIS) && !LL_MESA_HEADLESS LL_DEBUGS("RenderInit") << "GL Probe: Getting symbols" << LL_ENDL; if (mHasVertexBufferObject) @@ -2323,7 +2323,6 @@ void LLGLNamePool::release(GLuint name) //static void LLGLNamePool::upkeepPools() { - LLMemType mt(LLMemType::MTYPE_UPKEEP_POOLS); for (tracker_t::instance_iter iter = beginInstances(); iter != endInstances(); ++iter) { LLGLNamePool & pool = *iter; diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index d70e764769..823de9d361 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -147,6 +147,7 @@ public: S32 mVRAM; // VRAM in MB S32 mGLMaxVertexRange; S32 mGLMaxIndexRange; + S32 mGLMaxTextureSize; void getPixelFormat(); // Get the best pixel format diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index c1b96a43da..e35feda2d5 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -109,8 +109,8 @@ void LLRenderTarget::resize(U32 resx, U32 resy, U32 color_fmt) bool LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, bool stencil, LLTexUnit::eTextureType usage, bool use_fbo, S32 samples) { - resx = llmin(resx, (U32) 4096); - resy = llmin(resy, (U32) 4096); + resx = llmin(resx, (U32) gGLManager.mGLMaxTextureSize); + resy = llmin(resy, (U32) gGLManager.mGLMaxTextureSize); stop_glerror(); release(); diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 2fe0aa0b72..dfbd8cd4ee 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -31,7 +31,6 @@ #include "llvertexbuffer.h" // #include "llrender.h" #include "llglheaders.h" -#include "llmemtype.h" #include "llrender.h" #include "llvector4a.h" #include "llshadermgr.h" @@ -870,7 +869,6 @@ void LLVertexBuffer::unbind() //static void LLVertexBuffer::cleanupClass() { - LLMemType mt2(LLMemType::MTYPE_VERTEX_CLEANUP_CLASS); unbind(); sStreamIBOPool.cleanup(); @@ -951,8 +949,6 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) : mMappable(false), mFence(NULL) { - LLMemType mt2(LLMemType::MTYPE_VERTEX_CONSTRUCTOR); - mMappable = (mUsage == GL_DYNAMIC_DRAW_ARB && !sDisableVBOMapping); //zero out offsets @@ -1012,7 +1008,6 @@ S32 LLVertexBuffer::getSize() const //virtual LLVertexBuffer::~LLVertexBuffer() { - LLMemType mt2(LLMemType::MTYPE_VERTEX_DESTRUCTOR); destroyGLBuffer(); destroyGLIndices(); @@ -1132,8 +1127,6 @@ void LLVertexBuffer::releaseIndices() void LLVertexBuffer::createGLBuffer(U32 size) { - LLMemType mt2(LLMemType::MTYPE_VERTEX_CREATE_VERTICES); - if (mGLBuffer) { destroyGLBuffer(); @@ -1163,8 +1156,6 @@ void LLVertexBuffer::createGLBuffer(U32 size) void LLVertexBuffer::createGLIndices(U32 size) { - LLMemType mt2(LLMemType::MTYPE_VERTEX_CREATE_INDICES); - if (mGLIndices) { destroyGLIndices(); @@ -1199,7 +1190,6 @@ void LLVertexBuffer::createGLIndices(U32 size) void LLVertexBuffer::destroyGLBuffer() { - LLMemType mt2(LLMemType::MTYPE_VERTEX_DESTROY_BUFFER); if (mGLBuffer) { if (mMappedDataUsingVBOs) @@ -1220,7 +1210,6 @@ void LLVertexBuffer::destroyGLBuffer() void LLVertexBuffer::destroyGLIndices() { - LLMemType mt2(LLMemType::MTYPE_VERTEX_DESTROY_INDICES); if (mGLIndices) { if (mMappedIndexDataUsingVBOs) @@ -1241,8 +1230,6 @@ void LLVertexBuffer::destroyGLIndices() void LLVertexBuffer::updateNumVerts(S32 nverts) { - LLMemType mt2(LLMemType::MTYPE_VERTEX_UPDATE_VERTS); - llassert(nverts >= 0); if (nverts > 65536) @@ -1265,8 +1252,6 @@ void LLVertexBuffer::updateNumVerts(S32 nverts) void LLVertexBuffer::updateNumIndices(S32 nindices) { - LLMemType mt2(LLMemType::MTYPE_VERTEX_UPDATE_INDICES); - llassert(nindices >= 0); U32 needed_size = sizeof(U16) * nindices; @@ -1283,8 +1268,6 @@ void LLVertexBuffer::updateNumIndices(S32 nindices) void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) { - LLMemType mt2(LLMemType::MTYPE_VERTEX_ALLOCATE_BUFFER); - stop_glerror(); if (nverts < 0 || nindices < 0 || @@ -1435,8 +1418,6 @@ void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices) llassert(newnverts >= 0); llassert(newnindices >= 0); - LLMemType mt2(LLMemType::MTYPE_VERTEX_RESIZE_BUFFER); - updateNumVerts(newnverts); updateNumIndices(newnindices); @@ -1484,7 +1465,6 @@ static LLFastTimer::DeclareTimer FTM_VBO_MAP_BUFFER("VBO Map"); volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_range) { bindGLBuffer(true); - LLMemType mt2(LLMemType::MTYPE_VERTEX_MAP_BUFFER); if (mFinal) { llerrs << "LLVertexBuffer::mapVeretxBuffer() called on a finalized buffer." << llendl; @@ -1533,7 +1513,6 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo if (!mVertexLocked) { - LLMemType mt_v(LLMemType::MTYPE_VERTEX_MAP_BUFFER_VERTICES); mVertexLocked = true; sMappedCount++; stop_glerror(); @@ -1664,7 +1643,6 @@ static LLFastTimer::DeclareTimer FTM_VBO_MAP_INDEX("IBO Map"); volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) { - LLMemType mt2(LLMemType::MTYPE_VERTEX_MAP_BUFFER); bindGLIndices(true); if (mFinal) { @@ -1711,8 +1689,6 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range if (!mIndexLocked) { - LLMemType mt_v(LLMemType::MTYPE_VERTEX_MAP_BUFFER_INDICES); - mIndexLocked = true; sMappedCount++; stop_glerror(); @@ -1835,7 +1811,6 @@ static LLFastTimer::DeclareTimer FTM_IBO_FLUSH_RANGE("Flush IBO Range"); void LLVertexBuffer::unmapBuffer() { - LLMemType mt2(LLMemType::MTYPE_VERTEX_UNMAP_BUFFER); if (!useVBOs()) { return; //nothing to unmap @@ -2189,7 +2164,6 @@ void LLVertexBuffer::setBuffer(U32 data_mask) { flush(); - LLMemType mt2(LLMemType::MTYPE_VERTEX_SET_BUFFER); //set up pointers if the data mask is different ... bool setup = (sLastMask != data_mask); @@ -2331,7 +2305,6 @@ void LLVertexBuffer::setBuffer(U32 data_mask) // virtual (default) void LLVertexBuffer::setupVertexBuffer(U32 data_mask) { - LLMemType mt2(LLMemType::MTYPE_VERTEX_SETUP_VERTEX_BUFFER); stop_glerror(); volatile U8* base = useVBOs() ? (U8*) mAlignedOffset : mMappedData; |