diff --git a/panda/src/display/graphicsEngine.cxx b/panda/src/display/graphicsEngine.cxx index 0c33637296..70a6d43bfb 100644 --- a/panda/src/display/graphicsEngine.cxx +++ b/panda/src/display/graphicsEngine.cxx @@ -700,7 +700,10 @@ render_frame() { // were drawn in the previous frame. LoadedTextures::iterator lti; for (lti = _loaded_textures.begin(); lti != _loaded_textures.end(); ++lti) { - (*lti)->texture_uploaded(); + LoadedTexture < = (*lti); + if (lt._tex->get_image_modified() == lt._image_modified) { + lt._tex->texture_uploaded(); + } } _loaded_textures.clear(); @@ -1081,7 +1084,10 @@ texture_uploaded(Texture *tex) { // We defer this until the end of the frame; multiple GSG's might be // rendering the texture within the same frame, and we don't want to // dump the texture image until they've all had a chance at it. - _loaded_textures.push_back(tex); + _loaded_textures.push_back(LoadedTexture()); + LoadedTexture < = _loaded_textures.back(); + lt._tex = tex; + lt._image_modified = tex->get_image_modified(); } diff --git a/panda/src/display/graphicsEngine.h b/panda/src/display/graphicsEngine.h index cee553e8d5..4773641633 100644 --- a/panda/src/display/graphicsEngine.h +++ b/panda/src/display/graphicsEngine.h @@ -346,7 +346,12 @@ private: bool _singular_warning_last_frame; bool _singular_warning_this_frame; - typedef pvector< PT(Texture) > LoadedTextures; + class LoadedTexture { + public: + PT(Texture) _tex; + UpdateSeq _image_modified; + }; + typedef pvector LoadedTextures; LoadedTextures _loaded_textures; LightReMutex _lock;