Cysles: Avoid having ShaderData on the stack
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 22 Nov 2015 10:00:29 +0000 (15:00 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 25 Nov 2015 08:01:22 +0000 (13:01 +0500)
commit8bca34fe326d10cc2f20df7fa541179e9ba835d2
treeaeab22e5e0ec3d4ee1a5fe8c37daee0be4a89bee
parente6fff424dbcd02c3fed25036a7feb7f59d427843
Cysles: Avoid having ShaderData on the stack

This commit introduces a SSS-oriented intersection structure which is replacing
old logic of having separate arrays for just intersections and shader data and
encapsulates all the data needed for SSS evaluation.

This giver a huge stack memory saving on GPU. In own experiments it gave 25%
memory usage reduction on GTX560Ti (722MB vs. 946MB).

Unfortunately, this gave some performance loss of 20% which only happens on GPU.
This is perhaps due to different memory access pattern. Will be solved in the
future, hopefully.

Famous saying: won in memory - lost in time (which is also valid in other way
around).
intern/cycles/kernel/geom/geom_bvh.h
intern/cycles/kernel/geom/geom_bvh_subsurface.h
intern/cycles/kernel/geom/geom_motion_triangle.h
intern/cycles/kernel/geom/geom_qbvh_subsurface.h
intern/cycles/kernel/geom/geom_triangle_intersect.h
intern/cycles/kernel/kernel_path.h
intern/cycles/kernel/kernel_path_branched.h
intern/cycles/kernel/kernel_subsurface.h
intern/cycles/kernel/kernel_types.h