early-access version 3437

main
pineappleEA 2023-03-05 17:19:00 +01:00
parent ad5e9aec42
commit 1d866e0d61
7 changed files with 23 additions and 21 deletions

View File

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 3436. This is the source code for early-access 3437.
## Legal Notice ## Legal Notice

View File

@ -1,6 +1,8 @@
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <chrono> #include <chrono>
#include "common/common_types.h" #include "common/common_types.h"

View File

@ -15,9 +15,8 @@ namespace Common {
class StandardWallClock final : public WallClock { class StandardWallClock final : public WallClock {
public: public:
explicit StandardWallClock(u64 emulated_cpu_frequency_, u64 emulated_clock_frequency_) explicit StandardWallClock(u64 emulated_cpu_frequency_, u64 emulated_clock_frequency_)
: WallClock{emulated_cpu_frequency_, emulated_clock_frequency_, false} { : WallClock{emulated_cpu_frequency_, emulated_clock_frequency_, false},
start_time = SteadyClock::Now(); start_time{SteadyClock::Now()} {}
}
std::chrono::nanoseconds GetTimeNS() override { std::chrono::nanoseconds GetTimeNS() override {
return SteadyClock::Now() - start_time; return SteadyClock::Now() - start_time;

View File

@ -1,6 +1,8 @@
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <chrono> #include <chrono>
namespace Common::Windows { namespace Common::Windows {

View File

@ -787,7 +787,7 @@ bool AccelerateDMA::ImageToBuffer(const Tegra::DMA::ImageCopy& copy_info,
const bool is_rescaled = image->IsRescaled(); const bool is_rescaled = image->IsRescaled();
if (is_rescaled) { if (is_rescaled) {
image->ScaleDown(true); image->ScaleDown();
} }
VkImageSubresourceLayers subresources{ VkImageSubresourceLayers subresources{
.aspectMask = image->AspectMask(), .aspectMask = image->AspectMask(),
@ -879,6 +879,9 @@ bool AccelerateDMA::ImageToBuffer(const Tegra::DMA::ImageCopy& copy_info,
cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
0, WRITE_BARRIER, nullptr, post_barriers); 0, WRITE_BARRIER, nullptr, post_barriers);
}); });
if (is_rescaled) {
image->ScaleUp(true);
}
return true; return true;
} }
@ -989,6 +992,9 @@ bool AccelerateDMA::BufferToImage(const Tegra::DMA::ImageCopy& copy_info,
cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
0, nullptr, nullptr, post_barriers); 0, nullptr, nullptr, post_barriers);
}); });
if (is_rescaled) {
image->ScaleUp();
}
return true; return true;
} }

View File

@ -216,8 +216,7 @@ ImageInfo::ImageInfo(const Tegra::Engines::Fermi2D::Surface& config) noexcept {
.height = config.height, .height = config.height,
.depth = 1, .depth = 1,
}; };
rescaleable = block.depth == 0; rescaleable = block.depth == 0 && size.height > 256;
rescaleable &= size.height > 256;
downscaleable = size.height > 512; downscaleable = size.height > 512;
} }
} }
@ -260,8 +259,7 @@ ImageInfo::ImageInfo(const Tegra::DMA::ImageOperand& config) noexcept {
resources.layers = 1; resources.layers = 1;
layer_stride = CalculateLayerStride(*this); layer_stride = CalculateLayerStride(*this);
maybe_unaligned_layer_stride = CalculateLayerSize(*this); maybe_unaligned_layer_stride = CalculateLayerSize(*this);
rescaleable = block.depth == 0; rescaleable = block.depth == 0 && size.height > 256;
rescaleable &= size.height > 256;
downscaleable = size.height > 512; downscaleable = size.height > 512;
} }

View File

@ -1125,10 +1125,9 @@ std::optional<SubresourceBase> FindSubresource(const ImageInfo& candidate, const
// Format checking is relaxed, but we still have to check for matching bytes per block. // Format checking is relaxed, but we still have to check for matching bytes per block.
// This avoids creating a view for blits on UE4 titles where formats with different bytes // This avoids creating a view for blits on UE4 titles where formats with different bytes
// per block are aliased. // per block are aliased.
if (BytesPerBlock(existing.format) != BytesPerBlock(candidate.format)) { if (BytesPerBlock(existing.format) != BytesPerBlock(candidate.format) &&
if (False(options & RelaxedOptions::FormatBpp)) { False(options & RelaxedOptions::FormatBpp)) {
return std::nullopt; return std::nullopt;
}
} }
} else { } else {
// Format comaptibility is not relaxed, ensure we are creating a view on a compatible format // Format comaptibility is not relaxed, ensure we are creating a view on a compatible format
@ -1142,10 +1141,8 @@ std::optional<SubresourceBase> FindSubresource(const ImageInfo& candidate, const
if (existing.type != candidate.type) { if (existing.type != candidate.type) {
return std::nullopt; return std::nullopt;
} }
if (False(options & RelaxedOptions::Samples)) { if (False(options & RelaxedOptions::Samples) && existing.num_samples != candidate.num_samples) {
if (existing.num_samples != candidate.num_samples) { return std::nullopt;
return std::nullopt;
}
} }
if (existing.resources.levels < candidate.resources.levels + base->level) { if (existing.resources.levels < candidate.resources.levels + base->level) {
return std::nullopt; return std::nullopt;
@ -1155,10 +1152,8 @@ std::optional<SubresourceBase> FindSubresource(const ImageInfo& candidate, const
if (mip_depth < candidate.size.depth + base->layer) { if (mip_depth < candidate.size.depth + base->layer) {
return std::nullopt; return std::nullopt;
} }
} else { } else if (existing.resources.layers < candidate.resources.layers + base->layer) {
if (existing.resources.layers < candidate.resources.layers + base->layer) { return std::nullopt;
return std::nullopt;
}
} }
const bool strict_size = False(options & RelaxedOptions::Size); const bool strict_size = False(options & RelaxedOptions::Size);
if (!IsBlockLinearSizeCompatible(existing, candidate, base->level, 0, strict_size)) { if (!IsBlockLinearSizeCompatible(existing, candidate, base->level, 0, strict_size)) {