Ferrari's Lewis Hamilton was despondent after failing to make it into Q3 at the Hungarian Grand Prix.