early-access version 3915

This commit is contained in:
pineappleEA 2023-10-08 19:39:13 +02:00
parent 9238ae5660
commit ea1c1d9b88
6 changed files with 10 additions and 70 deletions

View File

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

View File

@ -546,11 +546,13 @@ void IGeneralService::IsAnyInternetRequestAccepted(HLERequestContext& ctx) {
}
void IGeneralService::IsAnyForegroundRequestAccepted(HLERequestContext& ctx) {
LOG_ERROR(Service_NIFM, "(STUBBED) called");
const bool is_accepted{};
LOG_WARNING(Service_NIFM, "(STUBBED) called, is_accepted={}", is_accepted);
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(ResultSuccess);
rb.Push<u8>(0);
rb.Push<u8>(is_accepted);
}
IGeneralService::IGeneralService(Core::System& system_)

View File

@ -138,6 +138,8 @@ PixelFormat PixelFormatFromTextureInfo(TextureFormat format, ComponentType red,
return PixelFormat::E5B9G9R9_FLOAT;
case Hash(TextureFormat::Z32, FLOAT):
return PixelFormat::D32_FLOAT;
case Hash(TextureFormat::Z32, FLOAT, UINT, UINT, UINT, LINEAR):
return PixelFormat::D32_FLOAT;
case Hash(TextureFormat::Z16, UNORM):
return PixelFormat::D16_UNORM;
case Hash(TextureFormat::Z16, UNORM, UINT, UINT, UINT, LINEAR):

View File

@ -1357,8 +1357,6 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, VA
join_bad_overlap_ids.clear();
join_copies_to_do.clear();
join_alias_indices.clear();
boost::container::small_vector<ImageId, 8> merge_mips;
ImageId merge_with_existing_id{};
const bool this_is_linear = info.type == ImageType::Linear;
const auto region_check = [&](ImageId overlap_id, ImageBase& overlap) {
if (True(overlap.flags & ImageFlagBits::Remapped)) {
@ -1399,12 +1397,6 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, VA
join_right_aliased_ids.push_back(overlap_id);
overlap.flags |= ImageFlagBits::Alias;
join_copies_to_do.emplace_back(JoinCopy{true, overlap_id});
} else if (IsSubLevel(new_image_base, overlap)) {
if (new_image_base.info.resources.levels > overlap.info.resources.levels) {
merge_mips.push_back(overlap_id);
} else {
merge_with_existing_id = overlap_id;
}
} else {
join_bad_overlap_ids.push_back(overlap_id);
}
@ -1447,10 +1439,6 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, VA
}
}
if (merge_with_existing_id) {
return merge_with_existing_id;
}
const ImageId new_image_id = slot_images.insert(runtime, new_info, gpu_addr, cpu_addr);
Image& new_image = slot_images[new_image_id];
@ -1479,32 +1467,6 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, VA
ScaleDown(new_image);
}
const auto& resolution = Settings::values.resolution_info;
const u32 up_scale = can_rescale ? resolution.up_scale : 1;
const u32 down_shift = can_rescale ? resolution.down_shift : 0;
for (auto overlap_id : merge_mips) {
auto& overlap = slot_images[overlap_id];
if (True(overlap.flags & ImageFlagBits::GpuModified)) {
new_image.flags |= ImageFlagBits::GpuModified;
new_image.modification_tick = overlap.modification_tick;
const SubresourceBase base = new_image.TryFindBase(overlap.gpu_addr).value();
auto copies =
MakeShrinkImageCopies(new_image.info, overlap.info, base, up_scale, down_shift);
if (new_image.info.num_samples != overlap.info.num_samples) {
runtime.CopyImageMSAA(new_image, overlap, std::move(copies));
} else {
runtime.CopyImage(new_image, overlap, std::move(copies));
}
}
if (True(overlap.flags & ImageFlagBits::Tracked)) {
UntrackImage(overlap, overlap_id);
}
UnregisterImage(overlap_id);
DeleteImage(overlap_id);
}
std::ranges::sort(join_copies_to_do, [this](const JoinCopy& lhs, const JoinCopy& rhs) {
const ImageBase& lhs_image = slot_images[lhs.id];
const ImageBase& rhs_image = slot_images[rhs.id];
@ -1561,7 +1523,10 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, VA
}
if (True(overlap.flags & ImageFlagBits::GpuModified)) {
new_image.flags |= ImageFlagBits::GpuModified;
const auto& resolution = Settings::values.resolution_info;
const SubresourceBase base = new_image.TryFindBase(overlap.gpu_addr).value();
const u32 up_scale = can_rescale ? resolution.up_scale : 1;
const u32 down_shift = can_rescale ? resolution.down_shift : 0;
auto copies = MakeShrinkImageCopies(new_info, overlap.info, base, up_scale, down_shift);
if (overlap.info.num_samples != new_image.info.num_samples) {
runtime.CopyImageMSAA(new_image, overlap, std::move(copies));

View File

@ -1233,33 +1233,6 @@ bool IsSubresource(const ImageInfo& candidate, const ImageBase& image, GPUVAddr
.has_value();
}
bool IsSubLevel(const ImageBase& image, const ImageBase& overlap) {
const std::optional<SubresourceBase> base = image.TryFindBase(overlap.gpu_addr);
if (!base) {
return false;
}
if (!IsViewCompatible(image.info.format, overlap.info.format, false, true)) {
return false;
}
if (AdjustMipSize(image.info.size, base->level) != overlap.info.size) {
return false;
}
const auto level_info = MakeLevelInfo(image.info);
auto level_sizes = CalculateLevelSizes(level_info, image.info.resources.levels);
auto total_size{0};
auto level = base->level;
while (level) {
total_size += level_sizes[level - 1];
level--;
}
if (overlap.gpu_addr - total_size != image.gpu_addr) {
return false;
}
return true;
}
bool IsSubCopy(const ImageInfo& candidate, const ImageBase& image, GPUVAddr candidate_addr) {
const std::optional<SubresourceBase> base = image.TryFindBase(candidate_addr);
if (!base) {

View File

@ -111,8 +111,6 @@ void SwizzleImage(Tegra::MemoryManager& gpu_memory, GPUVAddr gpu_addr, const Ima
GPUVAddr candidate_addr, RelaxedOptions options, bool broken_views,
bool native_bgr);
[[nodiscard]] bool IsSubLevel(const ImageBase& image, const ImageBase& overlap);
[[nodiscard]] bool IsSubCopy(const ImageInfo& candidate, const ImageBase& image,
GPUVAddr candidate_addr);