Move the depal cache instance ownership to TextureCacheCommon

This commit is contained in:
Henrik Rydgård committed 2022-08-06 18:27:03 +02:00
1 parent 87b128ecaf
commit 45def772ee
14 files changed
+37 -31

No files matched your search

+9
View File
@@ -129,11 +129,14 @@ TextureCacheCommon::TextureCacheCommon(Draw::DrawContext *draw)
tmpTexBufRearrange_.resize(512 * 512); // 1MB
replacer_.Init();
depalShaderCache_ = new DepalShaderCache(draw);
}
TextureCacheCommon::~TextureCacheCommon() {
FreeAlignedMemory(clutBufConverted_);
FreeAlignedMemory(clutBufRaw_);
delete depalShaderCache_;
}
// Produces a signed 1.23.8 value.
@@ -1841,6 +1844,8 @@ void TextureCacheCommon::ApplyTexture() {
}
void TextureCacheCommon::Clear(bool delete_them) {
depalShaderCache_->Clear();
ForgetLastTexture();
for (TexCache::iterator iter = cache_.begin(); iter != cache_.end(); ++iter) {
ReleaseTexture(iter->second.get(), delete_them);
@@ -2278,3 +2283,7 @@ CheckAlphaResult TextureCacheCommon::CheckCLUTAlpha(const uint8_t *pixelData, GE
return CheckAlpha32((const u32 *)pixelData, w, 0xFF000000); // note, the normal order here, unlike the 16-bit formats
}
}
void TextureCacheCommon::StartFrame() {
depalShaderCache_->Decimate();
}