Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/types.h
| Show First 20 Lines • Show All 313 Lines • ▼ Show 20 Lines | typedef enum ClosureLabel { | ||||
| LABEL_GLOSSY = 8, | LABEL_GLOSSY = 8, | ||||
| LABEL_SINGULAR = 16, | LABEL_SINGULAR = 16, | ||||
| LABEL_TRANSPARENT = 32, | LABEL_TRANSPARENT = 32, | ||||
| LABEL_VOLUME_SCATTER = 64, | LABEL_VOLUME_SCATTER = 64, | ||||
| LABEL_TRANSMIT_TRANSPARENT = 128, | LABEL_TRANSMIT_TRANSPARENT = 128, | ||||
| LABEL_SUBSURFACE_SCATTER = 256, | LABEL_SUBSURFACE_SCATTER = 256, | ||||
| } ClosureLabel; | } ClosureLabel; | ||||
| /* Path events. */ | |||||
| /* Default events, we may have values for user defined labels as well. */ | |||||
| enum PathExpressionEvents { | |||||
| /* The ray just left the camera. */ | |||||
| PATH_EVENT_CAMERA, | |||||
| /* The ray is transmitted. */ | |||||
| PATH_EVENT_TRANSMIT, | |||||
| /* The ray is reflected. */ | |||||
| PATH_EVENT_REFLECT, | |||||
| /* The ray is scattered. */ | |||||
| PATH_EVENT_VOLUME_SCATTER, | |||||
| /* The ray ended at the background. */ | |||||
| PATH_EVENT_BACKGROUND, | |||||
| /* The ray hit a light. */ | |||||
| PATH_EVENT_LIGHT, | |||||
| /* The ray hit an object with an emission shader. */ | |||||
| PATH_EVENT_EMISSION_OBJECT, | |||||
| /* Custom Cycles event for obtaining the albedo. */ | |||||
| PATH_EVENT_ALBEDO, | |||||
| /* The ray hit a diffuse BSDF. */ | |||||
| PATH_EVENT_SCATTERING_DIFFUSE, | |||||
| /* The ray hit a glossy BSDF. */ | |||||
| PATH_EVENT_SCATTERING_GLOSSY, | |||||
| /* The ray hit a reflective or refractive BSDF. */ | |||||
| PATH_EVENT_SCATTERING_SINGULAR, | |||||
| /* The ray hit a transparent BSDF. */ | |||||
| PATH_EVENT_SCATTERING_STRAIGHT, | |||||
| /* Any event. */ | |||||
| PATH_EVENT_WILDCARD, | |||||
| /* This is not for stopping the path, it is for finalizing | |||||
| * a given transition update. */ | |||||
| PATH_EVENT_STOP, | |||||
| NUM_DEFAULT_PATH_EVENTS, | |||||
| PATH_EVENT_INVALID = -1, | |||||
| PATH_EVENT_LABEL_NONE = -1, | |||||
| }; | |||||
| /* Render Passes */ | /* Render Passes */ | ||||
| #define PASS_NAME_JOIN(a, b) a##_##b | #define PASS_NAME_JOIN(a, b) a##_##b | ||||
| #define PASSMASK(pass) (1 << ((PASS_NAME_JOIN(PASS, pass)) % 32)) | #define PASSMASK(pass) (1 << ((PASS_NAME_JOIN(PASS, pass)) % 32)) | ||||
| // NOTE: Keep in sync with `Pass::get_type_enum()`. | // NOTE: Keep in sync with `Pass::get_type_enum()`. | ||||
| typedef enum PassType { | typedef enum PassType { | ||||
| PASS_NONE = 0, | PASS_NONE = 0, | ||||
| Show All 26 Lines | typedef enum PassType { | ||||
| PASS_UV, | PASS_UV, | ||||
| PASS_OBJECT_ID, | PASS_OBJECT_ID, | ||||
| PASS_MATERIAL_ID, | PASS_MATERIAL_ID, | ||||
| PASS_MOTION, | PASS_MOTION, | ||||
| PASS_MOTION_WEIGHT, | PASS_MOTION_WEIGHT, | ||||
| PASS_CRYPTOMATTE, | PASS_CRYPTOMATTE, | ||||
| PASS_AOV_COLOR, | PASS_AOV_COLOR, | ||||
| PASS_AOV_VALUE, | PASS_AOV_VALUE, | ||||
| /* Implicitely a PASS_AOV_COLOR. */ | |||||
| PASS_AOV_LPE, | |||||
| PASS_ADAPTIVE_AUX_BUFFER, | PASS_ADAPTIVE_AUX_BUFFER, | ||||
| PASS_SAMPLE_COUNT, | PASS_SAMPLE_COUNT, | ||||
| PASS_DIFFUSE_COLOR, | PASS_DIFFUSE_COLOR, | ||||
| PASS_GLOSSY_COLOR, | PASS_GLOSSY_COLOR, | ||||
| PASS_TRANSMISSION_COLOR, | PASS_TRANSMISSION_COLOR, | ||||
| /* No Scatter color since it's tricky to define what it would even mean. */ | /* No Scatter color since it's tricky to define what it would even mean. */ | ||||
| PASS_MIST, | PASS_MIST, | ||||
| PASS_DENOISING_NORMAL, | PASS_DENOISING_NORMAL, | ||||
| ▲ Show 20 Lines • Show All 770 Lines • ▼ Show 20 Lines | |||||
| static_assert_align(KernelBake, 16); | static_assert_align(KernelBake, 16); | ||||
| typedef struct KernelData { | typedef struct KernelData { | ||||
| /* Features and limits. */ | /* Features and limits. */ | ||||
| uint kernel_features; | uint kernel_features; | ||||
| uint max_closures; | uint max_closures; | ||||
| uint max_shaders; | uint max_shaders; | ||||
| uint volume_stack_size; | uint volume_stack_size; | ||||
| uint has_lpes; | |||||
| /* Always dynamic data members. */ | /* Always dynamic data members. */ | ||||
| KernelCamera cam; | KernelCamera cam; | ||||
| KernelBake bake; | KernelBake bake; | ||||
| KernelTables tables; | KernelTables tables; | ||||
| /* Potentially specialized data members. */ | /* Potentially specialized data members. */ | ||||
| #define KERNEL_STRUCT_BEGIN(name, parent) name parent; | #define KERNEL_STRUCT_BEGIN(name, parent) name parent; | ||||
| ▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | typedef struct KernelObject { | ||||
| int lightgroup; | int lightgroup; | ||||
| uint visibility; | uint visibility; | ||||
| int primitive_type; | int primitive_type; | ||||
| /* Volume velocity scale. */ | /* Volume velocity scale. */ | ||||
| float velocity_scale; | float velocity_scale; | ||||
| int lpe_tag_index; | |||||
| } KernelObject; | } KernelObject; | ||||
| static_assert_align(KernelObject, 16); | static_assert_align(KernelObject, 16); | ||||
| typedef struct KernelCurve { | typedef struct KernelCurve { | ||||
| int shader_id; | int shader_id; | ||||
| int first_key; | int first_key; | ||||
| int num_keys; | int num_keys; | ||||
| int type; | int type; | ||||
| Show All 35 Lines | |||||
| typedef struct KernelLight { | typedef struct KernelLight { | ||||
| int type; | int type; | ||||
| float co[3]; | float co[3]; | ||||
| int shader_id; | int shader_id; | ||||
| float max_bounces; | float max_bounces; | ||||
| float random; | float random; | ||||
| float strength[3]; | float strength[3]; | ||||
| int lpe_tag_index; | |||||
| int use_caustics; | int use_caustics; | ||||
| int lightgroup; | int lightgroup; | ||||
| Transform tfm; | Transform tfm; | ||||
| Transform itfm; | Transform itfm; | ||||
| union { | union { | ||||
| KernelSpotLight spot; | KernelSpotLight spot; | ||||
| KernelAreaLight area; | KernelAreaLight area; | ||||
| KernelDistantLight distant; | KernelDistantLight distant; | ||||
| ▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | |||||
| typedef struct KernelShaderEvalInput { | typedef struct KernelShaderEvalInput { | ||||
| int object; | int object; | ||||
| int prim; | int prim; | ||||
| float u, v; | float u, v; | ||||
| } KernelShaderEvalInput; | } KernelShaderEvalInput; | ||||
| static_assert_align(KernelShaderEvalInput, 16); | static_assert_align(KernelShaderEvalInput, 16); | ||||
| /* Light Path Expression Automata. */ | |||||
| typedef struct KernelLightPathState { | |||||
| /* Index of the first transition in this state in light_path_transitions. */ | |||||
| uint start_transition; | |||||
| uint num_transitions; | |||||
| /* Index of the first active AOV in this state in light_path_aovs. */ | |||||
| uint start_aovs; | |||||
| uint num_aovs; | |||||
| int wildcard_transition; | |||||
| int pad1, pad2, pad3; | |||||
| } KernelLightPathState; | |||||
| static_assert_align(KernelLightPathState, 16); | |||||
| typedef struct KernelLightPathTransition { | |||||
| int symbol; | |||||
| int state; | |||||
| } KernelLightPathTransition; | |||||
| /* Pre-computed sample table sizes for PMJ02 sampler. | /* Pre-computed sample table sizes for PMJ02 sampler. | ||||
| * | * | ||||
| * NOTE: divisions *must* be a power of two, and patterns | * NOTE: divisions *must* be a power of two, and patterns | ||||
| * ideally should be as well. | * ideally should be as well. | ||||
| */ | */ | ||||
| #define NUM_PMJ_DIVISIONS 32 | #define NUM_PMJ_DIVISIONS 32 | ||||
| #define NUM_PMJ_SAMPLES ((NUM_PMJ_DIVISIONS) * (NUM_PMJ_DIVISIONS)) | #define NUM_PMJ_SAMPLES ((NUM_PMJ_DIVISIONS) * (NUM_PMJ_DIVISIONS)) | ||||
| #define NUM_PMJ_PATTERNS 64 | #define NUM_PMJ_PATTERNS 64 | ||||
| ▲ Show 20 Lines • Show All 176 Lines • Show Last 20 Lines | |||||