Let $D$ be an irreducible curve on a $K3$ surface $S$, and let $L=\mathcal{O}_S(D)$. The Riemann Roch formula on the $K3$ surface is given by :
$\qquad\qquad\qquad\qquad\qquad h^0(S,L)+h^0(S,L^{-1})=2+\frac{1}{2}D^2+h^1(S,L)$.
The short exact sequence for $D$, i.e., $0\longrightarrow\mathcal{O}_S(-D)\longrightarrow\mathcal{O}_S\longrightarrow\mathcal{O}_D\longrightarrow 0$, tells us that $h^1(S,\mathcal{O}_S(-D))=h^0(D,\mathcal{O}_D)-1$. Further the adjunction formula tells us that $g(D)=\frac{1}{2}D.D+1$
The claim is that $h^0(S,L)=2 +D^2/2$. That is I need to prove that $\chi(L)=h^0(S,L)$, by the Riemann Roch. Further, since $D$ is a curve, $h^0(S,L^{-1})=0$, so I need to prove that $h^1(S,L)=0$ right? But by Serre duality, $h^1(S,L)=h^1(S,\mathcal{O}_S(D))=h^1(\mathcal{O}_S(-D))=h^0(D,\mathcal{O}_D)-1$ But $h^0(D,\mathcal{O}_D)=1$, since $D$ is an irreducible curve in $S$? Is my argument right? Any help will be appreciated!