[Bf-blender-cvs] [fe2ec0ae136] cycles_path_guiding: Cleanup: rename/tweak film accumulation functions for consistency with guiding

Brecht Van Lommel noreply at git.blender.org
Thu Aug 25 21:57:39 CEST 2022


Commit: fe2ec0ae1367c9464d8315e42f0d385ca9c1da7c
Author: Brecht Van Lommel
Date:   Thu Aug 25 18:19:14 2022 +0200
Branches: cycles_path_guiding
https://developer.blender.org/rBfe2ec0ae1367c9464d8315e42f0d385ca9c1da7c

Cleanup: rename/tweak film accumulation functions for consistency with guiding

===================================================================

M	intern/cycles/kernel/film/accumulate.h
M	intern/cycles/kernel/integrator/init_from_bake.h
M	intern/cycles/kernel/integrator/init_from_camera.h
M	intern/cycles/kernel/integrator/shade_background.h
M	intern/cycles/kernel/integrator/shade_light.h
M	intern/cycles/kernel/integrator/shade_shadow.h
M	intern/cycles/kernel/integrator/shade_surface.h
M	intern/cycles/kernel/integrator/shade_volume.h

===================================================================

diff --git a/intern/cycles/kernel/film/accumulate.h b/intern/cycles/kernel/film/accumulate.h
index 97ec915a8ad..4dde085cc83 100644
--- a/intern/cycles/kernel/film/accumulate.h
+++ b/intern/cycles/kernel/film/accumulate.h
@@ -95,9 +95,7 @@ ccl_device_inline Spectrum bsdf_eval_pass_glossy_weight(ccl_private const BsdfEv
  * to render buffers instead of using per-thread memory, and to avoid the
  * impact of clamping on other contributions. */
 
-ccl_device_forceinline void kernel_accum_clamp(KernelGlobals kg,
-                                               ccl_private Spectrum *L,
-                                               int bounce)
+ccl_device_forceinline void film_accum_clamp(KernelGlobals kg, ccl_private Spectrum *L, int bounce)
 {
 #ifdef __KERNEL_DEBUG_NAN__
   if (!isfinite_safe(*L)) {
@@ -124,7 +122,7 @@ ccl_device_forceinline void kernel_accum_clamp(KernelGlobals kg,
  */
 
 /* Get pointer to pixel in render buffer. */
-ccl_device_forceinline ccl_global float *kernel_accum_pixel_render_buffer(
+ccl_device_forceinline ccl_global float *film_accum_pixel_render_buffer(
     KernelGlobals kg, ConstIntegratorState state, ccl_global float *ccl_restrict render_buffer)
 {
   const uint32_t render_pixel_index = INTEGRATOR_STATE(state, path, render_pixel_index);
@@ -137,27 +135,27 @@ ccl_device_forceinline ccl_global float *kernel_accum_pixel_render_buffer(
  * Adaptive sampling.
  */
 
-ccl_device_inline int kernel_accum_sample(KernelGlobals kg,
-                                          ConstIntegratorState state,
-                                          ccl_global float *ccl_restrict render_buffer,
-                                          int sample,
-                                          int sample_offset)
+ccl_device_inline int film_accum_sample(KernelGlobals kg,
+                                        ConstIntegratorState state,
+                                        ccl_global float *ccl_restrict render_buffer,
+                                        int sample,
+                                        int sample_offset)
 {
   if (kernel_data.film.pass_sample_count == PASS_UNUSED) {
     return sample;
   }
 
-  ccl_global float *buffer = kernel_accum_pixel_render_buffer(kg, state, render_buffer);
+  ccl_global float *buffer = film_accum_pixel_render_buffer(kg, state, render_buffer);
 
   return atomic_fetch_and_add_uint32(
              (ccl_global uint *)(buffer) + kernel_data.film.pass_sample_count, 1) +
          sample_offset;
 }
 
-ccl_device void kernel_accum_adaptive_buffer(KernelGlobals kg,
-                                             const int sample,
-                                             const Spectrum contribution,
-                                             ccl_global float *ccl_restrict buffer)
+ccl_device void film_accum_adaptive_buffer(KernelGlobals kg,
+                                           const int sample,
+                                           const Spectrum contribution,
+                                           ccl_global float *ccl_restrict buffer)
 {
   /* Adaptive Sampling. Fill the additional buffer with the odd samples and calculate our stopping
    * criteria. This is the heuristic from "A hierarchical automatic stopping condition for Monte
@@ -190,10 +188,10 @@ ccl_device void kernel_accum_adaptive_buffer(KernelGlobals kg,
  * Returns truth if the contribution is fully handled here and is not to be added to the other
  * passes (like combined, adaptive sampling). */
 
-ccl_device bool kernel_accum_shadow_catcher(KernelGlobals kg,
-                                            const uint32_t path_flag,
-                                            const Spectrum contribution,
-                                            ccl_global float *ccl_restrict buffer)
+ccl_device bool film_accum_shadow_catcher(KernelGlobals kg,
+                                          const uint32_t path_flag,
+                                          const Spectrum contribution,
+                                          ccl_global float *ccl_restrict buffer)
 {
   if (!kernel_data.integrator.has_shadow_catcher) {
     return false;
@@ -219,11 +217,11 @@ ccl_device bool kernel_accum_shadow_catcher(KernelGlobals kg,
   return false;
 }
 
-ccl_device bool kernel_accum_shadow_catcher_transparent(KernelGlobals kg,
-                                                        const uint32_t path_flag,
-                                                        const Spectrum contribution,
-                                                        const float transparent,
-                                                        ccl_global float *ccl_restrict buffer)
+ccl_device bool film_accum_shadow_catcher_transparent(KernelGlobals kg,
+                                                      const uint32_t path_flag,
+                                                      const Spectrum contribution,
+                                                      const float transparent,
+                                                      ccl_global float *ccl_restrict buffer)
 {
   if (!kernel_data.integrator.has_shadow_catcher) {
     return false;
@@ -260,10 +258,10 @@ ccl_device bool kernel_accum_shadow_catcher_transparent(KernelGlobals kg,
   return false;
 }
 
-ccl_device void kernel_accum_shadow_catcher_transparent_only(KernelGlobals kg,
-                                                             const uint32_t path_flag,
-                                                             const float transparent,
-                                                             ccl_global float *ccl_restrict buffer)
+ccl_device void film_accum_shadow_catcher_transparent_only(KernelGlobals kg,
+                                                           const uint32_t path_flag,
+                                                           const float transparent,
+                                                           ccl_global float *ccl_restrict buffer)
 {
   if (!kernel_data.integrator.has_shadow_catcher) {
     return;
@@ -284,14 +282,14 @@ ccl_device void kernel_accum_shadow_catcher_transparent_only(KernelGlobals kg,
  */
 
 /* Write combined pass. */
-ccl_device_inline void kernel_accum_combined_pass(KernelGlobals kg,
-                                                  const uint32_t path_flag,
-                                                  const int sample,
-                                                  const Spectrum contribution,
-                                                  ccl_global float *ccl_restrict buffer)
+ccl_device_inline void film_accum_combined_pass(KernelGlobals kg,
+                                                const uint32_t path_flag,
+                                                const int sample,
+                                                const Spectrum contribution,
+                                                ccl_global float *ccl_restrict buffer)
 {
 #ifdef __SHADOW_CATCHER__
-  if (kernel_accum_shadow_catcher(kg, path_flag, contribution, buffer)) {
+  if (film_accum_shadow_catcher(kg, path_flag, contribution, buffer)) {
     return;
   }
 #endif
@@ -300,20 +298,19 @@ ccl_device_inline void kernel_accum_combined_pass(KernelGlobals kg,
     kernel_write_pass_spectrum(buffer + kernel_data.film.pass_combined, contribution);
   }
 
-  kernel_accum_adaptive_buffer(kg, sample, contribution, buffer);
+  film_accum_adaptive_buffer(kg, sample, contribution, buffer);
 }
 
 /* Write combined pass with transparency. */
-ccl_device_inline void kernel_accum_combined_transparent_pass(KernelGlobals kg,
-                                                              const uint32_t path_flag,
-                                                              const int sample,
-                                                              const Spectrum contribution,
-                                                              const float transparent,
-                                                              ccl_global float *ccl_restrict
-                                                                  buffer)
+ccl_device_inline void film_accum_combined_transparent_pass(KernelGlobals kg,
+                                                            const uint32_t path_flag,
+                                                            const int sample,
+                                                            const Spectrum contribution,
+                                                            const float transparent,
+                                                            ccl_global float *ccl_restrict buffer)
 {
 #ifdef __SHADOW_CATCHER__
-  if (kernel_accum_shadow_catcher_transparent(kg, path_flag, contribution, transparent, buffer)) {
+  if (film_accum_shadow_catcher_transparent(kg, path_flag, contribution, transparent, buffer)) {
     return;
   }
 #endif
@@ -326,11 +323,11 @@ ccl_device_inline void kernel_accum_combined_transparent_pass(KernelGlobals kg,
         make_float4(contribution_rgb.x, contribution_rgb.y, contribution_rgb.z, transparent));
   }
 
-  kernel_accum_adaptive_buffer(kg, sample, contribution, buffer);
+  film_accum_adaptive_buffer(kg, sample, contribution, buffer);
 }
 
 /* Write background or emission to appropriate pass. */
-ccl_device_inline void kernel_accum_emission_or_background_pass(
+ccl_device_inline void film_accum_emission_or_background_pass(
     KernelGlobals kg,
     ConstIntegratorState state,
     Spectrum contribution,
@@ -425,13 +422,13 @@ ccl_device_inline void kernel_accum_emission_or_background_pass(
 }
 
 /* Write light contribution to render buffer. */
-ccl_device_inline void kernel_accum_light(KernelGlobals kg,
-                                          ConstIntegratorShadowState state,
-                                          ccl_global float *ccl_restrict render_buffer)
+ccl_device_inline void film_accum_direct_light(KernelGlobals kg,
+                                               ConstIntegratorShadowState state,
+                                               ccl_global float *ccl_restrict render_buffer)
 {
   /* The throughput for shadow paths already contains the light shader evaluation. */
   Spectrum contribut

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list