diff --git a/intern/cycles/integrator/path_trace_work_cpu.cpp b/intern/cycles/integrator/path_trace_work_cpu.cpp index ed641f338d7..6aaa31a1a65 100644 --- a/intern/cycles/integrator/path_trace_work_cpu.cpp +++ b/intern/cycles/integrator/path_trace_work_cpu.cpp @@ -357,8 +357,12 @@ void PathTraceWorkCPU::guiding_push_sample_data_to_global_storage( # if PATH_GUIDING_LEVEL >= 2 const bool use_direct_light = kernel_data.integrator.use_guiding_direct_light; const bool use_mis_weights = kernel_data.integrator.use_guiding_mis_weights; +# if OPENPGL_VERSION_MINOR >= 5 + kg->opgl_path_segment_storage->PrepareSamples(use_mis_weights, use_direct_light, false); +# else kg->opgl_path_segment_storage->PrepareSamples( false, nullptr, use_mis_weights, use_direct_light, false); +# endif # endif # ifdef WITH_CYCLES_DEBUG diff --git a/intern/cycles/kernel/integrator/guiding.h b/intern/cycles/kernel/integrator/guiding.h index 1cc347ae63e..1ad2469cfa0 100644 --- a/intern/cycles/kernel/integrator/guiding.h +++ b/intern/cycles/kernel/integrator/guiding.h @@ -454,8 +454,13 @@ ccl_device_forceinline bool guiding_bsdf_init(KernelGlobals kg, ccl_private float &rand) { #if defined(__PATH_GUIDING__) && PATH_GUIDING_LEVEL >= 4 +# if OPENPGL_VERSION_MINOR >= 5 + if (kg->opgl_surface_sampling_distribution->Init( + kg->opgl_guiding_field, guiding_point3f(P), rand)) { +# else if (kg->opgl_surface_sampling_distribution->Init( kg->opgl_guiding_field, guiding_point3f(P), rand, true)) { +# endif kg->opgl_surface_sampling_distribution->ApplyCosineProduct(guiding_point3f(N)); return true; } @@ -506,8 +511,13 @@ ccl_device_forceinline bool guiding_phase_init(KernelGlobals kg, return false; } +# if OPENPGL_VERSION_MINOR >= 5 + if (kg->opgl_volume_sampling_distribution->Init( + kg->opgl_guiding_field, guiding_point3f(P), rand)) { +# else if (kg->opgl_volume_sampling_distribution->Init( kg->opgl_guiding_field, guiding_point3f(P), rand, true)) { +# endif kg->opgl_volume_sampling_distribution->ApplySingleLobeHenyeyGreensteinProduct(guiding_vec3f(D), g); return true;