Reduce the number of OpenCL kernel compilations

Discussion related to the LuxCore functionality, implementations and API.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Reduce the number of OpenCL kernel compilations

Post by Dade »

It is going to be a long journey. Anyway I will list here the cases that do not trigger an OpenCL kernel re-compilation anymore:

- Using/Not Using bump/normal mapping doesn't requires OpenCL compilation anymore (removed PARAM_HAS_BUMPMAPS conditional OpenCL compilation)

- Using/Not using any type of transparency doesn't require OpenCL compilation anymore (removed PARAM_HAS_PASSTHROUGH conditional OpenCL compilation)

- Changing max. path and/or Russian Roulette parameters doesn't require OpenCL compilation anymore (removed PARAM_MAX_PATH_DEPTH, PARAM_MAX_PATH_DEPTH_DIFFUSE, PARAM_MAX_PATH_DEPTH_GLOSSY, PARAM_MAX_PATH_DEPTH_SPECULAR, PARAM_RR_DEPTH and PARAM_RR_CAPPARAM_HAS_BUMPMAPS conditional OpenCL compilation)

- Changing hybrid backward/forward path tracing settings doesn't require OpenCL compilation anymore (removed PARAM_HYBRID_BACKFORWARD and PARAM_HYBRID_BACKFORWARD_GLOSSINESSTHRESHOLD conditional OpenCL compilation)

- Changing PhotonGI settings doesn't require OpenCL compilation anymore (removed PARAM_PGIC_ENABLED, PARAM_PGIC_INDIRECT_ENABLED, PARAM_PGIC_CAUSTIC_ENABLED, etc.)

- Changing force black background flag doesn't require OpenCL compilation anymore (removed PARAM_FORCE_BLACK_BACKGROUND)

- Changing variance clamping settings doesn't require OpenCL compilation anymore (removed PARAM_SQRT_VARIANCE_CLAMP_MAX_VALUE)

- Changing LIGHT_WORLD_RADIUS_SCALE doesn't require OpenCL compilation anymore (removed PARAM_RADIUS)

- Removed HitPoint struct variable size related to PARAM_ENABLE_TEX_HITPOINTCOLOR, PARAM_ENABLE_TEX_HITPOINTGREY, PARAM_ENABLE_TEX_HITPOINTALPHA and PARAM_TRIANGLE_LIGHT_HAS_VERTEX_COLOR to avoid OpenCL re-compilation

- Enabling/disabling volumes doesn't require OpenCL compilation anymore (removed PARAM_HAS_VOLUMES and SCENE_DEFAULT_VOLUME_INDEX)

- Enabling/disabling camera clipping and/or OculusRift barrel doesn't require OpenCL compilation anymore (removed PARAM_CAMERA_ENABLE_CLIPPING_PLANE and PARAM_CAMERA_ENABLE_OCULUSRIFT_BARREL)

- Changing any pixel filter related parameter doesn't require OpenCL compilation anymore (removed all PARAM_IMAGE_FILTER_*)

- Changing camera type doesn't require OpenCL compilation anymore (removed PARAM_CAMERA_TYPE)

- Changing any image map related settings doesn't require OpenCL compilation anymore (removed all PARAM_HAS_IMAGEMAPS_*)

- Changing the number of light groups used doesn't require OpenCL compilation anymore (removed PARAM_FILM_RADIANCE_GROUP_*)

- Enabling/disabling BCD denoiser doesn't require OpenCL compilation anymore (removed PARAM_FILM_DENOISER)

- Rework of OpenCL samplers code to not require OpenCL compilation anymore when changing sampler (removed PARAM_SAMPLER_*)

- Changing AOVs used doesn't require OpenCL compilation anymore (removed PARAM_FILM_CHANNELS_*)

- Adding/Removing a new light source type doesn't require OpenCL compilation anymore (removed PARAM_HAS_*LIGHT)
Support LuxCoreRender project with salts and bounties
Racleborg
Posts: 621
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: Reduce the number of OpenCL kernel compilations

