Don't keep the majority of textures in RAM if they are not needed, further reducing the memory footprint

This commit is contained in:
Alexander Bock
2020-08-18 10:48:56 +02:00
parent b49154b83e
commit 2b6d95057b
5 changed files with 5 additions and 6 deletions
@@ -453,6 +453,7 @@ void RenderableModel::loadTexture() {
);
_texture->uploadTexture();
_texture->setFilter(ghoul::opengl::Texture::FilterMode::AnisotropicMipMap);
_texture->purgeFromRAM();
}
}
}
@@ -488,6 +488,7 @@ void RenderableSphere::loadTexture() {
);
texture->uploadTexture();
texture->setFilter(ghoul::opengl::Texture::FilterMode::LinearMipMap);
texture->purgeFromRAM();
_texture = std::move(texture);
}
}
@@ -180,6 +180,7 @@ void ScreenSpaceFramebuffer::createFramebuffer() {
_texture->uploadTexture();
_texture->setFilter(ghoul::opengl::Texture::FilterMode::LinearMipMap);
_texture->purgeFromRAM();
_framebuffer->attachTexture(_texture.get(), GL_COLOR_ATTACHMENT0);
_framebuffer->deactivate();
}
@@ -132,10 +132,8 @@ void ScreenSpaceImageLocal::update() {
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
texture->uploadTexture();
// Textures of planets looks much smoother with AnisotropicMipMap rather than
// linear
texture->setFilter(ghoul::opengl::Texture::FilterMode::LinearMipMap);
texture->purgeFromRAM();
_texture = std::move(texture);
_objectSize = _texture->dimensions();
@@ -142,10 +142,8 @@ void ScreenSpaceImageOnline::update() {
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
texture->uploadTexture();
// Textures of planets looks much smoother with AnisotropicMipMap rather
// than linear
texture->setFilter(ghoul::opengl::Texture::FilterMode::LinearMipMap);
texture->purgeFromRAM();
_texture = std::move(texture);
_objectSize = _texture->dimensions();