meow-7.2.2
brad kittenbrink 2011-04-27 16:02:30 -07:00
commit 8a265498d0
6 changed files with 17 additions and 32 deletions

View File

@ -268,6 +268,10 @@ if(LLCOMMON_LINK_SHARED)
add_definitions(-fPIC)
endif(WINDOWS)
endif(NOT WORD_SIZE EQUAL 32)
if(WINDOWS)
# always generate llcommon.pdb, even for "Release" builds
set_target_properties(llcommon PROPERTIES LINK_FLAGS "/DEBUG")
endif(WINDOWS)
ll_stage_sharedlib(llcommon)
else(LLCOMMON_LINK_SHARED)
add_library (llcommon ${llcommon_SOURCE_FILES})

View File

@ -105,7 +105,6 @@ LLMatrix4 gGLObliqueProjectionInverse;
#define LL_GL_NAME_POOLING 0
LLGLNamePool::pool_list_t LLGLNamePool::sInstances;
std::list<LLGLUpdate*> LLGLUpdate::sGLQ;
#if (LL_WINDOWS || LL_LINUX || LL_SOLARIS) && !LL_MESA_HEADLESS
@ -1920,22 +1919,8 @@ LLGLNamePool::LLGLNamePool()
{
}
void LLGLNamePool::registerPool(LLGLNamePool* pool)
{
pool_list_t::iterator iter = std::find(sInstances.begin(), sInstances.end(), pool);
if (iter == sInstances.end())
{
sInstances.push_back(pool);
}
}
LLGLNamePool::~LLGLNamePool()
{
pool_list_t::iterator iter = std::find(sInstances.begin(), sInstances.end(), this);
if (iter != sInstances.end())
{
sInstances.erase(iter);
}
}
void LLGLNamePool::upkeep()
@ -2004,20 +1989,22 @@ void LLGLNamePool::release(GLuint name)
void LLGLNamePool::upkeepPools()
{
LLMemType mt(LLMemType::MTYPE_UPKEEP_POOLS);
for (pool_list_t::iterator iter = sInstances.begin(); iter != sInstances.end(); ++iter)
tracker_t::LLInstanceTrackerScopedGuard guard;
for (tracker_t::instance_iter iter = guard.beginInstances(); iter != guard.endInstances(); ++iter)
{
LLGLNamePool* pool = *iter;
pool->upkeep();
LLGLNamePool & pool = *iter;
pool.upkeep();
}
}
//static
void LLGLNamePool::cleanupPools()
{
for (pool_list_t::iterator iter = sInstances.begin(); iter != sInstances.end(); ++iter)
tracker_t::LLInstanceTrackerScopedGuard guard;
for (tracker_t::instance_iter iter = guard.beginInstances(); iter != guard.endInstances(); ++iter)
{
LLGLNamePool* pool = *iter;
pool->cleanup();
LLGLNamePool & pool = *iter;
pool.cleanup();
}
}

View File

@ -40,6 +40,7 @@
#include "v4math.h"
#include "llplane.h"
#include "llgltypes.h"
#include "llinstancetracker.h"
#include "llglheaders.h"
#include "glh/glh_linear.h"
@ -328,9 +329,11 @@ public:
Generic pooling scheme for things which use GL names (used for occlusion queries and vertex buffer objects).
Prevents thrashing of GL name caches by avoiding calls to glGenFoo and glDeleteFoo.
*/
class LLGLNamePool
class LLGLNamePool : public LLInstanceTracker<LLGLNamePool>
{
public:
typedef LLInstanceTracker<LLGLNamePool> tracker_t;
struct NameEntry
{
GLuint name;
@ -357,13 +360,11 @@ public:
GLuint allocate();
void release(GLuint name);
static void registerPool(LLGLNamePool* pool);
static void upkeepPools();
static void cleanupPools();
protected:
typedef std::vector<LLGLNamePool*> pool_list_t;
static pool_list_t sInstances;
virtual GLuint allocateName() = 0;
virtual void releaseName(GLuint name) = 0;

View File

@ -323,10 +323,6 @@ void LLVertexBuffer::initClass(bool use_vbo, bool no_vbo_mapping)
}
sDisableVBOMapping = sEnableVBOs && no_vbo_mapping ;
LLGLNamePool::registerPool(&sDynamicVBOPool);
LLGLNamePool::registerPool(&sDynamicIBOPool);
LLGLNamePool::registerPool(&sStreamVBOPool);
LLGLNamePool::registerPool(&sStreamIBOPool);
}
//static

View File

@ -839,7 +839,6 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v
{
std::string name;
LLSD settings;
LLSD control_map;
llifstream infile;
infile.open(filename);
if(!infile.is_open())
@ -864,7 +863,7 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v
{
bool persist = true;
name = (*itr).first;
control_map = (*itr).second;
LLSD const & control_map = (*itr).second;
if(control_map.has("Persist"))
{

View File

@ -1635,8 +1635,6 @@ LLSpatialPartition::LLSpatialPartition(U32 data_mask, BOOL render_by_group, U32
mSlopRatio = 0.25f;
mInfiniteFarClip = FALSE;
LLGLNamePool::registerPool(&sQueryPool);
mOctree = new LLSpatialGroup::OctreeRoot(LLVector3d(0,0,0),
LLVector3d(1,1,1),
NULL);