diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-04-06 23:37:50 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-04-07 00:23:48 +0300 |
commit | 10f0e003a95a9d28be162605d7985c4d4620f6c0 (patch) | |
tree | 74fb6db571f27909a1a033fae5f34e057de5b7be /intern/cycles/kernel | |
parent | e05552f7c4ac27faa510048e8c010e4323acb569 (diff) |
Fix T74572: adaptive sampling not scaling AOVs correctly
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r-- | intern/cycles/kernel/kernel_adaptive_sampling.h | 9 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_types.h | 6 |
2 files changed, 13 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_adaptive_sampling.h b/intern/cycles/kernel/kernel_adaptive_sampling.h index 047fe8c92ec..ee4d1507ef1 100644 --- a/intern/cycles/kernel/kernel_adaptive_sampling.h +++ b/intern/cycles/kernel/kernel_adaptive_sampling.h @@ -150,6 +150,7 @@ ccl_device void kernel_adaptive_post_adjust(KernelGlobals *kg, } #endif /* __DENOISING_FEATURES__ */ + /* Cryptomatte. */ if (kernel_data.film.cryptomatte_passes) { int num_slots = 0; num_slots += (kernel_data.film.cryptomatte_passes & CRYPT_OBJECT) ? 1 : 0; @@ -162,6 +163,14 @@ ccl_device void kernel_adaptive_post_adjust(KernelGlobals *kg, id_buffer[slot].y *= sample_multiplier; } } + + /* AOVs. */ + for (int i = 0; i < kernel_data.film.pass_aov_value_num; i++) { + *(buffer + kernel_data.film.pass_aov_value + i) *= sample_multiplier; + } + for (int i = 0; i < kernel_data.film.pass_aov_color_num; i++) { + *((ccl_global float4 *)(buffer + kernel_data.film.pass_aov_color) + i) *= sample_multiplier; + } } /* This is a simple box filter in two passes. diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index b6d319311a1..44c936da626 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -1242,7 +1242,9 @@ typedef struct KernelFilm { int pass_aov_color; int pass_aov_value; - int pad1; + int pass_aov_color_num; + int pass_aov_value_num; + int pad1, pad2, pad3; /* XYZ to rendering color space transform. float4 instead of float3 to * ensure consistent padding/alignment across devices. */ @@ -1265,7 +1267,7 @@ typedef struct KernelFilm { int use_display_exposure; int use_display_pass_alpha; - int pad3, pad4, pad5; + int pad4, pad5, pad6; } KernelFilm; static_assert_align(KernelFilm, 16); |