I found this about pvrtc:
http://www.imgtec.com/forum/forum_posts ... D=366&PN=2From this forum:
Quote:
If a textured object shows up white it may be a sign that the texture is incomplete. If mipmapping is enabled for the texture (GL_TEXTURE_MIN_FILTER is one that contains _MIPMAP_) you need an entire mipmap chain from base level to 1x1.
Georg Kolling - Developer Technology
Quote:
PVRTC is tricky to load MIP-map chains for because of the minimum size requirement for MIP-levels and since OpenGL ES requires full MIP chains it's very easy to have problems.
Gordon MacLachlan - POWERVR Developer Technology
So as I understand you must upload the levels down to 1x1 but because there is a fixed block size the imageSize will be at least 32 or 64 depending on the format.
Also your texture level size is different that the one in the extension specification:
http://www.khronos.org/registry/gles/ex ... _pvrtc.txtQuote:
6) How is the imageSize argument calculated for the CompressedTexImage2D
and CompressedTexSubImage2D functions.
Resolution: For PVRTC 4BPP formats the imageSize is calculated as:
( max(width, 8 ) * max(height, 8 ) * 4 + 7) / 8
For PVRTC 2BPP formats the imageSize is calculated as:
( max(width, 16) * max(height, 8 ) * 2 + 7) / 8
You use:
PVRTC 2BPP:
return std::max( width / 8, 1 ) * std::max( height / 8, 1 ) * 8;
PVRTC 4BPP:
return std::max( width / 4, 1 ) * std::max( height / 4, 1 ) * 8;
While your 4bpp calculation gives similar result for larger images it seems to be broken from 4x4. Also your 2bpp calc for an 8x8 texture gives 8 bytes which means 1 bit per pixel instead of 2.
Maybe I'm wrong, but I hope it helps.
I hope I will be able to test it soon on a device too and help more with testing.