add weak_ptr for referenced_count
fix texture ref in render context