Skip to content

Commit

Permalink
Fixed loading of small compressed non-square textures
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Core committed Feb 20, 2021
1 parent c9e1d9a commit c4d52c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Code/Engine/RendererCore/Textures/Texture2DResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ void ezTexture2DResource::FillOutDescriptor(ezTexture2DResourceDescriptor& td, c
td.m_DescGAL.m_uiMipLevelCount = uiNumMipLevels;
td.m_DescGAL.m_uiArraySize = pImage->GetNumArrayIndices();

if (ezImageFormat::GetType(pImage->GetImageFormat()) == ezImageFormatType::BLOCK_COMPRESSED)
{
td.m_DescGAL.m_uiWidth = ezMath::RoundUp(td.m_DescGAL.m_uiWidth, 4);
td.m_DescGAL.m_uiHeight = ezMath::RoundUp(td.m_DescGAL.m_uiHeight, 4);
}

if (td.m_DescGAL.m_uiDepth > 1)
td.m_DescGAL.m_Type = ezGALTextureType::Texture3D;

Expand Down

0 comments on commit c4d52c6

Please sign in to comment.