mirror of
https://github.com/yuzu-emu/yuzu-mainline.git
synced 2024-12-12 18:44:23 +01:00
Texture Cache: ease the requirements of textures being blacklisted.
This commit is contained in:
parent
50b4c774cb
commit
c2ca55c9d5
@ -221,7 +221,6 @@ void TextureCache<P>::UpdateRenderTargets(bool is_clear) {
|
|||||||
scale_rating = 0;
|
scale_rating = 0;
|
||||||
bool any_rescaled = false;
|
bool any_rescaled = false;
|
||||||
bool can_rescale = true;
|
bool can_rescale = true;
|
||||||
bool any_blacklisted = false;
|
|
||||||
const auto check_rescale = [&](ImageViewId view_id, ImageId& id_save) {
|
const auto check_rescale = [&](ImageViewId view_id, ImageId& id_save) {
|
||||||
if (view_id != NULL_IMAGE_VIEW_ID && view_id != ImageViewId{}) {
|
if (view_id != NULL_IMAGE_VIEW_ID && view_id != ImageViewId{}) {
|
||||||
const auto& view = slot_image_views[view_id];
|
const auto& view = slot_image_views[view_id];
|
||||||
@ -229,7 +228,6 @@ void TextureCache<P>::UpdateRenderTargets(bool is_clear) {
|
|||||||
id_save = image_id;
|
id_save = image_id;
|
||||||
auto& image = slot_images[image_id];
|
auto& image = slot_images[image_id];
|
||||||
can_rescale &= ImageCanRescale(image);
|
can_rescale &= ImageCanRescale(image);
|
||||||
any_blacklisted |= True(image.flags & ImageFlagBits::Blacklisted);
|
|
||||||
any_rescaled |= True(image.flags & ImageFlagBits::Rescaled) ||
|
any_rescaled |= True(image.flags & ImageFlagBits::Rescaled) ||
|
||||||
GetFormatType(image.info.format) != SurfaceType::ColorTexture;
|
GetFormatType(image.info.format) != SurfaceType::ColorTexture;
|
||||||
scale_rating = std::max<u32>(scale_rating, image.scale_tick <= frame_tick
|
scale_rating = std::max<u32>(scale_rating, image.scale_tick <= frame_tick
|
||||||
@ -270,20 +268,17 @@ void TextureCache<P>::UpdateRenderTargets(bool is_clear) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
rescaled = false;
|
rescaled = false;
|
||||||
const auto scale_down = [this, any_blacklisted](ImageId image_id) {
|
const auto scale_down = [this](ImageId image_id) {
|
||||||
if (image_id != CORRUPT_ID) {
|
if (image_id != CORRUPT_ID) {
|
||||||
Image& image = slot_images[image_id];
|
Image& image = slot_images[image_id];
|
||||||
ScaleDown(image);
|
ScaleDown(image);
|
||||||
if (any_blacklisted) {
|
|
||||||
image.flags |= ImageFlagBits::Blacklisted;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
for (size_t index = 0; index < NUM_RT; ++index) {
|
for (size_t index = 0; index < NUM_RT; ++index) {
|
||||||
scale_down(tmp_color_images[index]);
|
scale_down(tmp_color_images[index]);
|
||||||
}
|
}
|
||||||
scale_down(tmp_depth_image);
|
scale_down(tmp_depth_image);
|
||||||
scale_rating = 0;
|
scale_rating = 1;
|
||||||
}
|
}
|
||||||
} while (has_deleted_images);
|
} while (has_deleted_images);
|
||||||
// Rescale End
|
// Rescale End
|
||||||
@ -352,7 +347,10 @@ void TextureCache<P>::FillImageViews(DescriptorTable<TICEntry>& table,
|
|||||||
if constexpr (has_blacklists) {
|
if constexpr (has_blacklists) {
|
||||||
if (view.blacklist && view.id != NULL_IMAGE_VIEW_ID) {
|
if (view.blacklist && view.id != NULL_IMAGE_VIEW_ID) {
|
||||||
const ImageViewBase& image_view{slot_image_views[view.id]};
|
const ImageViewBase& image_view{slot_image_views[view.id]};
|
||||||
has_blacklisted |= BlackListImage(image_view.image_id);
|
auto& image = slot_images[image_view.image_id];
|
||||||
|
image.flags |= ImageFlagBits::Blacklisted;
|
||||||
|
has_blacklisted |= ScaleDown(image);
|
||||||
|
image.scale_rating = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -783,20 +781,9 @@ ImageId TextureCache<P>::FindImage(const ImageInfo& info, GPUVAddr gpu_addr,
|
|||||||
return image_id;
|
return image_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class P>
|
|
||||||
bool TextureCache<P>::BlackListImage(ImageId image_id) {
|
|
||||||
auto& image = slot_images[image_id];
|
|
||||||
if (True(image.flags & ImageFlagBits::Blacklisted)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
image.flags |= ImageFlagBits::Blacklisted;
|
|
||||||
ScaleDown(image);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class P>
|
template <class P>
|
||||||
bool TextureCache<P>::ImageCanRescale(ImageBase& image) {
|
bool TextureCache<P>::ImageCanRescale(ImageBase& image) {
|
||||||
if (!image.info.rescaleable || True(image.flags & ImageFlagBits::Blacklisted)) {
|
if (!image.info.rescaleable) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (Settings::values.resolution_info.downscale && !image.info.downscaleable) {
|
if (Settings::values.resolution_info.downscale && !image.info.downscaleable) {
|
||||||
|
@ -166,8 +166,6 @@ public:
|
|||||||
|
|
||||||
[[nodiscard]] bool IsRescaling(const ImageViewBase& image_view) const noexcept;
|
[[nodiscard]] bool IsRescaling(const ImageViewBase& image_view) const noexcept;
|
||||||
|
|
||||||
[[nodiscard]] bool BlackListImage(ImageId image_id);
|
|
||||||
|
|
||||||
std::mutex mutex;
|
std::mutex mutex;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user