texture caching and geometry caching (PhysX) for much faster loading of many same objects, helps benchmarking/comparison.
add command-line args for PhysX (numCores=..., solver=tgs, )
This commit is contained in:
@@ -658,6 +658,7 @@ public:
|
||||
}
|
||||
GUIHelperInterface* m_childGuiHelper;
|
||||
|
||||
btHashMap<btHashPtr, int> m_cachedTextureIds;
|
||||
int m_uidGenerator;
|
||||
const unsigned char* m_texels;
|
||||
int m_textureWidth;
|
||||
@@ -856,6 +857,11 @@ public:
|
||||
|
||||
virtual int registerTexture(const unsigned char* texels, int width, int height)
|
||||
{
|
||||
int* cachedTexture = m_cachedTextureIds[texels];
|
||||
if (cachedTexture)
|
||||
{
|
||||
return *cachedTexture;
|
||||
}
|
||||
m_texels = texels;
|
||||
m_textureWidth = width;
|
||||
m_textureHeight = height;
|
||||
@@ -864,7 +870,7 @@ public:
|
||||
m_cs->setSharedParam(1, eGUIHelperRegisterTexture);
|
||||
|
||||
workerThreadWait();
|
||||
|
||||
m_cachedTextureIds.insert(texels, m_textureId);
|
||||
return m_textureId;
|
||||
}
|
||||
virtual int registerGraphicsShape(const float* vertices, int numvertices, const int* indices, int numIndices, int primitiveType, int textureId)
|
||||
@@ -918,6 +924,7 @@ public:
|
||||
|
||||
virtual void removeAllGraphicsInstances()
|
||||
{
|
||||
m_cachedTextureIds.clear();
|
||||
m_cs->lock();
|
||||
m_cs->setSharedParam(1, eGUIHelperRemoveAllGraphicsInstances);
|
||||
workerThreadWait();
|
||||
|
||||
Reference in New Issue
Block a user