From e949d6da5bd347663addd583ff3f0211c96b81c8 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 11 Aug 2022 16:53:11 +0200 Subject: Cycles: simplify handling of ray differentials * Store compact ray differentials in ShaderData and compute full differentials on demand. This reduces register pressure on the GPU. * Remove BSDF differential code that was effectively doing nothing as the differential orientation was discarded when making it compact. This gives a 1-5% speedup with RTX A6000 + OptiX in our benchmarks, with the bigger speedups in simpler scenes. Renders appear to be identical except for the Both displacement option that does both displacement and bump. Differential Revision: https://developer.blender.org/D15677 --- intern/cycles/kernel/types.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'intern/cycles/kernel/types.h') diff --git a/intern/cycles/kernel/types.h b/intern/cycles/kernel/types.h index 252c27a40f0..59ea6c64be7 100644 --- a/intern/cycles/kernel/types.h +++ b/intern/cycles/kernel/types.h @@ -873,10 +873,10 @@ typedef struct ccl_align(16) ShaderData float ray_length; #ifdef __RAY_DIFFERENTIALS__ - /* differential of P. these are orthogonal to Ng, not N */ - differential3 dP; - /* differential of I */ - differential3 dI; + /* Radius of differential of P. */ + float dP; + /* Radius of differential of I. */ + float dI; /* differential of u, v */ differential du; differential dv; -- cgit v1.2.3