2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-06-27 23:01:55 +00:00

Fix Cubemap mipmap sizes

This commit is contained in:
Jan
2020-09-08 12:34:54 +02:00
parent d35560ccd7
commit e7898a1f3c
6 changed files with 5 additions and 11 deletions

View File

@ -219,11 +219,6 @@ TextureType TextureCube::GetTextureType() const
}
int TextureCube::GetFaceCount() const
{
return 6;
}
size_t TextureCube::GetSizeOfMipLevel(const int mipLevel) const
{
return FACE_COUNT;
}

View File

@ -93,7 +93,6 @@ public:
int GetFaceCount() const override;
size_t GetSizeOfMipLevel(int mipLevel) const override;
uint8_t* GetBufferForMipLevel(int mipLevel, int face) override;
};

View File

@ -158,7 +158,7 @@ void TextureConverter::ReorderUnsignedToUnsigned() const
for (auto mipLevel = 0; mipLevel < mipCount; mipLevel++)
{
const auto mipLevelSize = m_input_texture->GetSizeOfMipLevel(mipLevel);
const auto mipLevelSize = m_input_texture->GetSizeOfMipLevel(mipLevel) * m_input_texture->GetFaceCount();
const auto* inputBuffer = m_input_texture->GetBufferForMipLevel(mipLevel);
auto* outputBuffer = m_output_texture->GetBufferForMipLevel(mipLevel);