fix a bug in cg managed gl texture