bkaradzic / bimg

Image library.
BSD 2-Clause "Simplified" License
327 stars 268 forks source link

Fixes for cubemap loading from ktx/pvr3 container #63

Closed attilaz closed 3 years ago

attilaz commented 3 years ago

ktx: imageSize checking is modified to conform to cubemap exception rule. https://www.khronos.org/registry/KTX/specs/1.0/ktxspec_v1.html#2.16

This fired the assert: BX_ASSERT(size == imageSize, "KTX: Image size mismatch %d (expected %d).", size, imageSize); (To reproduce with texturev I had to enable assert because it was defined as NOOP in debug msvc project)

pvr3: container surface layout is similar to ktx (mip first then array/cubemap faces)

See section 4 in http://cdn.imgtec.com/sdk-documentation/PVR+File+Format.Specification.pdf

Here are two files (ktx and a pvr) that reproduce the issue: cubemaps.zip