The topic of whether a surrender was under way is discussed here, with links to earlier exchanges.
Whether the bombings were necessary (in other words whether a surrender might have been procured without them) is another matter: see for instance here.
But in short, there were peace feelers before the bombings, but nothing yet that would really qualify as surrender. But there were alternatives to bombing.