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/TextureInfo.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'Source/Core/VideoCommon/TextureInfo.cpp') diff --git a/Source/Core/VideoCommon/TextureInfo.cpp b/Source/Core/VideoCommon/TextureInfo.cpp index 5ee23f3671..27055f462d 100644 --- a/Source/Core/VideoCommon/TextureInfo.cpp +++ b/Source/Core/VideoCommon/TextureInfo.cpp @@ -183,14 +183,11 @@ TextureInfo::NameDetails TextureInfo::CalculateTextureName() const const u64 tex_hash = XXH64(m_ptr, m_texture_size, 0); const u64 tlut_hash = tlut_size ? XXH64(tlut, tlut_size, 0) : 0; - NameDetails result; - result.base_name = fmt::format("{}{}x{}{}", format_prefix, m_raw_width, m_raw_height, - m_mipmaps_enabled ? "_m" : ""); - result.texture_name = fmt::format("{:016x}", tex_hash); - result.tlut_name = tlut_size ? fmt::format("_{:016x}", tlut_hash) : ""; - result.format_name = fmt::to_string(static_cast(m_texture_format)); - - return result; + return {.base_name = fmt::format("{}{}x{}{}", format_prefix, m_raw_width, m_raw_height, + m_mipmaps_enabled ? "_m" : ""), + .texture_name = fmt::format("{:016x}", tex_hash), + .tlut_name = tlut_size ? fmt::format("_{:016x}", tlut_hash) : "", + .format_name = fmt::to_string(static_cast(m_texture_format))}; } bool TextureInfo::IsDataValid() const -- cgit v1.2.3