I tried, the texture still fully black.
I logger the mipmap array size, it has size of 8, here the log beginImage + writeData :
[2015/10/25-16:35:41] beginImage called
[2015/10/25-16:35:42] writeData called
[2015/10/25-16:35:42] beginImage called
[2015/10/25-16:35:42] writeData called
[2015/10/25-16:35:42] beginImage called
[2015/10/25-16:35:42] writeData called
[2015/10/25-16:35:42] beginImage called
[2015/10/25-16:35:42] writeData called
[2015/10/25-16:35:42] beginImage called
[2015/10/25-16:35:42] writeData called
[2015/10/25-16:35:42] beginImage called
[2015/10/25-16:35:42] writeData called
[2015/10/25-16:35:42] beginImage called
[2015/10/25-16:35:42] writeData called
[2015/10/25-16:35:42] beginImage called
[2015/10/25-16:35:42] writeData called
I tried to import an image with the size 33x61, same case, not power of two and not multiple of 4, got fully black too.
Imported in unreal as test like the previous test, the format still B8G8R8A8, not compressed.
EDIT:
Apparently by default mipmaps are generated if not specified it's why 8 writeData was there, I added :
InputOptions.setMipmapGeneration( true, m_NumMipMaps );
Now only one beginImage and writeData is called, I logged the size, width and height :
[2015/10/25-22:44:23] ChangeImageFormat called:186,138
[2015/10/25-22:44:23] beginImage called:26320,186,138
[2015/10/25-22:44:23] writeData called:26320
The size is the same, it's not padded to a multiple of 4 apparently, it's why the texture is fully black surely.
From this link : https://www.opengl.org/registry/specs/EXT/texture_compression_s3tc.txt
TexSubImage2D and CopyTexSubImage2D will result in an INVALID_OPERATION
error only if one of the following conditions occurs:
* <width> is not a multiple of four, <width> plus <xoffset> is not
equal to TEXTURE_WIDTH, and either <xoffset> or <yoffset> is
non-zero;
* <height> is not a multiple of four, <height> plus <yoffset> is not
equal to TEXTURE_HEIGHT, and either <xoffset> or <yoffset> is
non-zero; or
* <xoffset> or <yoffset> is not a multiple of four.
I think it's the same for Direct3D.
I changed the starting of the ChangeImageFormat like that since no other working solution found :
// Check for invalid data.
if( m_Data == nullptr || m_ImageFormat != IF_RGBA8 || ImageFormat == IF_RGBA8 || ( m_Width % 4 ) != 0 || ( m_Height % 4 ) != 0 )
return;