From 433c6ce0f20e33379985a56b58540197feeeff59 Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:02:12 -0800 Subject: GCC: Remedy NRVO Fails Using the `-Wnrvo` flag introduced by GCC 14, I identified a few places where NRVO was clearly intended, but is fumbled. --- Source/Core/VideoCommon/VertexLoaderX64.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoCommon/VertexLoaderX64.cpp') diff --git a/Source/Core/VideoCommon/VertexLoaderX64.cpp b/Source/Core/VideoCommon/VertexLoaderX64.cpp index aa8ad2bd67..c7cbf55257 100644 --- a/Source/Core/VideoCommon/VertexLoaderX64.cpp +++ b/Source/Core/VideoCommon/VertexLoaderX64.cpp @@ -57,11 +57,10 @@ VertexLoaderX64::VertexLoaderX64(const TVtxDesc& vtx_desc, const VAT& vtx_att) OpArg VertexLoaderX64::GetVertexAddr(CPArray array, VertexComponentFormat attribute) { - OpArg data = MDisp(src_reg, m_src_ofs); if (IsIndexed(attribute)) { int bits = attribute == VertexComponentFormat::Index8 ? 8 : 16; - LoadAndSwap(bits, scratch1, data); + LoadAndSwap(bits, scratch1, MDisp(src_reg, m_src_ofs)); m_src_ofs += bits / 8; if (array == CPArray::Position) { @@ -74,7 +73,7 @@ OpArg VertexLoaderX64::GetVertexAddr(CPArray array, VertexComponentFormat attrib } else { - return data; + return MDisp(src_reg, m_src_ofs); } } -- cgit v1.2.3