From f15fe2015c9f7c2ef202cd35606dbbc99d71fb12 Mon Sep 17 00:00:00 2001 From: lizzie Date: Fri, 17 Oct 2025 22:09:26 +0000 Subject: [PATCH] [compat] Debian stable compilation fixes Signed-off-by: lizzie --- src/common/slot_vector.h | 3 +++ src/video_core/buffer_cache/buffer_cache.h | 2 +- src/video_core/dma_pusher.cpp | 2 +- src/video_core/memory_manager.cpp | 2 +- src/video_core/texture_cache/texture_cache.h | 17 +++++++---------- src/video_core/texture_cache/util.h | 18 ++++++++++++++++++ 6 files changed, 31 insertions(+), 13 deletions(-) diff --git a/src/common/slot_vector.h b/src/common/slot_vector.h index 01c65306c8..fd185ba3bd 100644 --- a/src/common/slot_vector.h +++ b/src/common/slot_vector.h @@ -32,7 +32,10 @@ struct SlotId { }; template +// TODO: More "stable" debian fixes... wohoo +#if __GNUC__ <= 12 requires std::is_nothrow_move_assignable_v && std::is_nothrow_move_constructible_v +#endif class SlotVector { public: class Iterator { diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 9eaa322c9c..1371446c69 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -1373,7 +1373,7 @@ void BufferCache

::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(); diff --git a/src/video_core/dma_pusher.cpp b/src/video_core/dma_pusher.cpp index a9bcd150e6..afcc9c52e2 100644 --- a/src/video_core/dma_pusher.cpp +++ b/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{ diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp index 94448fe0d7..a4f99d37ce 100644 --- a/src/video_core/memory_manager.cpp +++ b/src/video_core/memory_manager.cpp @@ -760,7 +760,7 @@ void MemoryManager::FlushCaching() { accumulator->Callback([this](GPUVAddr addr, size_t size) { GetSubmappedRangeImpl(addr, size, page_stash2); }); - rasterizer->InnerInvalidation(page_stash2); + rasterizer->InnerInvalidation(FixSmallVectorADL(page_stash2)); page_stash2.clear(); accumulator->Clear(); } diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index e5d559b591..24a3880599 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -866,8 +866,7 @@ void TextureCache

::PopAsyncFlushes() { download_buffer.offset -= Common::AlignUp(image.unswizzled_size_bytes, 64); std::span 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 download_span = @@ -915,8 +914,7 @@ void TextureCache

::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

::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 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

::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; } diff --git a/src/video_core/texture_cache/util.h b/src/video_core/texture_cache/util.h index 5a0649d243..ce4a9631e7 100644 --- a/src/video_core/texture_cache/util.h +++ b/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 +#if BOOST_VERSION >= 108200 +[[nodiscard]] boost::container::small_vector FixSmallVectorADL(const boost::container::small_vector&& v) { + return v; +} +#else +[[nodiscard]] std::vector FixSmallVectorADL(const boost::container::small_vector&& v) { + std::vector u; + for (auto const& e : v) + u.push_back(e); + return u; +} +#endif + } // namespace VideoCommon