Solved, but I think it is worth to mention the solution:
- use proper
GL_UNPACK_ALIGNMENT
, by default it is 4, but when I changed it to 1 it worked! - or change data format from
SOIL_LOAD_AUTO
toSOIL_RGBA
.AUTO
means original texture format and for jpg images it is RGB, so it can be problematic when unpack alignment is 4.
with SOIL_FLAG_MIPMAP
soil actually rescales image to POT and that way there are no problems with unpack alignment size.