Compare commits

...

9 Commits

Author SHA1 Message Date
Franco M
0e19217a47 Merge branch 'yuzu-emu:master' into master 2023-10-09 03:34:19 -03:00
boludoz
1c97b7e466 Merge branch 'yuzu-emu:master' into master 2023-09-29 18:53:16 -03:00
boludoz
9bb4c6ebe4 Variable names ok 2023-09-29 01:59:25 -03:00
boludoz
5d80c672c8 Fixed clang 2023-09-28 22:58:07 -03:00
boludoz
1f1c1338ee Merge branch 'yuzu-emu:master' into master 2023-09-28 22:55:31 -03:00
boludoz
6b4a5bb203 Second threshold for the specific case, works. 2023-09-28 02:22:26 -03:00
boludoz
2c0b135133 Commented problematic downscale 2023-09-28 01:55:02 -03:00
boludoz
55af477cc4 Test 2023-09-28 01:36:45 -03:00
boludoz
fdbbce1469 Fixed downscale glitches on Intel and Red Dead Redemption at downscale 2023-09-27 23:05:46 -03:00

View File

@@ -23,7 +23,8 @@ using VideoCore::Surface::PixelFormat;
using VideoCore::Surface::SurfaceType;
constexpr u32 RescaleHeightThreshold = 288;
constexpr u32 DownscaleHeightThreshold = 512;
constexpr u32 DownscaleHeightThresholdNormal = 128;
constexpr u32 DownscaleHeightThresholdArray = 1024;
ImageInfo::ImageInfo(const TICEntry& config) noexcept {
forced_flushed = config.IsPitchLinear() && !Settings::values.use_reactive_flushing.GetValue();
@@ -61,6 +62,7 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept {
resources.layers = config.Depth();
break;
case TextureType::Texture2D:
[[fallthrough]];
case TextureType::Texture2DNoMipmap:
ASSERT(config.Depth() == 1);
type = config.IsPitchLinear() ? ImageType::Linear : ImageType::e2D;
@@ -118,7 +120,7 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept {
rescaleable &= (block.depth == 0) && resources.levels == 1;
rescaleable &= size.height > RescaleHeightThreshold ||
GetFormatType(format) != SurfaceType::ColorTexture;
downscaleable = size.height > DownscaleHeightThreshold;
downscaleable = size.height > DownscaleHeightThresholdNormal;
}
}
@@ -155,9 +157,8 @@ ImageInfo::ImageInfo(const Maxwell3D::Regs::RenderTargetConfig& ct,
type = ImageType::e3D;
size.depth = ct.depth;
} else {
rescaleable = block.depth == 0;
rescaleable &= size.height > RescaleHeightThreshold;
downscaleable = size.height > DownscaleHeightThreshold;
rescaleable = block.depth == 0 && size.height > RescaleHeightThreshold;
downscaleable = size.height > DownscaleHeightThresholdNormal;
type = ImageType::e2D;
resources.layers = ct.depth;
}
@@ -193,15 +194,16 @@ ImageInfo::ImageInfo(const Maxwell3D::Regs::Zeta& zt, const Maxwell3D::Regs::Zet
size.depth = zt_size.depth;
} else {
rescaleable = block.depth == 0;
downscaleable = size.height > 512;
type = ImageType::e2D;
switch (zt_size.dim_control) {
case Maxwell3D::Regs::ZetaSize::DimensionControl::DefineArraySize:
if (zt_size.dim_control == Maxwell3D::Regs::ZetaSize::DimensionControl::DefineArraySize) {
resources.layers = zt_size.depth;
break;
case Maxwell3D::Regs::ZetaSize::DimensionControl::ArraySizeIsOne:
// TODO: Problematic downscaling here, check if it is possible add more "filters" for
// avoid bugs.
downscaleable = size.height > DownscaleHeightThresholdArray;
} else if (zt_size.dim_control ==
Maxwell3D::Regs::ZetaSize::DimensionControl::ArraySizeIsOne) {
resources.layers = 1;
break;
downscaleable = size.height > DownscaleHeightThresholdNormal;
}
}
}
@@ -237,7 +239,7 @@ ImageInfo::ImageInfo(const Fermi2D::Surface& config) noexcept {
.depth = 1,
};
rescaleable = block.depth == 0 && size.height > RescaleHeightThreshold;
downscaleable = size.height > DownscaleHeightThreshold;
downscaleable = size.height > DownscaleHeightThresholdNormal;
}
}
@@ -280,7 +282,7 @@ ImageInfo::ImageInfo(const Tegra::DMA::ImageOperand& config) noexcept {
layer_stride = CalculateLayerStride(*this);
maybe_unaligned_layer_stride = CalculateLayerSize(*this);
rescaleable = block.depth == 0 && size.height > RescaleHeightThreshold;
downscaleable = size.height > DownscaleHeightThreshold;
downscaleable = size.height > DownscaleHeightThresholdNormal;
}
} // namespace VideoCommon