summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-06-13 03:16:36 +0200
committerGitHub <noreply@github.com>2023-06-13 03:16:36 +0200
commite0de6dd63f457e18a91572b5189e72c018b919cc (patch)
tree35a7a53e586e3d8bb5b2df03f6a757240d39bad9 /src
parentMerge pull request #10743 from FearlessTobi/translations (diff)
parentimage_info: adjust rescale thresholds and refactor constant use (diff)
downloadyuzu-e0de6dd63f457e18a91572b5189e72c018b919cc.tar
yuzu-e0de6dd63f457e18a91572b5189e72c018b919cc.tar.gz
yuzu-e0de6dd63f457e18a91572b5189e72c018b919cc.tar.bz2
yuzu-e0de6dd63f457e18a91572b5189e72c018b919cc.tar.lz
yuzu-e0de6dd63f457e18a91572b5189e72c018b919cc.tar.xz
yuzu-e0de6dd63f457e18a91572b5189e72c018b919cc.tar.zst
yuzu-e0de6dd63f457e18a91572b5189e72c018b919cc.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/texture_cache/image_info.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/video_core/texture_cache/image_info.cpp b/src/video_core/texture_cache/image_info.cpp
index e8ddde691..b72788c6d 100644
--- a/src/video_core/texture_cache/image_info.cpp
+++ b/src/video_core/texture_cache/image_info.cpp
@@ -22,6 +22,9 @@ using Tegra::Texture::TICEntry;
using VideoCore::Surface::PixelFormat;
using VideoCore::Surface::SurfaceType;
+constexpr u32 RescaleHeightThreshold = 288;
+constexpr u32 DownscaleHeightThreshold = 512;
+
ImageInfo::ImageInfo(const TICEntry& config) noexcept {
forced_flushed = config.IsPitchLinear() && !Settings::values.use_reactive_flushing.GetValue();
dma_downloaded = forced_flushed;
@@ -113,8 +116,9 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept {
layer_stride = CalculateLayerStride(*this);
maybe_unaligned_layer_stride = CalculateLayerSize(*this);
rescaleable &= (block.depth == 0) && resources.levels == 1;
- rescaleable &= size.height > 256 || GetFormatType(format) != SurfaceType::ColorTexture;
- downscaleable = size.height > 512;
+ rescaleable &= size.height > RescaleHeightThreshold ||
+ GetFormatType(format) != SurfaceType::ColorTexture;
+ downscaleable = size.height > DownscaleHeightThreshold;
}
}
@@ -152,8 +156,8 @@ ImageInfo::ImageInfo(const Maxwell3D::Regs::RenderTargetConfig& ct,
size.depth = ct.depth;
} else {
rescaleable = block.depth == 0;
- rescaleable &= size.height > 256;
- downscaleable = size.height > 512;
+ rescaleable &= size.height > RescaleHeightThreshold;
+ downscaleable = size.height > DownscaleHeightThreshold;
type = ImageType::e2D;
resources.layers = ct.depth;
}
@@ -232,8 +236,8 @@ ImageInfo::ImageInfo(const Fermi2D::Surface& config) noexcept {
.height = config.height,
.depth = 1,
};
- rescaleable = block.depth == 0 && size.height > 256;
- downscaleable = size.height > 512;
+ rescaleable = block.depth == 0 && size.height > RescaleHeightThreshold;
+ downscaleable = size.height > DownscaleHeightThreshold;
}
}
@@ -275,8 +279,8 @@ ImageInfo::ImageInfo(const Tegra::DMA::ImageOperand& config) noexcept {
resources.layers = 1;
layer_stride = CalculateLayerStride(*this);
maybe_unaligned_layer_stride = CalculateLayerSize(*this);
- rescaleable = block.depth == 0 && size.height > 256;
- downscaleable = size.height > 512;
+ rescaleable = block.depth == 0 && size.height > RescaleHeightThreshold;
+ downscaleable = size.height > DownscaleHeightThreshold;
}
} // namespace VideoCommon