disable texture caching in some place, due to pointer re-use issue

This commit is contained in:
Erwin Coumans
2020-09-13 16:24:42 -07:00
parent f8288e029e
commit f9a96442d1

View File

@@ -684,7 +684,7 @@ public:
GUIHelperInterface* m_childGuiHelper;
btHashMap<btHashPtr, int> m_cachedTextureIds;
int m_uidGenerator;
const unsigned char* m_texels;
int m_textureWidth;
@@ -910,11 +910,7 @@ 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;
@@ -923,7 +919,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)
@@ -977,7 +973,6 @@ public:
virtual void removeAllGraphicsInstances()
{
m_cachedTextureIds.clear();
m_cs->lock();
m_cs->setSharedParam(1, eGUIHelperRemoveAllGraphicsInstances);
workerThreadWait();