mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-12 20:04:45 +01:00
fix(editor): orthophoto tiles no longer turn white after a while out of sight
The tiles are given to the gpu straight from memory; the garbage sweep released them like the ones read from files and they came back as the grey stub until made again. They're kept now, and a new texture name clears the cache of the bound units.
This commit is contained in:
@@ -551,6 +551,16 @@ void opengl_texture::update_from_memory(size_t width, size_t height, const uint8
|
|||||||
if (glGenerateMipmap)
|
if (glGenerateMipmap)
|
||||||
glGenerateMipmap(target);
|
glGenerateMipmap(target);
|
||||||
glFlush();
|
glFlush();
|
||||||
|
// the content given straight to the gpu can't be read again: released by the garbage sweep, the texture would come back as
|
||||||
|
// the grey stub
|
||||||
|
if (type == "internalsrc:")
|
||||||
|
{
|
||||||
|
is_static = true;
|
||||||
|
is_ready = true;
|
||||||
|
}
|
||||||
|
// the name may be a new one, and the unit active took the texture past the unit cache
|
||||||
|
for (auto &unit : units)
|
||||||
|
unit = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user