mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 18:03:56 -04:00
prevent overactive texture reload
This commit is contained in:
parent
05917ee0b4
commit
ec408822c5
@ -700,7 +700,10 @@ render_frame() {
|
|||||||
// were drawn in the previous frame.
|
// were drawn in the previous frame.
|
||||||
LoadedTextures::iterator lti;
|
LoadedTextures::iterator lti;
|
||||||
for (lti = _loaded_textures.begin(); lti != _loaded_textures.end(); ++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();
|
_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
|
// 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
|
// 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.
|
// 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -346,7 +346,12 @@ private:
|
|||||||
bool _singular_warning_last_frame;
|
bool _singular_warning_last_frame;
|
||||||
bool _singular_warning_this_frame;
|
bool _singular_warning_this_frame;
|
||||||
|
|
||||||
typedef pvector< PT(Texture) > LoadedTextures;
|
class LoadedTexture {
|
||||||
|
public:
|
||||||
|
PT(Texture) _tex;
|
||||||
|
UpdateSeq _image_modified;
|
||||||
|
};
|
||||||
|
typedef pvector<LoadedTexture> LoadedTextures;
|
||||||
LoadedTextures _loaded_textures;
|
LoadedTextures _loaded_textures;
|
||||||
|
|
||||||
LightReMutex _lock;
|
LightReMutex _lock;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user