Add option to purge texture from RAM after gpu upload

This commit is contained in:
Emma Broman
2021-01-18 13:34:50 +01:00
parent 6380e5b307
commit 2ae5a16697
2 changed files with 24 additions and 6 deletions

View File

@@ -39,11 +39,15 @@ class TextureComponent {
public:
TextureComponent() = default;
TextureComponent(const Texture::FilterMode filterMode, bool watchFile = true);
TextureComponent(const Texture::FilterMode filterMode, bool watchFile = true,
bool shouldPurge = true);
~TextureComponent() = default;
Texture* texture() const;
void setShouldWatchFileForChanges(bool value);
void setShouldPurgeFromRAM(bool value);
void bind();
void uploadToGpu();
@@ -60,9 +64,10 @@ private:
Texture::FilterMode _filterMode = Texture::FilterMode::LinearMipMap;
bool _shouldWatchFile = true;
bool _shouldPurgeFromRAM = true;
bool _fileIsDirty = false;
bool _textureIsDirty = false;
bool _fileIsDirty;
bool _textureIsDirty;
};
} // namespace openspace