/Engine/Source/Runtime/ImageCore/Public/DDSFile.h
20 mips means 512k x 512k pixels max, should be sufficient for now. It's 512k not 1M because the final 1x1 pixel mip counts; i.e. a mip chain from 1048576x1048576 down to 1x1 has 21 mips!
static constexpr uint32 MAX_MIPS_SUPPORTED = 20;