diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-10-21 18:00:37 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-10-21 22:25:34 +0300 |
commit | be558d2d9775b3d9d1f84d316d2675a205932d92 (patch) | |
tree | 0e3430fea912756561ed6a9fed32515c5dc75219 /intern/cycles/kernel/integrator | |
parent | aea2287af33c17c5f310ddb20f57d23d2cbe09ac (diff) |
Fix T92363: OptiX fails with ambient occlusion node, after recent changes
This triggered a compiler bug where it does not handle the sub.s16 PTX
instruction. Instead refactor the code so we don't need to do uint16_t
subtraction at all.
Also update OptiX device to remove the AO pass direct callable.
Thanks Patrick Mours for figuring this out.
Diffstat (limited to 'intern/cycles/kernel/integrator')
3 files changed, 7 insertions, 9 deletions
diff --git a/intern/cycles/kernel/integrator/integrator_shade_shadow.h b/intern/cycles/kernel/integrator/integrator_shade_shadow.h index 2d056a0b76f..a82254e1dea 100644 --- a/intern/cycles/kernel/integrator/integrator_shade_shadow.h +++ b/intern/cycles/kernel/integrator/integrator_shade_shadow.h @@ -136,6 +136,7 @@ ccl_device_inline bool integrate_transparent_shadow(KernelGlobals kg, INTEGRATOR_STATE_WRITE(state, shadow_path, throughput) = throughput; INTEGRATOR_STATE_WRITE(state, shadow_path, transparent_bounce) += 1; + INTEGRATOR_STATE_WRITE(state, shadow_path, rng_offset) += PRNG_BOUNCE_NUM; } /* Note we do not need to check max_transparent_bounce here, the number diff --git a/intern/cycles/kernel/integrator/integrator_shade_surface.h b/intern/cycles/kernel/integrator/integrator_shade_surface.h index 2fb0dcc2097..3724b05c6b0 100644 --- a/intern/cycles/kernel/integrator/integrator_shade_surface.h +++ b/intern/cycles/kernel/integrator/integrator_shade_surface.h @@ -200,9 +200,8 @@ ccl_device_forceinline void integrate_surface_direct_light(KernelGlobals kg, INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, render_pixel_index) = INTEGRATOR_STATE( state, path, render_pixel_index); - INTEGRATOR_STATE_WRITE( - shadow_state, shadow_path, rng_offset) = INTEGRATOR_STATE(state, path, rng_offset) - - PRNG_BOUNCE_NUM * transparent_bounce; + INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, rng_offset) = INTEGRATOR_STATE( + state, path, rng_offset); INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, rng_hash) = INTEGRATOR_STATE( state, path, rng_hash); INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, sample) = INTEGRATOR_STATE( @@ -370,9 +369,8 @@ ccl_device_forceinline void integrate_surface_ao_pass( INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, render_pixel_index) = INTEGRATOR_STATE( state, path, render_pixel_index); - INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, rng_offset) = - INTEGRATOR_STATE(state, path, rng_offset) - - PRNG_BOUNCE_NUM * INTEGRATOR_STATE(state, path, transparent_bounce); + INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, rng_offset) = INTEGRATOR_STATE( + state, path, rng_offset); INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, rng_hash) = INTEGRATOR_STATE( state, path, rng_hash); INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, sample) = INTEGRATOR_STATE( diff --git a/intern/cycles/kernel/integrator/integrator_shade_volume.h b/intern/cycles/kernel/integrator/integrator_shade_volume.h index 1dd701237a8..d0aabb550c0 100644 --- a/intern/cycles/kernel/integrator/integrator_shade_volume.h +++ b/intern/cycles/kernel/integrator/integrator_shade_volume.h @@ -799,9 +799,8 @@ ccl_device_forceinline void integrate_volume_direct_light( INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, render_pixel_index) = INTEGRATOR_STATE( state, path, render_pixel_index); - INTEGRATOR_STATE_WRITE( - shadow_state, shadow_path, rng_offset) = INTEGRATOR_STATE(state, path, rng_offset) - - PRNG_BOUNCE_NUM * transparent_bounce; + INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, rng_offset) = INTEGRATOR_STATE( + state, path, rng_offset); INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, rng_hash) = INTEGRATOR_STATE( state, path, rng_hash); INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, sample) = INTEGRATOR_STATE( |