VideoCommon: Move TextureInfo getters to header

This improves my PC's performance on RS2 Hoth by... 0.1% or so, which I
think is within the margin of error. But this change also cuts down on
boilerplate.
This commit is contained in:
JosJuice
2026-01-19 19:46:21 +01:00
parent ff82ae3b5c
commit b07c78aabe
2 changed files with 28 additions and 163 deletions
-135
View File
@@ -175,101 +175,6 @@ TextureInfo::NameDetails TextureInfo::CalculateTextureName() const
.format_name = fmt::to_string(static_cast<int>(m_texture_format))};
}
bool TextureInfo::IsDataValid() const
{
return m_data_valid;
}
const u8* TextureInfo::GetData() const
{
return m_data.data();
}
const u8* TextureInfo::GetTlutAddress() const
{
return m_tlut_data.data();
}
u32 TextureInfo::GetRawAddress() const
{
return m_address;
}
bool TextureInfo::IsFromTmem() const
{
return m_from_tmem;
}
const u8* TextureInfo::GetTmemOddAddress() const
{
return m_tmem_odd.data();
}
TextureFormat TextureInfo::GetTextureFormat() const
{
return m_texture_format;
}
TLUTFormat TextureInfo::GetTlutFormat() const
{
return m_tlut_format;
}
std::optional<u32> TextureInfo::GetPaletteSize() const
{
return m_palette_size;
}
u32 TextureInfo::GetTextureSize() const
{
return m_texture_size;
}
u32 TextureInfo::GetBlockWidth() const
{
return m_block_width;
}
u32 TextureInfo::GetBlockHeight() const
{
return m_block_height;
}
u32 TextureInfo::GetExpandedWidth() const
{
return m_expanded_width;
}
u32 TextureInfo::GetExpandedHeight() const
{
return m_expanded_height;
}
u32 TextureInfo::GetRawWidth() const
{
return m_raw_width;
}
u32 TextureInfo::GetRawHeight() const
{
return m_raw_height;
}
u32 TextureInfo::GetStage() const
{
return m_stage;
}
bool TextureInfo::HasMipMaps() const
{
return m_limited_mip_count != 0;
}
u32 TextureInfo::GetLevelCount() const
{
return m_limited_mip_count + 1;
}
TextureInfo::MipLevels TextureInfo::GetMipMapLevels() const
{
MipLevelIterator begin;
@@ -314,46 +219,6 @@ TextureInfo::MipLevel::MipLevel(u32 level, const TextureInfo& parent, std::span<
*data = Common::SafeSubspan(*data, m_texture_size);
}
bool TextureInfo::MipLevel::IsDataValid() const
{
return m_data_valid;
}
const u8* TextureInfo::MipLevel::GetData() const
{
return m_ptr;
}
u32 TextureInfo::MipLevel::GetTextureSize() const
{
return m_texture_size;
}
u32 TextureInfo::MipLevel::GetExpandedWidth() const
{
return m_expanded_width;
}
u32 TextureInfo::MipLevel::GetExpandedHeight() const
{
return m_expanded_height;
}
u32 TextureInfo::MipLevel::GetRawWidth() const
{
return m_raw_width;
}
u32 TextureInfo::MipLevel::GetRawHeight() const
{
return m_raw_height;
}
u32 TextureInfo::MipLevel::GetLevel() const
{
return m_level;
}
TextureInfo::MipLevelIterator& TextureInfo::MipLevelIterator::operator++()
{
++m_level_index;