From c92de420efbe527c32831f8a11d14af14d7412d4 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Thu, 2 Feb 2023 04:56:08 +0100 Subject: [PATCH] lint: update to clang-format-13 --- .../VideoBackends/Metal/MTLObjectCache.mm | 4 +-- .../VideoBackends/Metal/MTLStateTracker.mm | 29 ++++++++++--------- Tools/lint.sh | 2 +- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Source/Core/VideoBackends/Metal/MTLObjectCache.mm b/Source/Core/VideoBackends/Metal/MTLObjectCache.mm index 979c1b7627..593e71ed52 100644 --- a/Source/Core/VideoBackends/Metal/MTLObjectCache.mm +++ b/Source/Core/VideoBackends/Metal/MTLObjectCache.mm @@ -91,8 +91,8 @@ static const char* to_string(MTLCompareFunction compare) // clang-format on -static void SetupDepthStencil( - MRCOwned> (&dss)[Metal::DepthStencilSelector::N_VALUES]) +static void +SetupDepthStencil(MRCOwned> (&dss)[Metal::DepthStencilSelector::N_VALUES]) { auto desc = MRCTransfer([MTLDepthStencilDescriptor new]); Metal::DepthStencilSelector sel; diff --git a/Source/Core/VideoBackends/Metal/MTLStateTracker.mm b/Source/Core/VideoBackends/Metal/MTLStateTracker.mm index 4e24cd737d..53462b9bdf 100644 --- a/Source/Core/VideoBackends/Metal/MTLStateTracker.mm +++ b/Source/Core/VideoBackends/Metal/MTLStateTracker.mm @@ -434,22 +434,23 @@ void Metal::StateTracker::FlushEncoders() m_texture_upload_cmdbuf = nullptr; } [m_current_render_cmdbuf - addCompletedHandler:[backref = m_backref, draw = m_current_draw, - q = std::move(m_current_perf_query)](id buf) { - std::lock_guard guard(backref->mtx); - if (StateTracker* tracker = backref->state_tracker) - { - // We can do the update non-atomically because we only ever update under the lock - u64 newval = std::max(draw, tracker->m_last_finished_draw.load(std::memory_order_relaxed)); - tracker->m_last_finished_draw.store(newval, std::memory_order_release); - if (q) + addCompletedHandler:[backref = m_backref, draw = m_current_draw, + q = std::move(m_current_perf_query)](id buf) { + std::lock_guard guard(backref->mtx); + if (StateTracker* tracker = backref->state_tracker) { - if (PerfQuery* query = static_cast(g_perf_query.get())) - query->ReturnResults(q->contents, q->groups.data(), q->groups.size(), q->query_id); - tracker->m_perf_query_tracker_cache.emplace_back(std::move(q)); + // We can do the update non-atomically because we only ever update under the lock + u64 newval = + std::max(draw, tracker->m_last_finished_draw.load(std::memory_order_relaxed)); + tracker->m_last_finished_draw.store(newval, std::memory_order_release); + if (q) + { + if (PerfQuery* query = static_cast(g_perf_query.get())) + query->ReturnResults(q->contents, q->groups.data(), q->groups.size(), q->query_id); + tracker->m_perf_query_tracker_cache.emplace_back(std::move(q)); + } } - } - }]; + }]; m_current_perf_query = nullptr; [m_current_render_cmdbuf commit]; m_last_render_cmdbuf = std::move(m_current_render_cmdbuf); diff --git a/Tools/lint.sh b/Tools/lint.sh index 2db4604a46..0c0d447a38 100755 --- a/Tools/lint.sh +++ b/Tools/lint.sh @@ -18,7 +18,7 @@ if ! [ -x "$(command -v $GIT)" ]; then exit 1 fi -REQUIRED_CLANG_FORMAT_MAJOR=12 +REQUIRED_CLANG_FORMAT_MAJOR=13 REQUIRED_CLANG_FORMAT_MINOR=0 CLANG_FORMAT=clang-format CLANG_FORMAT_MAJOR=clang-format-${REQUIRED_CLANG_FORMAT_MAJOR}