diff options
| author | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-12-13 14:02:12 -0800 |
|---|---|---|
| committer | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2025-03-10 12:38:03 -0700 |
| commit | 433c6ce0f20e33379985a56b58540197feeeff59 (patch) | |
| tree | e9a9352cf51bb44612d9fc07c336bdefad467d94 /Source/Core/VideoCommon/TextureInfo.cpp | |
| parent | 87496205aa9c75217a715deb34c5fb60f6acbb2a (diff) | |
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.
Diffstat (limited to 'Source/Core/VideoCommon/TextureInfo.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/TextureInfo.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
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<int>(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<int>(m_texture_format))}; } bool TextureInfo::IsDataValid() const |
