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:
authorStefan Werner <stefan.werner@tangent-animation.com>2018-03-08 02:15:41 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-03-10 06:54:04 +0300
commitfa9175ff02acffd02679398e17732f3832d3fc28 (patch)
tree2191527cffc89357f605aeeeded876ff5fcbfe6d /intern/cycles/kernel/kernel_types.h
parentf66ff4ee86a9ead9ef6f3776b64f4dda32eab521 (diff)
Code refactor: use KernelLight instead of float4 arrays.
Original patch by Stefan with modifications by Brecht.
Diffstat (limited to 'intern/cycles/kernel/kernel_types.h')
-rw-r--r--intern/cycles/kernel/kernel_types.h56
1 files changed, 55 insertions, 1 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index b6f1a3a6d98..198ce39c63f 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -36,7 +36,6 @@ CCL_NAMESPACE_BEGIN
/* Constants */
#define OBJECT_VECTOR_SIZE 6
-#define LIGHT_SIZE 11
#define FILTER_TABLE_SIZE 1024
#define RAMP_TABLE_SIZE 256
#define SHUTTER_TABLE_SIZE 256
@@ -1456,6 +1455,61 @@ typedef struct KernelObject {
} KernelObject;;
static_assert_align(KernelObject, 16);
+typedef struct KernelSpotLight {
+ float radius;
+ float invarea;
+ float spot_angle;
+ float spot_smooth;
+ float dir[3];
+} KernelSpotLight;
+
+/* PointLight is SpotLight with only radius and invarea being used. */
+
+typedef struct KernelAreaLight {
+ float axisu[3];
+ float invarea;
+ float axisv[3];
+ float dir[3];
+} KernelAreaLight;
+
+typedef struct KernelDistantLight {
+ float radius;
+ float cosangle;
+ float invarea;
+} KernelDistantLight;
+
+typedef struct KernelLight {
+ int type;
+ float co[3];
+ int shader_id;
+ int samples;
+ float max_bounces;
+ float random;
+ float4 tfm[3];
+ float4 itfm[3];
+ union {
+ KernelSpotLight spot;
+ KernelAreaLight area;
+ KernelDistantLight distant;
+ };
+} KernelLight;
+static_assert_align(KernelLight, 16);
+
+typedef struct KernelLightDistribution {
+ float totarea;
+ int prim;
+ union {
+ struct {
+ int shader_flag;
+ int object_id;
+ } mesh_light;
+ struct {
+ float pad;
+ float size;
+ } lamp;
+ };
+} KernelLightDistribution;
+static_assert_align(KernelLightDistribution, 16);
/* Declarations required for split kernel */