VideoCommon: add loading cube maps from DDS files and loading it into our custom texture object. Custom texture object now has the concept of slices in addition to levels. Traditional custom textures have a single slice

This commit is contained in:
iwubcode
2023-08-13 16:09:45 -05:00
parent 5e5887a378
commit 62fee2f3b6
8 changed files with 225 additions and 118 deletions

View File

@ -14,18 +14,23 @@ namespace VideoCommon
class CustomTextureData
{
public:
struct Level
struct ArraySlice
{
std::vector<u8> data;
AbstractTextureFormat format = AbstractTextureFormat::RGBA8;
u32 width = 0;
u32 height = 0;
u32 row_length = 0;
struct Level
{
std::vector<u8> data;
AbstractTextureFormat format = AbstractTextureFormat::RGBA8;
u32 width = 0;
u32 height = 0;
u32 row_length = 0;
};
std::vector<Level> m_levels;
};
std::vector<Level> m_levels;
std::vector<ArraySlice> m_slices;
};
bool LoadDDSTexture(CustomTextureData* texture, const std::string& filename);
bool LoadDDSTexture(CustomTextureData::Level* level, const std::string& filename, u32 mip_level);
bool LoadPNGTexture(CustomTextureData::Level* level, const std::string& filename);
bool LoadDDSTexture(CustomTextureData::ArraySlice::Level* level, const std::string& filename,
u32 mip_level);
bool LoadPNGTexture(CustomTextureData::ArraySlice::Level* level, const std::string& filename);
} // namespace VideoCommon