speed up SSAO with OpenMP multi-threading, if available

This commit is contained in:
Axel Kohlmeyer
2023-08-19 20:06:31 -04:00
parent 93f011ad7c
commit a94c45eb0c

View File

@ -959,6 +959,9 @@ void Image::compute_SSAO()
int pixelstart = static_cast<int> (1.0*me/nprocs * npixels);
int pixelstop = static_cast<int> (1.0*(me+1)/nprocs * npixels);
#if defined(_OPENMP)
#pragma omp parallel for
#endif
for (int index = pixelstart; index < pixelstop; index++) {
int x = index % width;
int y = index / width;