A microlens substrate will warp when an oxide film is formed and annealed before forming a mask in order to adjust the etching rate of wet etching. Accordingly, a film exerting a stress that cancels out this warping is formed upon a microlens. This film functions as an optical path length adjusting layer.