TransformPipeline: Minor memory optimization and a prim sanity check
Minor cleanup in texcache, fix some warnings