Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/integrator/integrator_state.h
| Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
| #pragma once | #pragma once | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| /* Constants | /* Constants | ||||
| * | * | ||||
| * TODO: these could be made dynamic depending on the features used in the scene. */ | * TODO: these could be made dynamic depending on the features used in the scene. */ | ||||
| #define INTEGRATOR_VOLUME_STACK_SIZE VOLUME_STACK_SIZE | |||||
| #define INTEGRATOR_SHADOW_ISECT_SIZE_CPU 1024 | #define INTEGRATOR_SHADOW_ISECT_SIZE_CPU 1024 | ||||
| #define INTEGRATOR_SHADOW_ISECT_SIZE_GPU 4 | #define INTEGRATOR_SHADOW_ISECT_SIZE_GPU 4 | ||||
| #ifdef __KERNEL_CPU__ | #ifdef __KERNEL_CPU__ | ||||
| # define INTEGRATOR_SHADOW_ISECT_SIZE INTEGRATOR_SHADOW_ISECT_SIZE_CPU | # define INTEGRATOR_SHADOW_ISECT_SIZE INTEGRATOR_SHADOW_ISECT_SIZE_CPU | ||||
| #else | #else | ||||
| # define INTEGRATOR_SHADOW_ISECT_SIZE INTEGRATOR_SHADOW_ISECT_SIZE_GPU | # define INTEGRATOR_SHADOW_ISECT_SIZE INTEGRATOR_SHADOW_ISECT_SIZE_GPU | ||||
| #endif | #endif | ||||
| /* Data structures */ | /* Data structures */ | ||||
| /* Integrator State | /* Integrator State | ||||
| * | * | ||||
| * CPU rendering path state with AoS layout. */ | * CPU rendering path state with AoS layout. */ | ||||
| typedef struct IntegratorStateCPU { | typedef struct IntegratorStateCPU { | ||||
| #define KERNEL_STRUCT_BEGIN(name) struct { | #define KERNEL_STRUCT_BEGIN(name) struct { | ||||
| #define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) type name; | #define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) type name; | ||||
| #define KERNEL_STRUCT_ARRAY_MEMBER KERNEL_STRUCT_MEMBER | #define KERNEL_STRUCT_ARRAY_MEMBER KERNEL_STRUCT_MEMBER | ||||
| #define KERNEL_STRUCT_END(name) \ | #define KERNEL_STRUCT_END(name) \ | ||||
| } \ | } \ | ||||
| name; | name; | ||||
| #define KERNEL_STRUCT_END_ARRAY(name, cpu_size, gpu_size) \ | #define KERNEL_STRUCT_END_ARRAY(name, cpu_size, gpu_size) \ | ||||
| } \ | } \ | ||||
| name[cpu_size]; | name[cpu_size]; | ||||
| #define KERNEL_STRUCT_VOLUME_STACK_SIZE MAX_VOLUME_STACK_SIZE | |||||
| #include "kernel/integrator/integrator_state_template.h" | #include "kernel/integrator/integrator_state_template.h" | ||||
| #undef KERNEL_STRUCT_BEGIN | #undef KERNEL_STRUCT_BEGIN | ||||
| #undef KERNEL_STRUCT_MEMBER | #undef KERNEL_STRUCT_MEMBER | ||||
| #undef KERNEL_STRUCT_ARRAY_MEMBER | #undef KERNEL_STRUCT_ARRAY_MEMBER | ||||
| #undef KERNEL_STRUCT_END | #undef KERNEL_STRUCT_END | ||||
| #undef KERNEL_STRUCT_END_ARRAY | #undef KERNEL_STRUCT_END_ARRAY | ||||
| #undef KERNEL_STRUCT_VOLUME_STACK_SIZE | |||||
| } IntegratorStateCPU; | } IntegratorStateCPU; | ||||
| /* Path Queue | /* Path Queue | ||||
| * | * | ||||
| * Keep track of which kernels are queued to be executed next in the path | * Keep track of which kernels are queued to be executed next in the path | ||||
| * for GPU rendering. */ | * for GPU rendering. */ | ||||
| typedef struct IntegratorQueueCounter { | typedef struct IntegratorQueueCounter { | ||||
| int num_queued[DEVICE_KERNEL_INTEGRATOR_NUM]; | int num_queued[DEVICE_KERNEL_INTEGRATOR_NUM]; | ||||
| } IntegratorQueueCounter; | } IntegratorQueueCounter; | ||||
| /* Integrator State GPU | /* Integrator State GPU | ||||
| * | * | ||||
| * GPU rendering path state with SoA layout. */ | * GPU rendering path state with SoA layout. */ | ||||
| typedef struct IntegratorStateGPU { | typedef struct IntegratorStateGPU { | ||||
| #define KERNEL_STRUCT_BEGIN(name) struct { | #define KERNEL_STRUCT_BEGIN(name) struct { | ||||
| #define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) type *name; | #define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) type *name; | ||||
| #define KERNEL_STRUCT_ARRAY_MEMBER KERNEL_STRUCT_MEMBER | #define KERNEL_STRUCT_ARRAY_MEMBER KERNEL_STRUCT_MEMBER | ||||
| #define KERNEL_STRUCT_END(name) \ | #define KERNEL_STRUCT_END(name) \ | ||||
| } \ | } \ | ||||
| name; | name; | ||||
| #define KERNEL_STRUCT_END_ARRAY(name, cpu_size, gpu_size) \ | #define KERNEL_STRUCT_END_ARRAY(name, cpu_size, gpu_size) \ | ||||
| } \ | } \ | ||||
| name[gpu_size]; | name[gpu_size]; | ||||
| #define KERNEL_STRUCT_VOLUME_STACK_SIZE MAX_VOLUME_STACK_SIZE | |||||
| #include "kernel/integrator/integrator_state_template.h" | #include "kernel/integrator/integrator_state_template.h" | ||||
| #undef KERNEL_STRUCT_BEGIN | #undef KERNEL_STRUCT_BEGIN | ||||
| #undef KERNEL_STRUCT_MEMBER | #undef KERNEL_STRUCT_MEMBER | ||||
| #undef KERNEL_STRUCT_ARRAY_MEMBER | #undef KERNEL_STRUCT_ARRAY_MEMBER | ||||
| #undef KERNEL_STRUCT_END | #undef KERNEL_STRUCT_END | ||||
| #undef KERNEL_STRUCT_END_ARRAY | #undef KERNEL_STRUCT_END_ARRAY | ||||
| #undef KERNEL_STRUCT_VOLUME_STACK_SIZE | |||||
| /* Count number of queued kernels. */ | /* Count number of queued kernels. */ | ||||
| IntegratorQueueCounter *queue_counter; | IntegratorQueueCounter *queue_counter; | ||||
| /* Count number of kernels queued for specific shaders. */ | /* Count number of kernels queued for specific shaders. */ | ||||
| int *sort_key_counter[DEVICE_KERNEL_INTEGRATOR_NUM]; | int *sort_key_counter[DEVICE_KERNEL_INTEGRATOR_NUM]; | ||||
| /* Index of path which will be used by a next shadow catcher split. */ | /* Index of path which will be used by a next shadow catcher split. */ | ||||
| ▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines | |||||