diff --git a/src/audio_core/in/audio_in_system.cpp b/src/audio_core/in/audio_in_system.cpp index b2dd3ef9f7..ac842f9e9e 100644 --- a/src/audio_core/in/audio_in_system.cpp +++ b/src/audio_core/in/audio_in_system.cpp @@ -11,6 +11,21 @@ #include "core/core_timing.h" #include "core/hle/kernel/k_event.h" +// See texture_cache/util.h +template +#if BOOST_VERSION >= 108100 || __GNUC__ > 12 +[[nodiscard]] boost::container::static_vector FixStaticVectorADL(const boost::container::static_vector& v) { + return v; +} +#else +[[nodiscard]] std::vector FixStaticVectorADL(const boost::container::static_vector& v) { + std::vector u; + for (auto const& e : v) + u.push_back(e); + return u; +} +#endif + namespace AudioCore::AudioIn { System::System(Core::System& system_, Kernel::KEvent* event_, const size_t session_id_) @@ -92,7 +107,7 @@ Result System::Start() { boost::container::static_vector buffers_to_flush{}; buffers.RegisterBuffers(buffers_to_flush); - session->AppendBuffers(buffers_to_flush); + session->AppendBuffers(FixStaticVectorADL(buffers_to_flush)); session->SetRingSize(static_cast(buffers_to_flush.size())); return ResultSuccess; @@ -137,7 +152,7 @@ void System::RegisterBuffers() { if (state == State::Started) { boost::container::static_vector registered_buffers{}; buffers.RegisterBuffers(registered_buffers); - session->AppendBuffers(registered_buffers); + session->AppendBuffers(FixStaticVectorADL(registered_buffers)); } } diff --git a/src/audio_core/out/audio_out_system.cpp b/src/audio_core/out/audio_out_system.cpp index 7b3ff4e881..0c01dc010f 100644 --- a/src/audio_core/out/audio_out_system.cpp +++ b/src/audio_core/out/audio_out_system.cpp @@ -11,6 +11,21 @@ #include "core/core_timing.h" #include "core/hle/kernel/k_event.h" +// See texture_cache/util.h +template +#if BOOST_VERSION >= 108100 || __GNUC__ > 12 +[[nodiscard]] boost::container::static_vector FixStaticVectorADL(const boost::container::static_vector& v) { + return v; +} +#else +[[nodiscard]] std::vector FixStaticVectorADL(const boost::container::static_vector& v) { + std::vector u; + for (auto const& e : v) + u.push_back(e); + return u; +} +#endif + namespace AudioCore::AudioOut { System::System(Core::System& system_, Kernel::KEvent* event_, size_t session_id_) @@ -91,7 +106,7 @@ Result System::Start() { boost::container::static_vector buffers_to_flush{}; buffers.RegisterBuffers(buffers_to_flush); - session->AppendBuffers(buffers_to_flush); + session->AppendBuffers(FixStaticVectorADL(buffers_to_flush)); session->SetRingSize(static_cast(buffers_to_flush.size())); return ResultSuccess; @@ -136,7 +151,7 @@ void System::RegisterBuffers() { if (state == State::Started) { boost::container::static_vector registered_buffers{}; buffers.RegisterBuffers(registered_buffers); - session->AppendBuffers(registered_buffers); + session->AppendBuffers(FixStaticVectorADL(registered_buffers)); } } diff --git a/src/video_core/texture_cache/util.h b/src/video_core/texture_cache/util.h index e46bcb65b6..3e8bb00032 100644 --- a/src/video_core/texture_cache/util.h +++ b/src/video_core/texture_cache/util.h @@ -127,6 +127,8 @@ void DeduceBlitImages(ImageInfo& dst_info, ImageInfo& src_info, const ImageBase* // for any given type of the static_vector/small_vector, etc which makes a whole mess // for anything using std::span so we just do this terrible hack on older versions of // GCC12 because people actually still use stable debian so... yeah +// One may say: "This is bad for performance" - to which I say, using GCC 12 you already know +// what kind of bs you will be dealing with anyways. template #if BOOST_VERSION >= 108100 || __GNUC__ > 12 [[nodiscard]] boost::container::small_vector FixSmallVectorADL(const boost::container::small_vector& v) {