I just want to clarify a few points with regarding to sampling from a continuous 2-dimensional probability density function. If I want to sample from this pdf, I could sample from a 1D pdf, $P(x)$, along $x$ and one along $y$ using the inverse transform sampling method. This method starts with cumulatively integrating a 1D pdf to calculate the cumulative density function,
$$ C(x) = \int^{x}_{-\infty} \frac{1}{A}P(x') \ dx' $$
Once the cdf has been calculated, it can be inverted to produce the ppf function. Once that has been done, the last step is to sample uniformly in [0,1), then pass those values through the ppf function which redistributes the initially uniformed sampled points in accordance to the original pdf.
In the case of the 2D pdf, I can repeat this process along $x$ and along $y$ to get samples for the 2D pdf. Now, if I want to calculate an integral via importance sampling MC. When I sample in accordance with the 2D pdf for $N$ samples, do I sample along $x$ and $y$ with $N$ samples each so I would have an array of (N,2) or do I sample along $x$ and $y$ with $N$ samples and calculate a $N$ by $N$ mesh of all combinations of $x$ and $y$?