Blender V5.3
path_trace_work_gpu.cpp File Reference

Go to the source code of this file.

Macros

#define KERNEL_STRUCT_VOLUME_STACK_SIZE   (volume_stack_size)
#define KERNEL_STRUCT_BEGIN(name)
#define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature)
#define KERNEL_STRUCT_MEMBER_PACKED   KERNEL_STRUCT_MEMBER
#define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature)
#define KERNEL_STRUCT_ARRAY_MEMBER(parent_struct, type, name, feature)
#define KERNEL_STRUCT_END(name)
#define KERNEL_STRUCT_END_ARRAY(name, cpu_array_size, gpu_array_size)
#define KERNEL_STRUCT_BEGIN(name)
#define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature)
#define KERNEL_STRUCT_MEMBER_PACKED   KERNEL_STRUCT_MEMBER
#define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature)
#define KERNEL_STRUCT_ARRAY_MEMBER(parent_struct, type, name, feature)
#define KERNEL_STRUCT_END(name)
#define KERNEL_STRUCT_END_ARRAY(name, cpu_array_size, gpu_array_size)
#define KERNEL_STRUCT_VOLUME_STACK_SIZE   (integrator_state_soa_volume_stack_size_)

Functions

static CCL_NAMESPACE_BEGIN size_t estimate_single_state_size (const uint64_t kernel_features, const int volume_stack_size)

Macro Definition Documentation

◆ KERNEL_STRUCT_ARRAY_MEMBER [1/2]

#define KERNEL_STRUCT_ARRAY_MEMBER ( parent_struct,
type,
name,
feature )
Value:
integrator_state_gpu_.parent_struct[array_index].name = nullptr; \
if (KernelFeatureRequest(feature).test(kernel_features)) { \
string name_str = string_printf( \
"%sintegrator_state_" #name "_%d", shadow ? "shadow_" : "", array_index); \
auto array = make_unique<device_only_memory<gpu_state_storage<type>::gpu_type>>( \
device_, name_str.c_str()); \
array->alloc_to_device(max_num_paths_); \
memcpy(&integrator_state_gpu_.parent_struct[array_index].name, \
&array->device_pointer, \
sizeof(array->device_pointer)); \
integrator_state_soa_.emplace_back(std::move(array)); \
}
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
Definition string.cpp:25
KernelFeatureRequest(const uint64_t on)
Definition features.h:237

◆ KERNEL_STRUCT_ARRAY_MEMBER [2/2]

#define KERNEL_STRUCT_ARRAY_MEMBER ( parent_struct,
type,
name,
feature )
Value:
state_size += (KernelFeatureRequest(feature).test(kernel_features)) ? \
0;

Referenced by KERNEL_STRUCT_MEMBER_PACKED(), and KernelFeatureRequest().

◆ KERNEL_STRUCT_BEGIN [1/2]

#define KERNEL_STRUCT_BEGIN ( name)
Value:
for (int array_index = 0;; array_index++) {

◆ KERNEL_STRUCT_BEGIN [2/2]

#define KERNEL_STRUCT_BEGIN ( name)
Value:
for (int array_index = 0;; array_index++) {

Referenced by KERNEL_STRUCT_MEMBER_PACKED(), and KernelFeatureRequest().

◆ KERNEL_STRUCT_BEGIN_PACKED [1/2]

#define KERNEL_STRUCT_BEGIN_PACKED ( parent_struct,
feature )
Value:
KERNEL_STRUCT_BEGIN(parent_struct)
#define KERNEL_STRUCT_BEGIN(name)

◆ KERNEL_STRUCT_BEGIN_PACKED [2/2]

#define KERNEL_STRUCT_BEGIN_PACKED ( parent_struct,
feature )
Value:
KERNEL_STRUCT_BEGIN(parent_struct)

Referenced by KernelFeatureRequest().

◆ KERNEL_STRUCT_END [1/2]

#define KERNEL_STRUCT_END ( name)
Value:
(void)array_index; \
break; \
}

◆ KERNEL_STRUCT_END [2/2]

#define KERNEL_STRUCT_END ( name)
Value:
(void)array_index; \
break; \
}

Referenced by KERNEL_STRUCT_MEMBER_PACKED(), and KernelFeatureRequest().

◆ KERNEL_STRUCT_END_ARRAY [1/2]

#define KERNEL_STRUCT_END_ARRAY ( name,
cpu_array_size,
gpu_array_size )
Value:
if (array_index >= gpu_array_size - 1) { \
break; \
} \
}

◆ KERNEL_STRUCT_END_ARRAY [2/2]

#define KERNEL_STRUCT_END_ARRAY ( name,
cpu_array_size,
gpu_array_size )
Value:
if (array_index >= gpu_array_size - 1) { \
break; \
} \
}

Referenced by KERNEL_STRUCT_MEMBER_PACKED(), and KernelFeatureRequest().

◆ KERNEL_STRUCT_MEMBER [1/2]

#define KERNEL_STRUCT_MEMBER ( parent_struct,
type,
name,
feature )
Value:
integrator_state_gpu_.parent_struct.name = nullptr; \
if (KernelFeatureRequest(feature).test(kernel_features)) { \
string name_str = string_printf("%sintegrator_state_" #parent_struct "_" #name, \
shadow ? "shadow_" : ""); \
auto array = make_unique<device_only_memory<gpu_state_storage<type>::gpu_type>>( \
device_, name_str.c_str()); \
array->alloc_to_device(max_num_paths_); \
memcpy(&integrator_state_gpu_.parent_struct.name, \
&array->device_pointer, \
sizeof(array->device_pointer)); \
integrator_state_soa_.emplace_back(std::move(array)); \
}

◆ KERNEL_STRUCT_MEMBER [2/2]

#define KERNEL_STRUCT_MEMBER ( parent_struct,
type,
name,
feature )

◆ KERNEL_STRUCT_MEMBER_PACKED [1/2]

#define KERNEL_STRUCT_MEMBER_PACKED   KERNEL_STRUCT_MEMBER

◆ KERNEL_STRUCT_MEMBER_PACKED [2/2]

#define KERNEL_STRUCT_MEMBER_PACKED   KERNEL_STRUCT_MEMBER

◆ KERNEL_STRUCT_VOLUME_STACK_SIZE [1/2]

#define KERNEL_STRUCT_VOLUME_STACK_SIZE   (integrator_state_soa_volume_stack_size_)

◆ KERNEL_STRUCT_VOLUME_STACK_SIZE [2/2]

#define KERNEL_STRUCT_VOLUME_STACK_SIZE   (volume_stack_size)

Function Documentation

◆ estimate_single_state_size()

CCL_NAMESPACE_BEGIN size_t estimate_single_state_size ( const uint64_t kernel_features,
const int volume_stack_size )
static