Compile issue with cycles in blender 4.1

We’re using cycles out of blender for another project and we’re upgrading to 4.1 from blender. The issue is, when compiling the cpu files like kernel.cpp the code does not compile. The error is

Severity Code Description Project File Line Suppression State
Error C2668 ‘ccl::integrator_state_transmission_bounce’: ambiguous call to overloaded function cycles (Cycles\cycles) c:\work\poser\app\code\cycles\src\kernel\svm\light_path.h 91
Error C2664 ‘ccl::float3 ccl::svm_bevel(ccl::KernelGlobals,ccl::ConstIntegratorState,ccl::ShaderData *,float,int)’: cannot convert argument 2 from ‘ConstIntegratorGenericState’ to ‘ccl::ConstIntegratorState’ cycles (Cycles\cycles) c:\work\poser\app\code\cycles\src\kernel\svm\bevel.h 324
Error C2664 ‘float ccl::svm_ao(ccl::KernelGlobals,ccl::ConstIntegratorState,ccl::ShaderData *,ccl::float3,float,int,int)’: cannot convert argument 2 from ‘ConstIntegratorGenericState’ to ‘ccl::ConstIntegratorState’ cycles (Cycles\cycles) c:\work\poser\app\code\cycles\src\kernel\svm\ao.h 123
Error C2664 ‘void ccl::film_write_aov_pass_color(ccl::KernelGlobals,ccl::ConstIntegratorState,float *__restrict ,const int,const ccl::float3)’: cannot convert argument 2 from ‘ConstIntegratorGenericState’ to ‘ccl::ConstIntegratorState’ cycles (Cycles\cycles) c:\work\poser\app\code\cycles\src\kernel\svm\aov.h 31
Error C2664 ‘void ccl::film_write_aov_pass_value(ccl::KernelGlobals,ccl::ConstIntegratorState,float *__restrict ,const int,const float)’: cannot convert argument 2 from ‘ConstIntegratorGenericState’ to ‘ccl::ConstIntegratorState’ cycles (Cycles\cycles) c:\work\poser\app\code\cycles\src\kernel\svm\aov.h 46
Error C2668 ‘ccl::integrator_state_bounce’: ambiguous call to overloaded function cycles (Cycles\cycles) c:\work\poser\app\code\cycles\src\kernel\svm\light_path.h 59
Error C2668 ‘ccl::integrator_state_transparent_bounce’: ambiguous call to overloaded function cycles (Cycles\cycles) c:\work\poser\app\code\cycles\src\kernel\svm\light_path.h 72
Error C2668 ‘ccl::integrator_state_diffuse_bounce’: ambiguous call to overloaded function cycles (Cycles\cycles) c:\work\poser\app\code\cycles\src\kernel\svm\light_path.h 79
Error C2668 ‘ccl::integrator_state_glossy_bounce’: ambiguous call to overloaded function cycles (Cycles\cycles) c:\work\poser\app\code\cycles\src\kernel\svm\light_path.h 85

The weird thing is the code is the same in the version of cycles we have and compiles fine. It cannot determine which overload of the IntegratorStates to use. We are using 2017 15.9.55 for compile on win 11.

I cannot find any differences between the older code and this newer code for the CPU device code.

could just be a VS issue, the lowest version we CI on is 2019 v16.11.26, vs2017 may just not be up to the task without having to make code-changes to appease it.

The other version of cycles we have compiles and this section of the code is identical. I thought about that too but the older code does work.

I did resolve this. The nullptr define for the null ConstIntegrator state needed to be casted. I couldn’t be a raw null.

Wanted to ask, did fixed walk get replaced by random_walk_skin?

1 Like
Old New 4.0+
Random Walk Random Walk (Skin)
Random Walk (Fixed Radius) Random Walk