mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-11 14:44:55 +00:00
Merge pull request #13221 from mitaclaw/nrvo-fails-1
GCC: Remedy NRVO Fails
This commit is contained in:
commit
9819d66a47
6 changed files with 11 additions and 17 deletions
|
@ -95,8 +95,7 @@ Result<FileStatus> FileHandle::GetStatus() const
|
||||||
Result<FileHandle> FileSystem::CreateAndOpenFile(Uid uid, Gid gid, const std::string& path,
|
Result<FileHandle> FileSystem::CreateAndOpenFile(Uid uid, Gid gid, const std::string& path,
|
||||||
Modes modes)
|
Modes modes)
|
||||||
{
|
{
|
||||||
Result<FileHandle> file = OpenFile(uid, gid, path, Mode::ReadWrite);
|
if (Result<FileHandle> file = OpenFile(uid, gid, path, Mode::ReadWrite))
|
||||||
if (file.Succeeded())
|
|
||||||
return file;
|
return file;
|
||||||
|
|
||||||
const ResultCode result = CreateFile(uid, gid, path, 0, modes);
|
const ResultCode result = CreateFile(uid, gid, path, 0, modes);
|
||||||
|
|
|
@ -697,7 +697,7 @@ std::string VolumeVerifier::GetPartitionName(std::optional<u32> type) const
|
||||||
// (French), Clásicos (Spanish), Capolavori (Italian), 클래식 게임 체험판 (Korean).
|
// (French), Clásicos (Spanish), Capolavori (Italian), 클래식 게임 체험판 (Korean).
|
||||||
// If your language is not one of the languages above, consider leaving the string untranslated
|
// If your language is not one of the languages above, consider leaving the string untranslated
|
||||||
// so that people will recognize it as the name of the game mode.
|
// so that people will recognize it as the name of the game mode.
|
||||||
name = Common::FmtFormatT("{0} (Masterpiece)", name);
|
return Common::FmtFormatT("{0} (Masterpiece)", name);
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,8 +39,7 @@ static std::unique_ptr<DiscIO::FileInfo> GetFileInfo(const DiscIO::Volume& disc_
|
||||||
if (!filesystem)
|
if (!filesystem)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
std::unique_ptr<DiscIO::FileInfo> info = filesystem->FindFileInfo(path);
|
return filesystem->FindFileInfo(path);
|
||||||
return info;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool VolumeSupported(const DiscIO::Volume& disc_volume)
|
static bool VolumeSupported(const DiscIO::Volume& disc_volume)
|
||||||
|
|
|
@ -837,7 +837,7 @@ std::string GameFile::GetFileFormatName() const
|
||||||
{
|
{
|
||||||
std::string name = DiscIO::GetName(m_blob_type, true);
|
std::string name = DiscIO::GetName(m_blob_type, true);
|
||||||
if (m_is_nkit)
|
if (m_is_nkit)
|
||||||
name = Common::FmtFormatT("{0} (NKit)", name);
|
return Common::FmtFormatT("{0} (NKit)", name);
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,14 +183,11 @@ TextureInfo::NameDetails TextureInfo::CalculateTextureName() const
|
||||||
const u64 tex_hash = XXH64(m_ptr, m_texture_size, 0);
|
const u64 tex_hash = XXH64(m_ptr, m_texture_size, 0);
|
||||||
const u64 tlut_hash = tlut_size ? XXH64(tlut, tlut_size, 0) : 0;
|
const u64 tlut_hash = tlut_size ? XXH64(tlut, tlut_size, 0) : 0;
|
||||||
|
|
||||||
NameDetails result;
|
return {.base_name = fmt::format("{}{}x{}{}", format_prefix, m_raw_width, m_raw_height,
|
||||||
result.base_name = fmt::format("{}{}x{}{}", format_prefix, m_raw_width, m_raw_height,
|
m_mipmaps_enabled ? "_m" : ""),
|
||||||
m_mipmaps_enabled ? "_m" : "");
|
.texture_name = fmt::format("{:016x}", tex_hash),
|
||||||
result.texture_name = fmt::format("{:016x}", tex_hash);
|
.tlut_name = tlut_size ? fmt::format("_{:016x}", tlut_hash) : "",
|
||||||
result.tlut_name = tlut_size ? fmt::format("_{:016x}", tlut_hash) : "";
|
.format_name = fmt::to_string(static_cast<int>(m_texture_format))};
|
||||||
result.format_name = fmt::to_string(static_cast<int>(m_texture_format));
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextureInfo::IsDataValid() const
|
bool TextureInfo::IsDataValid() const
|
||||||
|
|
|
@ -57,11 +57,10 @@ VertexLoaderX64::VertexLoaderX64(const TVtxDesc& vtx_desc, const VAT& vtx_att)
|
||||||
|
|
||||||
OpArg VertexLoaderX64::GetVertexAddr(CPArray array, VertexComponentFormat attribute)
|
OpArg VertexLoaderX64::GetVertexAddr(CPArray array, VertexComponentFormat attribute)
|
||||||
{
|
{
|
||||||
OpArg data = MDisp(src_reg, m_src_ofs);
|
|
||||||
if (IsIndexed(attribute))
|
if (IsIndexed(attribute))
|
||||||
{
|
{
|
||||||
int bits = attribute == VertexComponentFormat::Index8 ? 8 : 16;
|
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;
|
m_src_ofs += bits / 8;
|
||||||
if (array == CPArray::Position)
|
if (array == CPArray::Position)
|
||||||
{
|
{
|
||||||
|
@ -74,7 +73,7 @@ OpArg VertexLoaderX64::GetVertexAddr(CPArray array, VertexComponentFormat attrib
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return data;
|
return MDisp(src_reg, m_src_ofs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue