If you switch a job it will not affect your status as long as your new H1B Visa employer file a new Form I-129 petition the moment you start working with your new employer. Since the H1B is considered as "dual intent" I think it won't affect your Green card application.