merged back some modif by nico
checked textureGc correctness