diff --git a/src/pbrt/wavefront/integrator.h b/src/pbrt/wavefront/integrator.h index cbb8d9116a08fba6a61b03ec3f24eb1c26eddd2d..e85312ad66036b01d20bc839f5165553ab97f6fb 100644 --- a/src/pbrt/wavefront/integrator.h +++ b/src/pbrt/wavefront/integrator.h @@ -111,7 +111,7 @@ class WavefrontPathIntegrator { void Do(const char *description, F &&func) { if (Options->useGPU) #ifdef PBRT_BUILD_GPU_RENDERER - GPUParallelFor(description, 1, [=] PBRT_GPU(int) { func(); }); + GPUParallelFor(description, 1, [=] PBRT_GPU(int) mutable { func(); }); #else LOG_FATAL("Options->useGPU was set without PBRT_BUILD_GPU_RENDERER enabled"); #endif diff --git a/src/pbrt/wavefront/workqueue.h b/src/pbrt/wavefront/workqueue.h index 688160708e4843bd4d499ad84c07b1d70403189c..2f0827e4d4077cdc5ebdffbc5a68e65dc4e6139d 100644 --- a/src/pbrt/wavefront/workqueue.h +++ b/src/pbrt/wavefront/workqueue.h @@ -121,7 +121,7 @@ void ForAllQueued(const char *desc, const WorkQueue *q, int maxQueued, if (Options->useGPU) { // Launch GPU threads to process _q_ using _func_ #ifdef PBRT_BUILD_GPU_RENDERER - GPUParallelFor(desc, maxQueued, [=] PBRT_GPU(int index) { + GPUParallelFor(desc, maxQueued, [=] PBRT_GPU(int index) mutable { if (index >= q->Size()) return; func((*q)[index]);