Browse Source

[compat] Debian stable compilation fixes

Signed-off-by: lizzie <lizzie@eden-emu.dev>
pull/2763/head
lizzie 5 months ago
parent
commit
f15fe2015c
No known key found for this signature in database GPG Key ID: 287378CADCAB13
  1. 3
      src/common/slot_vector.h
  2. 2
      src/video_core/buffer_cache/buffer_cache.h
  3. 2
      src/video_core/dma_pusher.cpp
  4. 2
      src/video_core/memory_manager.cpp
  5. 17
      src/video_core/texture_cache/texture_cache.h
  6. 18
      src/video_core/texture_cache/util.h

3
src/common/slot_vector.h

@ -32,7 +32,10 @@ struct SlotId {
};
template <class T>
// TODO: More "stable" debian fixes... wohoo
#if __GNUC__ <= 12
requires std::is_nothrow_move_assignable_v<T> && std::is_nothrow_move_constructible_v<T>
#endif
class SlotVector {
public:
class Iterator {

2
src/video_core/buffer_cache/buffer_cache.h

@ -1373,7 +1373,7 @@ void BufferCache<P>::JoinOverlap(BufferId new_buffer_id, BufferId overlap_id,
.size = overlap.SizeBytes(),
});
new_buffer.MarkUsage(copies[0].dst_offset, copies[0].size);
runtime.CopyBuffer(new_buffer, overlap, copies, true);
runtime.CopyBuffer(new_buffer, overlap, FixSmallVectorADL(copies), true);
#ifdef YUZU_LEGACY
if (immediately_free)
runtime.Finish();

2
src/video_core/dma_pusher.cpp

@ -59,7 +59,7 @@ bool DmaPusher::Step() {
if (command_list.prefetch_command_list.size()) {
// Prefetched command list from nvdrv, used for things like synchronization
ProcessCommands(command_list.prefetch_command_list);
ProcessCommands(FixSmallVectorADL(command_list.prefetch_command_list));
dma_pushbuffer.pop();
} else {
const CommandListHeader command_list_header{

2
src/video_core/memory_manager.cpp

@ -760,7 +760,7 @@ void MemoryManager::FlushCaching() {
accumulator->Callback([this](GPUVAddr addr, size_t size) {
GetSubmappedRangeImpl<false>(addr, size, page_stash2);
});
rasterizer->InnerInvalidation(page_stash2);
rasterizer->InnerInvalidation(FixSmallVectorADL(page_stash2));
page_stash2.clear();
accumulator->Clear();
}

17
src/video_core/texture_cache/texture_cache.h

@ -866,8 +866,7 @@ void TextureCache<P>::PopAsyncFlushes() {
download_buffer.offset -= Common::AlignUp(image.unswizzled_size_bytes, 64);
std::span<u8> download_span =
download_buffer.mapped_span.subspan(download_buffer.offset);
SwizzleImage(*gpu_memory, image.gpu_addr, image.info, copies, download_span,
swizzle_data_buffer);
SwizzleImage(*gpu_memory, image.gpu_addr, image.info, FixSmallVectorADL(copies), download_span, swizzle_data_buffer);
} else {
const BufferDownload& buffer_info = slot_buffer_downloads[download_info.object_id];
std::span<u8> download_span =
@ -915,8 +914,7 @@ void TextureCache<P>::PopAsyncFlushes() {
}
const ImageBase& image = slot_images[download_info.object_id];
const auto copies = FullDownloadCopies(image.info);
SwizzleImage(*gpu_memory, image.gpu_addr, image.info, copies, download_span,
swizzle_data_buffer);
SwizzleImage(*gpu_memory, image.gpu_addr, image.info, FixSmallVectorADL(copies), download_span, swizzle_data_buffer);
download_map.offset += image.unswizzled_size_bytes;
download_span = download_span.subspan(image.unswizzled_size_bytes);
}
@ -1082,23 +1080,22 @@ void TextureCache<P>::UploadImageContents(Image& image, StagingBuffer& staging)
gpu_memory->ReadBlock(gpu_addr, mapped_span.data(), mapped_span.size_bytes(),
VideoCommon::CacheType::NoTextureCache);
const auto uploads = FullUploadSwizzles(image.info);
runtime.AccelerateImageUpload(image, staging, uploads);
runtime.AccelerateImageUpload(image, staging, FixSmallVectorADL(uploads));
return;
}
Tegra::Memory::GpuGuestMemory<u8, Tegra::Memory::GuestMemoryFlags::UnsafeRead> swizzle_data(
*gpu_memory, gpu_addr, image.guest_size_bytes, &swizzle_data_buffer);
if (True(image.flags & ImageFlagBits::Converted)) {
unswizzle_data_buffer.resize_destructive(image.unswizzled_size_bytes);
auto copies =
UnswizzleImage(*gpu_memory, gpu_addr, image.info, swizzle_data, unswizzle_data_buffer);
ConvertImage(unswizzle_data_buffer, image.info, mapped_span, copies);
image.UploadMemory(staging, copies);
image.UploadMemory(staging, FixSmallVectorADL(copies));
} else {
const auto copies =
UnswizzleImage(*gpu_memory, gpu_addr, image.info, swizzle_data, mapped_span);
image.UploadMemory(staging, copies);
image.UploadMemory(staging, FixSmallVectorADL(copies));
}
}
@ -1576,9 +1573,9 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, DA
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));
runtime.CopyImageMSAA(new_image, overlap, FixSmallVectorADL(copies));
} else {
runtime.CopyImage(new_image, overlap, std::move(copies));
runtime.CopyImage(new_image, overlap, FixSmallVectorADL(copies));
}
new_image.modification_tick = overlap.modification_tick;
}

18
src/video_core/texture_cache/util.h

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@ -119,4 +122,19 @@ void DeduceBlitImages(ImageInfo& dst_info, ImageInfo& src_info, const ImageBase*
[[nodiscard]] u32 MapSizeBytes(const ImageBase& image);
// TODO: Remove once Debian STABLE no longer has such outdated boost
template<typename T, size_t N>
#if BOOST_VERSION >= 108200
[[nodiscard]] boost::container::small_vector<T, N> FixSmallVectorADL(const boost::container::small_vector<T, N>&& v) {
return v;
}
#else
[[nodiscard]] std::vector<T> FixSmallVectorADL(const boost::container::small_vector<T, N>&& v) {
std::vector<T> u;
for (auto const& e : v)
u.push_back(e);
return u;
}
#endif
} // namespace VideoCommon
Loading…
Cancel
Save