skipMip not correctly calulcated for cubemaps and texture arrays


In FillInitData() in DDSTextureLoader.cpp, Ln 729 the skipMip variable is arraySize times too big if arraySize is > 1. So for cubemaps or texture arrays it is wrong and results in an invalid (huge) desc.MipLevels value. Moving the line skipMips = 0; line into the arraySize loop is one way to fix it.
Closed Apr 26, 2013 at 10:15 PM by walbourn


walbourn wrote Apr 25, 2013 at 11:52 PM

Thanks for the report. I think the better way to solve this is to add if ( !j ) to the condition so that skipMip is only incremented for the first array item (it is the same for all items in the array)

else ++skipMip;

should be

else if ( !j ) ++skipMip;

walbourn wrote Apr 26, 2013 at 10:15 PM

Resolved with changeset 26924: DDSTextureLoader fix for 1D/2D texture and cubemap arrays when skipping mips