Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-11-22 13:00:29 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-11-25 11:01:22 +0300
commit8bca34fe326d10cc2f20df7fa541179e9ba835d2 (patch)
treeaeab22e5e0ec3d4ee1a5fe8c37daee0be4a89bee /intern/cycles/kernel/kernel_types.h
parente6fff424dbcd02c3fed25036a7feb7f59d427843 (diff)
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).
Diffstat (limited to 'intern/cycles/kernel/kernel_types.h')
-rw-r--r--intern/cycles/kernel/kernel_types.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 5ccbc1de94c..e04f500e410 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -520,6 +520,18 @@ typedef ccl_addr_space struct Intersection {
#endif
} Intersection;
+/* Subsurface Intersection result */
+
+struct SubsurfaceIntersection
+{
+ Ray ray;
+ float3 weight[BSSRDF_MAX_HITS];
+
+ int num_hits;
+ struct Intersection hits[BSSRDF_MAX_HITS];
+ float3 Ng[BSSRDF_MAX_HITS];
+};
+
/* Primitives */
typedef enum PrimitiveType {