No not any barrier. Droplets (not large sneeze/cough particle), have a tendency to break up in the air and the heaviest ones drop fastest. A home made mask is more effective at preventing the exhalation of large droplets, that it is at preventing ingress when the average particle size has reduced some distance from the inhaler. As exhalation is under pressure, the home-made masks are not as good at filtering out small particles being exhaled, but they are better at stopping inhalation. Not intuitive, but ACTUAL TESTS, not anecdotal guesses have shown this. To this end, home made masks (not well made with HEPA), and non-N95/N100 masks, provide more benefit to everyone else, than they do to you. Things won't be logical if you based your logic on guesses and not actual science.
First, we know that coronavirus is spread by droplets. Virtually any barrier in front of the face will keep droplets out of the nose and mouth of the wearer. In that regard, the mask being worn is primarily to protect the wearer and is effective in that role. So if you need a mask you should wear one to protect yourself. Sure there may be some added protection for others if you wear a mask. But not much over the mask they should be wearing if they need one. So in this case the idea that we should wear a surgical or homemade mask to protect others is not really logical.