Matteo Bruni (@Mystral) commented about dlls/d3dx10_43/texture.c:
img_info.Height = (img_info.Height + format_info.BlockHeight - 1) & ~(format_info.BlockHeight - 1);
}
if (FAILED(hr = IWICDdsDecoder_GetFrame(dds_decoder, i, j, 0, &frame)))
goto end;
if (FAILED(hr = IWICBitmapFrameDecode_QueryInterface(frame,
&IID_IWICDdsFrameDecode, (void **)&dds_frame)))
goto end;
if (FAILED(hr = dds_get_frame_info(dds_frame, &img_info, &format_info, &stride, &frame_size)))
goto end;
size += sizeof(**resource_data) + frame_size;
if (!i && !j)
{
img_info.Width = (img_info.Width + format_info.BlockWidth - 1) & ~(format_info.BlockWidth - 1);
img_info.Height = (img_info.Height + format_info.BlockHeight - 1) & ~(format_info.BlockHeight - 1);
}
I wonder if this should happen for all the mip level 0 elements of an array / cube texture (i.e. condition should just be !j instead).