Fix for endiantest, xcode condition interferred with other os
[blender.git] / intern / cycles / kernel / kernel_types.h
index 85ee16fc5c6679ec8362d4c5274c5c106c0d93ee..7eab2176fa6bff983c417e2e02a4acfb4c990eae 100644 (file)
@@ -33,12 +33,17 @@ CCL_NAMESPACE_BEGIN
 #define LIGHT_SIZE                     4
 #define FILTER_TABLE_SIZE      256
 #define RAMP_TABLE_SIZE                256
+#define PARTICLE_SIZE          1
 #define TIME_INVALID           FLT_MAX
 
 /* device capabilities */
 #ifdef __KERNEL_CPU__
 #define __KERNEL_SHADING__
 #define __KERNEL_ADV_SHADING__
+#ifdef WITH_OSL
+#define __OSL__
+#endif
+#define __NON_PROGRESSIVE__
 #endif
 
 #ifdef __KERNEL_CUDA__
@@ -49,8 +54,30 @@ CCL_NAMESPACE_BEGIN
 #endif
 
 #ifdef __KERNEL_OPENCL__
-//#define __KERNEL_SHADING__
-//#define __KERNEL_ADV_SHADING__
+
+#ifdef __KERNEL_OPENCL_NVIDIA__
+#define __KERNEL_SHADING__
+#define __MULTI_CLOSURE__
+#endif
+
+#ifdef __KERNEL_OPENCL_APPLE__
+#define __SVM__
+#define __EMISSION__
+#define __IMAGE_TEXTURES__
+#define __HOLDOUT__
+#define __PROCEDURAL_TEXTURES__
+#define __EXTRA_NODES__
+#endif
+
+#ifdef __KERNEL_OPENCL_AMD__
+#define __SVM__
+#define __EMISSION__
+#define __IMAGE_TEXTURES__
+#define __HOLDOUT__
+#define __PROCEDURAL_TEXTURES__
+#define __EXTRA_NODES__
+#endif
+
 #endif
 
 /* kernel features */
@@ -69,7 +96,9 @@ CCL_NAMESPACE_BEGIN
 #ifdef __KERNEL_SHADING__
 #define __SVM__
 #define __EMISSION__
-#define __TEXTURES__
+#define __PROCEDURAL_TEXTURES__
+#define __IMAGE_TEXTURES__
+#define __EXTRA_NODES__
 #define __HOLDOUT__
 #endif
 
@@ -82,10 +111,7 @@ CCL_NAMESPACE_BEGIN
 //#define __MOTION__
 #endif
 
-//#define __MULTI_LIGHT__
-//#define __OSL__
 //#define __SOBOL_FULL_SCREEN__
-//#define __MODIFY_TP__
 //#define __QBVH__
 
 /* Shader Evaluation */
@@ -146,6 +172,8 @@ enum PathRayFlag {
 
        PATH_RAY_ALL = (1|2|4|8|16|32|64|128|256|512),
 
+       /* this gives collisions with localview bits
+        * see: CYCLES_LOCAL_LAYER_HACK(), grr - Campbell */
        PATH_RAY_LAYER_SHIFT = (32-20)
 };
 
@@ -173,25 +201,25 @@ typedef enum PassType {
        PASS_NONE = 0,
        PASS_COMBINED = 1,
        PASS_DEPTH = 2,
-       PASS_NORMAL = 8,
-       PASS_UV = 16,
-       PASS_OBJECT_ID = 32,
-       PASS_MATERIAL_ID = 64,
-       PASS_DIFFUSE_COLOR = 128,
-       PASS_GLOSSY_COLOR = 256,
-       PASS_TRANSMISSION_COLOR = 512,
-       PASS_DIFFUSE_INDIRECT = 1024,
-       PASS_GLOSSY_INDIRECT = 2048,
-       PASS_TRANSMISSION_INDIRECT = 4096,
-       PASS_DIFFUSE_DIRECT = 8192,
-       PASS_GLOSSY_DIRECT = 16384,
-       PASS_TRANSMISSION_DIRECT = 32768,
-       PASS_EMISSION = 65536,
-       PASS_BACKGROUND = 131072,
-       PASS_AO = 262144,
-       PASS_SHADOW = 524288,
-       PASS_MOTION = 1048576,
-       PASS_MOTION_WEIGHT = 2097152
+       PASS_NORMAL = 4,
+       PASS_UV = 8,
+       PASS_OBJECT_ID = 16,
+       PASS_MATERIAL_ID = 32,
+       PASS_DIFFUSE_COLOR = 64,
+       PASS_GLOSSY_COLOR = 128,
+       PASS_TRANSMISSION_COLOR = 256,
+       PASS_DIFFUSE_INDIRECT = 512,
+       PASS_GLOSSY_INDIRECT = 1024,
+       PASS_TRANSMISSION_INDIRECT = 2048,
+       PASS_DIFFUSE_DIRECT = 4096,
+       PASS_GLOSSY_DIRECT = 8192,
+       PASS_TRANSMISSION_DIRECT = 16384,
+       PASS_EMISSION = 32768,
+       PASS_BACKGROUND = 65536,
+       PASS_AO = 131072,
+       PASS_SHADOW = 262144,
+       PASS_MOTION = 524288,
+       PASS_MOTION_WEIGHT = 1048576
 } PassType;
 
 #define PASS_ALL (~0)
@@ -260,7 +288,8 @@ typedef enum LightType {
        LIGHT_DISTANT,
        LIGHT_BACKGROUND,
        LIGHT_AREA,
-       LIGHT_AO
+       LIGHT_AO,
+       LIGHT_SPOT
 } LightType;
 
 /* Camera Type */
@@ -268,7 +297,15 @@ typedef enum LightType {
 enum CameraType {
        CAMERA_PERSPECTIVE,
        CAMERA_ORTHOGRAPHIC,
-       CAMERA_ENVIRONMENT
+       CAMERA_PANORAMA
+};
+
+/* Panorama Type */
+
+enum PanoramaType {
+       PANORAMA_EQUIRECTANGULAR,
+       PANORAMA_FISHEYE_EQUIDISTANT,
+       PANORAMA_FISHEYE_EQUISOLID
 };
 
 /* Differential */
@@ -325,6 +362,7 @@ typedef enum AttributeStandard {
        ATTR_STD_POSITION_UNDISPLACED,
        ATTR_STD_MOTION_PRE,
        ATTR_STD_MOTION_POST,
+       ATTR_STD_PARTICLE,
        ATTR_STD_NUM,
 
        ATTR_STD_NOT_FOUND = ~0
@@ -452,7 +490,11 @@ typedef struct ShaderData {
 typedef struct KernelCamera {
        /* type */
        int type;
-       int pad1, pad2, pad3;
+
+       /* panorama */
+       int panorama_type;
+       float fisheye_fov;
+       float fisheye_lens;
 
        /* matrices */
        Transform cameratoworld;
@@ -476,6 +518,13 @@ typedef struct KernelCamera {
        float nearclip;
        float cliplength;
 
+       /* sensor size */
+       float sensorwidth;
+       float sensorheight;
+
+       /* render size */
+       float width, height;
+
        /* more matrices */
        Transform screentoworld;
        Transform rastertoworld;
@@ -580,6 +629,15 @@ typedef struct KernelIntegrator {
 
        /* clamp */
        float sample_clamp;
+
+       /* non-progressive */
+       int progressive;
+       int diffuse_samples;
+       int glossy_samples;
+       int transmission_samples;
+       int ao_samples;
+       int mesh_light_samples;
+       int pad1, pad2;
 } KernelIntegrator;
 
 typedef struct KernelBVH {