Works with non-power-of-two textures