Texture cache: Fix memory consumption and ignore rating when a depth texture is rendered.
This commit is contained in:
parent
618de4e787
commit
ef1dc42635
3 changed files with 19 additions and 7 deletions
|
@ -967,21 +967,24 @@ bool Image::ScaleUp() {
|
|||
if (True(flags & ImageFlagBits::Rescaled)) {
|
||||
return false;
|
||||
}
|
||||
flags |= ImageFlagBits::Rescaled;
|
||||
if (!runtime->resolution.active) {
|
||||
return false;
|
||||
}
|
||||
if (gl_format == 0 && gl_type == 0) {
|
||||
// compressed textures
|
||||
flags &= ~ImageFlagBits::Rescaled;
|
||||
return false;
|
||||
}
|
||||
if (info.type == ImageType::Linear) {
|
||||
UNIMPLEMENTED();
|
||||
UNREACHABLE();
|
||||
flags &= ~ImageFlagBits::Rescaled;
|
||||
return false;
|
||||
}
|
||||
if (!Scale()) {
|
||||
flags &= ~ImageFlagBits::Rescaled;
|
||||
return false;
|
||||
}
|
||||
flags |= ImageFlagBits::Rescaled;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -990,6 +993,9 @@ bool Image::ScaleDown() {
|
|||
return false;
|
||||
}
|
||||
flags &= ~ImageFlagBits::Rescaled;
|
||||
if (!runtime->resolution.active) {
|
||||
return false;
|
||||
}
|
||||
current_texture = texture.handle;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue