From 80480fe3f70997d0520ef8bf38f5fe530c54f8e5 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Sun, 23 Apr 2023 03:58:16 +0200 Subject: Clang: format and ficx compile errors. --- src/video_core/buffer_cache/buffer_base.h | 26 +++---- src/video_core/buffer_cache/buffer_cache.h | 4 +- src/video_core/buffer_cache/buffer_cache_base.h | 32 ++++----- src/video_core/buffer_cache/memory_tracker_base.h | 82 +++++++++++++---------- src/video_core/renderer_vulkan/vk_buffer_cache.h | 2 +- 5 files changed, 78 insertions(+), 68 deletions(-) (limited to 'src/video_core') diff --git a/src/video_core/buffer_cache/buffer_base.h b/src/video_core/buffer_cache/buffer_base.h index 66d8bb43c..095f79387 100644 --- a/src/video_core/buffer_cache/buffer_base.h +++ b/src/video_core/buffer_cache/buffer_base.h @@ -55,53 +55,53 @@ public: [[nodiscard]] std::pair ModifiedCpuRegion(VAddr query_cpu_addr, u64 query_size) const noexcept { const u64 offset = query_cpu_addr - cpu_addr; - return word_manager.ModifiedRegion(offset, query_size); + return word_manager.template ModifiedRegion(offset, query_size); } /// Returns the inclusive GPU modified range in a begin end pair [[nodiscard]] std::pair ModifiedGpuRegion(VAddr query_cpu_addr, u64 query_size) const noexcept { const u64 offset = query_cpu_addr - cpu_addr; - return word_manager.ModifiedRegion(offset, query_size); + return word_manager.template ModifiedRegion(offset, query_size); } /// Returns true if a region has been modified from the CPU [[nodiscard]] bool IsRegionCpuModified(VAddr query_cpu_addr, u64 query_size) const noexcept { const u64 offset = query_cpu_addr - cpu_addr; - return word_manager.IsRegionModified(offset, query_size); + return word_manager.template IsRegionModified(offset, query_size); } /// Returns true if a region has been modified from the GPU [[nodiscard]] bool IsRegionGpuModified(VAddr query_cpu_addr, u64 query_size) const noexcept { const u64 offset = query_cpu_addr - cpu_addr; - return word_manager.IsRegionModified(offset, query_size); + return word_manager.template IsRegionModified(offset, query_size); } /// Mark region as CPU modified, notifying the rasterizer about this change void MarkRegionAsCpuModified(VAddr dirty_cpu_addr, u64 size) { - word_manager.ChangeRegionState(dirty_cpu_addr, size); + word_manager.template ChangeRegionState(dirty_cpu_addr, size); } /// Unmark region as CPU modified, notifying the rasterizer about this change void UnmarkRegionAsCpuModified(VAddr dirty_cpu_addr, u64 size) { - word_manager.ChangeRegionState(dirty_cpu_addr, size); + word_manager.template ChangeRegionState(dirty_cpu_addr, size); } /// Mark region as modified from the host GPU void MarkRegionAsGpuModified(VAddr dirty_cpu_addr, u64 size) noexcept { - word_manager.ChangeRegionState(dirty_cpu_addr, size); + word_manager.template ChangeRegionState(dirty_cpu_addr, size); } /// Unmark region as modified from the host GPU void UnmarkRegionAsGpuModified(VAddr dirty_cpu_addr, u64 size) noexcept { - word_manager.ChangeRegionState(dirty_cpu_addr, size); + word_manager.template ChangeRegionState(dirty_cpu_addr, size); } /// Mark region as modified from the CPU /// but don't mark it as modified until FlusHCachedWrites is called. void CachedCpuWrite(VAddr dirty_cpu_addr, u64 size) { flags |= BufferFlagBits::CachedWrites; - word_manager.ChangeRegionState(dirty_cpu_addr, size); + word_manager.template ChangeRegionState(dirty_cpu_addr, size); } /// Flushes cached CPU writes, and notify the rasterizer about the deltas @@ -113,24 +113,24 @@ public: /// Call 'func' for each CPU modified range and unmark those pages as CPU modified template void ForEachUploadRange(VAddr query_cpu_range, u64 size, Func&& func) { - word_manager.ForEachModifiedRange(query_cpu_range, size, true, func); + word_manager.template ForEachModifiedRange(query_cpu_range, size, true, func); } /// Call 'func' for each GPU modified range and unmark those pages as GPU modified template void ForEachDownloadRange(VAddr query_cpu_range, u64 size, bool clear, Func&& func) { - word_manager.ForEachModifiedRange(query_cpu_range, size, clear, func); + word_manager.template ForEachModifiedRange(query_cpu_range, size, clear, func); } template void ForEachDownloadRangeAndClear(VAddr query_cpu_range, u64 size, Func&& func) { - word_manager.ForEachModifiedRange(query_cpu_range, size, true, func); + word_manager.template ForEachModifiedRange(query_cpu_range, size, true, func); } /// Call 'func' for each GPU modified range and unmark those pages as GPU modified template void ForEachDownloadRange(Func&& func) { - word_manager.ForEachModifiedRange(cpu_addr, SizeBytes(), true, func); + word_manager.template ForEachModifiedRange(cpu_addr, SizeBytes(), true, func); } /// Mark buffer as picked diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index faa48a678..8fed08dab 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -1395,10 +1395,10 @@ bool BufferCache

