summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/TextureInfo.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureInfo.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/Source/Core/VideoCommon/TextureInfo.cpp b/Source/Core/VideoCommon/TextureInfo.cpp
index 696f5b904c..ff117c6926 100644
--- a/Source/Core/VideoCommon/TextureInfo.cpp
+++ b/Source/Core/VideoCommon/TextureInfo.cpp
@@ -39,20 +39,20 @@ TextureInfo TextureInfo::FromStage(u32 stage)
if (from_tmem)
{
- return TextureInfo(&texMem[tmem_address_even], tlut_ptr, address, texture_format, tlut_format,
- width, height, true, &texMem[tmem_address_odd], &texMem[tmem_address_even],
- mip_count);
+ return TextureInfo(stage, &texMem[tmem_address_even], tlut_ptr, address, texture_format,
+ tlut_format, width, height, true, &texMem[tmem_address_odd],
+ &texMem[tmem_address_even], mip_count);
}
- return TextureInfo(Memory::GetPointer(address), tlut_ptr, address, texture_format, tlut_format,
- width, height, false, nullptr, nullptr, mip_count);
+ return TextureInfo(stage, Memory::GetPointer(address), tlut_ptr, address, texture_format,
+ tlut_format, width, height, false, nullptr, nullptr, mip_count);
}
-TextureInfo::TextureInfo(const u8* ptr, const u8* tlut_ptr, u32 address,
+TextureInfo::TextureInfo(u32 stage, const u8* ptr, const u8* tlut_ptr, u32 address,
TextureFormat texture_format, TLUTFormat tlut_format, u32 width,
u32 height, bool from_tmem, const u8* tmem_odd, const u8* tmem_even,
std::optional<u32> mip_count)
- : m_ptr(ptr), m_tlut_ptr(tlut_ptr), m_address(address), m_from_tmem(from_tmem),
+ : m_stage(stage), m_ptr(ptr), m_tlut_ptr(tlut_ptr), m_address(address), m_from_tmem(from_tmem),
m_tmem_odd(tmem_odd), m_texture_format(texture_format), m_tlut_format(tlut_format),
m_raw_width(width), m_raw_height(height)
{
@@ -100,7 +100,7 @@ std::string TextureInfo::NameDetails::GetFullName() const
return fmt::format("{}_{}{}_{}", base_name, texture_name, tlut_name, format_name);
}
-TextureInfo::NameDetails TextureInfo::CalculateTextureName()
+TextureInfo::NameDetails TextureInfo::CalculateTextureName() const
{
if (!m_ptr)
return NameDetails{};
@@ -240,6 +240,11 @@ u32 TextureInfo::GetRawHeight() const
return m_raw_height;
}
+u32 TextureInfo::GetStage() const
+{
+ return m_stage;
+}
+
bool TextureInfo::HasMipMaps() const
{
return !m_mip_levels.empty();