diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2022-03-05 14:52:02 -0600 |
|---|---|---|
| committer | iwubcode <iwubcode@users.noreply.github.com> | 2022-06-26 00:45:13 -0500 |
| commit | 7854afe512870b83baae0e11c42d62721e20a083 (patch) | |
| tree | 469bed460f90dac6c1a788cdb0ecbf33e61904c0 /Source/Core/VideoCommon/TextureInfo.cpp | |
| parent | a1892a9c68895c05493bd203996d8ab812283614 (diff) | |
VideoCommon: add support for setting and getting the stage from the texture info
Diffstat (limited to 'Source/Core/VideoCommon/TextureInfo.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/TextureInfo.cpp | 21 |
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(); |