::SynchronizeBufferNoModified(Buffer& buffer, VAddr cpu_addr, auto make_copies = [&] { for (auto& interval : found_sets) { const std::size_t sub_size = interval.upper() - interval.lower(); - const VAddr cpu_addr = interval.lower(); + const VAddr cpu_addr_ = interval.lower(); copies.push_back(BufferCopy{ .src_offset = total_size_bytes, - .dst_offset = cpu_addr - buffer.CpuAddr(), + .dst_offset = cpu_addr_ - buffer.CpuAddr(), .size = sub_size, }); total_size_bytes += sub_size; diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h index d4914a8f5..acff22d4f 100644 --- a/src/video_core/buffer_cache/buffer_cache_base.h +++ b/src/video_core/buffer_cache/buffer_cache_base.h @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -16,10 +17,13 @@ #define BOOST_NO_MT #include #undef BOOST_NO_MT +#include +#include #include #include #include #include +#include #include "common/common_types.h" #include "common/div_ceil.h" @@ -42,7 +46,6 @@ #include "video_core/texture_cache/slot_vector.h" #include "video_core/texture_cache/types.h" - namespace boost { template class fast_pool_allocator; @@ -116,11 +119,10 @@ class BufferCache : public VideoCommon::ChannelSetupCaches; + using IntervalCompare = std::less; + using IntervalInstance = boost::icl::interval_type_default; + using IntervalAllocator = boost::fast_pool_allocator; + using IntervalSet = boost::icl::interval_set; using IntervalType = typename IntervalSet::interval_type; template @@ -141,12 +143,9 @@ class BufferCache : public VideoCommon::ChannelSetupCaches; + using OverlapCombine = counter_add_functor; + using OverlapSection = boost::icl::inter_section; + using OverlapCounter = boost::icl::split_interval_map; struct Empty {}; @@ -262,7 +261,8 @@ public: /// Return true when a CPU region is modified from the CPU [[nodiscard]] bool IsRegionCpuModified(VAddr addr, size_t size); - void SetDrawIndirect(const Tegra::Engines::DrawManager::IndirectParams* current_draw_indirect_) { + void SetDrawIndirect( + const Tegra::Engines::DrawManager::IndirectParams* current_draw_indirect_) { current_draw_indirect = current_draw_indirect_; } @@ -349,7 +349,8 @@ private: } } - void RemoveEachInOverlapCounter(OverlapCounter& current_range, const IntervalType search_interval, int subtract_value) { + void RemoveEachInOverlapCounter(OverlapCounter& current_range, + const IntervalType search_interval, int subtract_value) { bool any_removals = false; current_range.add(std::make_pair(search_interval, subtract_value)); do { @@ -469,7 +470,8 @@ private: void NotifyBufferDeletion(); - [[nodiscard]] Binding StorageBufferBinding(GPUVAddr ssbo_addr, u32 cbuf_index, bool is_written) const; + [[nodiscard]] Binding StorageBufferBinding(GPUVAddr ssbo_addr, u32 cbuf_index, + bool is_written) const; [[nodiscard]] TextureBufferBinding GetTextureBufferBinding(GPUVAddr gpu_addr, u32 size, PixelFormat format); diff --git a/src/video_core/buffer_cache/memory_tracker_base.h b/src/video_core/buffer_cache/memory_tracker_base.h index 93bd779c9..016d8430f 100644 --- a/src/video_core/buffer_cache/memory_tracker_base.h +++ b/src/video_core/buffer_cache/memory_tracker_base.h @@ -35,67 +35,71 @@ public: /// Returns the inclusive CPU modified range in a begin end pair [[nodiscard]] std::pair ModifiedCpuRegion(VAddr query_cpu_addr, u64 query_size) noexcept { - return IteratePairs(query_cpu_addr, query_size, - [](Manager* manager, u64 offset, size_t size) { - return manager->ModifiedRegion(offset, size); - }); + return IteratePairs( + query_cpu_addr, query_size, [](Manager* manager, u64 offset, size_t size) { + return manager->template ModifiedRegion(offset, size); + }); } /// Returns the inclusive GPU modified range in a begin end pair [[nodiscard]] std::pair ModifiedGpuRegion(VAddr query_cpu_addr, u64 query_size) noexcept { - return IteratePairs(query_cpu_addr, query_size, - [](Manager* manager, u64 offset, size_t size) { - return manager->ModifiedRegion(offset, size); - }); + return IteratePairs( + query_cpu_addr, query_size, [](Manager* manager, u64 offset, size_t size) { + return manager->template ModifiedRegion(offset, size); + }); } /// Returns true if a region has been modified from the CPU [[nodiscard]] bool IsRegionCpuModified(VAddr query_cpu_addr, u64 query_size) noexcept { - return IteratePages(query_cpu_addr, query_size, - [](Manager* manager, u64 offset, size_t size) { - return manager->IsRegionModified(offset, size); - }); + return IteratePages( + query_cpu_addr, query_size, [](Manager* manager, u64 offset, size_t size) { + return manager->template IsRegionModified(offset, size); + }); } /// Returns true if a region has been modified from the GPU [[nodiscard]] bool IsRegionGpuModified(VAddr query_cpu_addr, u64 query_size) noexcept { - return IteratePages(query_cpu_addr, query_size, - [](Manager* manager, u64 offset, size_t size) { - return manager->IsRegionModified(offset, size); - }); + return IteratePages( + query_cpu_addr, query_size, [](Manager* manager, u64 offset, size_t size) { + return manager->template IsRegionModified(offset, size); + }); } /// Mark region as CPU modified, notifying the rasterizer about this change void MarkRegionAsCpuModified(VAddr dirty_cpu_addr, u64 query_size) { - IteratePages( - dirty_cpu_addr, query_size, [](Manager* manager, u64 offset, size_t size) { - manager->ChangeRegionState(manager->GetCpuAddr() + offset, size); - }); + IteratePages(dirty_cpu_addr, query_size, + [](Manager* manager, u64 offset, size_t size) { + manager->template ChangeRegionState( + manager->GetCpuAddr() + offset, size); + }); } /// Unmark region as CPU modified, notifying the rasterizer about this change void UnmarkRegionAsCpuModified(VAddr dirty_cpu_addr, u64 query_size) { - IteratePages( - dirty_cpu_addr, query_size, [](Manager* manager, u64 offset, size_t size) { - manager->ChangeRegionState(manager->GetCpuAddr() + offset, size); - }); + IteratePages(dirty_cpu_addr, query_size, + [](Manager* manager, u64 offset, size_t size) { + manager->template ChangeRegionState( + manager->GetCpuAddr() + offset, size); + }); } /// Mark region as modified from the host GPU void MarkRegionAsGpuModified(VAddr dirty_cpu_addr, u64 query_size) noexcept { - IteratePages( - dirty_cpu_addr, query_size, [](Manager* manager, u64 offset, size_t size) { - manager->ChangeRegionState(manager->GetCpuAddr() + offset, size); - }); + IteratePages(dirty_cpu_addr, query_size, + [](Manager* manager, u64 offset, size_t size) { + manager->template ChangeRegionState( + manager->GetCpuAddr() + offset, size); + }); } /// Unmark region as modified from the host GPU void UnmarkRegionAsGpuModified(VAddr dirty_cpu_addr, u64 query_size) noexcept { - IteratePages( - dirty_cpu_addr, query_size, [](Manager* manager, u64 offset, size_t size) { - manager->ChangeRegionState(manager->GetCpuAddr() + offset, size); - }); + IteratePages(dirty_cpu_addr, query_size, + [](Manager* manager, u64 offset, size_t size) { + manager->template ChangeRegionState( + manager->GetCpuAddr() + offset, size); + }); } /// Mark region as modified from the CPU @@ -104,7 +108,7 @@ public: IteratePages( dirty_cpu_addr, query_size, [this](Manager* manager, u64 offset, size_t size) { const VAddr cpu_address = manager->GetCpuAddr() + offset; - manager->ChangeRegionState(cpu_address, size); + manager->template ChangeRegionState(cpu_address, size); cached_pages.insert(static_cast(cpu_address >> HIGHER_PAGE_BITS)); }); } @@ -128,7 +132,7 @@ public: void ForEachUploadRange(VAddr query_cpu_range, u64 query_size, Func&& func) { IteratePages(query_cpu_range, query_size, [&func](Manager* manager, u64 offset, size_t size) { - manager->ForEachModifiedRange( + manager->template ForEachModifiedRange( manager->GetCpuAddr() + offset, size, true, func); }); } @@ -138,7 +142,7 @@ public: void ForEachDownloadRange(VAddr query_cpu_range, u64 query_size, bool clear, Func&& func) { IteratePages(query_cpu_range, query_size, [&func, clear](Manager* manager, u64 offset, size_t size) { - manager->ForEachModifiedRange( + manager->template ForEachModifiedRange( manager->GetCpuAddr() + offset, size, clear, func); }); } @@ -147,7 +151,7 @@ public: void ForEachDownloadRangeAndClear(VAddr query_cpu_range, u64 query_size, Func&& func) { IteratePages(query_cpu_range, query_size, [&func](Manager* manager, u64 offset, size_t size) { - manager->ForEachModifiedRange( + manager->template ForEachModifiedRange( manager->GetCpuAddr() + offset, size, true, func); }); } @@ -218,7 +222,11 @@ private: page_offset = 0; remaining_size -= copy_amount; } - return begin < end ? std::make_pair(begin, end) : std::make_pair(0ULL, 0ULL); + if (begin < end) { + return std::make_pair(begin, end); + } else { + return std::make_pair(0ULL, 0ULL); + } } void CreateRegion(std::size_t page_index) { diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h index 05968e6a6..879f1ed94 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.h +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h @@ -3,7 +3,7 @@ #pragma once -#include "video_core/buffer_cache/buffer_cache.h" +#include "video_core/buffer_cache/buffer_cache_base.h" #include "video_core/buffer_cache/memory_tracker_base.h" #include "video_core/engines/maxwell_3d.h" #include "video_core/renderer_vulkan/vk_compute_pass.h" -- cgit v1.2.3