Solar-to-hydrogen efficiency is apparently about 30%, requiring a gasoline fuel cost of $3.26 - $6.62 for equivalence from this 2016 article...How much energy can be made vs how much is used?
Solar water splitting by photovoltaic-electrolysis with a solar-to-hydrogen efficiency over 30% - Nature Communications
In order to be practical for large-scale deployment, the cost of solar hydrogen generation must be significantly reduced. Here, the authors employ a triple-junction solar cell with two series connected polymer electrolyte membrane electrolysers to achieve solar to hydrogen efficiency of 30%.
www.nature.com
With decreasing costs of solar panels, I would think those conditions would be improved in hydrogens favor.