Post by Racleborg »

Thank you. :)
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Reduce the number of OpenCL kernel compilations

Post by Dade »

Using/Not using any type of transparency doesn't require OpenCL compilation anymore (removed PARAM_HAS_PASSTHROUGH conditional OpenCL compilation).

Changing max. path and/or Russian Roulette parameters doesn't require OpenCL compilation anymore (removed PARAM_MAX_PATH_DEPTH, PARAM_MAX_PATH_DEPTH_DIFFUSE, PARAM_MAX_PATH_DEPTH_GLOSSY, PARAM_MAX_PATH_DEPTH_SPECULAR, PARAM_RR_DEPTH and PARAM_RR_CAPPARAM_HAS_BUMPMAPS conditional OpenCL compilation).
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Reduce the number of OpenCL kernel compilations

Post by Dade »

Changing hybrid backward/forward path tracing settings doesn't require OpenCL compilation anymore (removed PARAM_HYBRID_BACKFORWARD and PARAM_HYBRID_BACKFORWARD_GLOSSINESSTHRESHOLD conditional OpenCL compilation).
Support LuxCoreRender project with salts and bounties
Racleborg
Posts: 621
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: Reduce the number of OpenCL kernel compilations

Post by Racleborg »

Getting this message when running a render after the update:

"Wrong data type for the list of UV maps of method Scene.DefineMesh(): int"
User avatar
Sharlybg
Donor
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: Reduce the number of OpenCL kernel compilations

Post by Sharlybg »

Very good news !
Big thanks.
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA
neo2068
Developer
Developer
Posts: 260
Joined: Tue Dec 05, 2017 6:06 pm
Location: Germany

Re: Reduce the number of OpenCL kernel compilations

Post by neo2068 »

Racleborg wrote: Sun Dec 22, 2019 3:35 pm Getting this message when running a render after the update:

"Wrong data type for the list of UV maps of method Scene.DefineMesh(): int"
This message comes from the new multi UV map support. Do you have the latest version of BlendLuxCore? It seems that there is an old version calling the new function.
i7 5820K, 32 GB RAM, NVIDIA Geforce RTX 2080 SUPER + GTX 1080, Windows 10 64bit, Blender 2.83.5
Support LuxCoreRender project with salts and bounties
Racleborg
Posts: 621
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: Reduce the number of OpenCL kernel compilations

Post by Racleborg »

Do you have the latest version of BlendLuxCore? It seems that there is an old version calling the new function.
That was it, thank you.

The new update has made things much faster for compiling opencl. Many thanks :D
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Reduce the number of OpenCL kernel compilations

Post by Dade »

Changing PhotonGI settings doesn't require OpenCL compilation anymore (removed PARAM_PGIC_ENABLED, PARAM_PGIC_INDIRECT_ENABLED, PARAM_PGIC_CAUSTIC_ENABLED, etc.).
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Reduce the number of OpenCL kernel compilations

Post by Dade »

Changing force black background flag doesn't require OpenCL compilation anymore (removed PARAM_FORCE_BLACK_BACKGROUND)

Changing variance clamping settings doesn't require OpenCL compilation anymore (removed PARAM_SQRT_VARIANCE_CLAMP_MAX_VALUE)

Changing LIGHT_WORLD_RADIUS_SCALE doesn't require OpenCL compilation anymore (removed PARAM_RADIUS)

Removed HitPoint struct variable size related to PARAM_ENABLE_TEX_HITPOINTCOLOR, PARAM_ENABLE_TEX_HITPOINTGREY, PARAM_ENABLE_TEX_HITPOINTALPHA and PARAM_TRIANGLE_LIGHT_HAS_VERTEX_COLOR to avoid OpenCL re-compilation

Enabling/disabling volumes doesn't require OpenCL compilation anymore (removed PARAM_HAS_VOLUMES and SCENE_DEFAULT_VOLUME_INDEX)
Support LuxCoreRender project with salts and bounties
Post Reply