Cleanup: remove some unnecessary kernel feature defines

That are either unused or aren't useful for testing anymore without a
megakernel.
This commit is contained in:
Brecht Van Lommel 2022-09-02 14:26:22 +02:00
parent cf57624764
commit b865339833
16 changed files with 58 additions and 171 deletions

View File

@ -45,7 +45,6 @@ ccl_device void camera_sample_perspective(KernelGlobals kg,
float3 raster = make_float3(raster_x, raster_y, 0.0f);
float3 Pcamera = transform_perspective(&rastertocamera, raster);
#ifdef __CAMERA_MOTION__
if (kernel_data.cam.have_perspective_motion) {
/* TODO(sergey): Currently we interpolate projected coordinate which
* gives nice looking result and which is simple, but is in fact a bit
@ -63,7 +62,6 @@ ccl_device void camera_sample_perspective(KernelGlobals kg,
Pcamera = interp(Pcamera, Pcamera_post, (ray->time - 0.5f) * 2.0f);
}
}
#endif
float3 P = zero_float3();
float3 D = Pcamera;
@ -87,14 +85,12 @@ ccl_device void camera_sample_perspective(KernelGlobals kg,
/* transform ray from camera to world */
Transform cameratoworld = kernel_data.cam.cameratoworld;
#ifdef __CAMERA_MOTION__
if (kernel_data.cam.num_motion_steps) {
transform_motion_array_interpolate(&cameratoworld,
kernel_data_array(camera_motion),
kernel_data.cam.num_motion_steps,
ray->time);
}
#endif
P = transform_point(&cameratoworld, P);
D = normalize(transform_direction(&cameratoworld, D));
@ -159,7 +155,6 @@ ccl_device void camera_sample_perspective(KernelGlobals kg,
#endif
}
#ifdef __CAMERA_CLIPPING__
/* clipping */
float z_inv = 1.0f / normalize(Pcamera).z;
float nearclip = kernel_data.cam.nearclip * z_inv;
@ -167,10 +162,6 @@ ccl_device void camera_sample_perspective(KernelGlobals kg,
ray->dP += nearclip * ray->dD;
ray->tmin = 0.0f;
ray->tmax = kernel_data.cam.cliplength * z_inv;
#else
ray->tmin = 0.0f;
ray->tmax = FLT_MAX;
#endif
}
/* Orthographic Camera */
@ -209,14 +200,12 @@ ccl_device void camera_sample_orthographic(KernelGlobals kg,
/* transform ray from camera to world */
Transform cameratoworld = kernel_data.cam.cameratoworld;
#ifdef __CAMERA_MOTION__
if (kernel_data.cam.num_motion_steps) {
transform_motion_array_interpolate(&cameratoworld,
kernel_data_array(camera_motion),
kernel_data.cam.num_motion_steps,
ray->time);
}
#endif
ray->P = transform_point(&cameratoworld, P);
ray->D = normalize(transform_direction(&cameratoworld, D));
@ -231,22 +220,15 @@ ccl_device void camera_sample_orthographic(KernelGlobals kg,
ray->dD = differential_zero_compact();
#endif
#ifdef __CAMERA_CLIPPING__
/* clipping */
ray->tmin = 0.0f;
ray->tmax = kernel_data.cam.cliplength;
#else
ray->tmin = 0.0f;
ray->tmax = FLT_MAX;
#endif
}
/* Panorama Camera */
ccl_device_inline void camera_sample_panorama(ccl_constant KernelCamera *cam,
#ifdef __CAMERA_MOTION__
ccl_global const DecomposedTransform *cam_motion,
#endif
float raster_x,
float raster_y,
float lens_u,
@ -290,12 +272,10 @@ ccl_device_inline void camera_sample_panorama(ccl_constant KernelCamera *cam,
/* transform ray from camera to world */
Transform cameratoworld = cam->cameratoworld;
#ifdef __CAMERA_MOTION__
if (cam->num_motion_steps) {
transform_motion_array_interpolate(
&cameratoworld, cam_motion, cam->num_motion_steps, ray->time);
}
#endif
/* Stereo transform */
bool use_stereo = cam->interocular_offset != 0.0f;
@ -348,17 +328,12 @@ ccl_device_inline void camera_sample_panorama(ccl_constant KernelCamera *cam,
ray->dP = differential_make_compact(dP);
#endif
#ifdef __CAMERA_CLIPPING__
/* clipping */
float nearclip = cam->nearclip;
ray->P += nearclip * ray->D;
ray->dP += nearclip * ray->dD;
ray->tmin = 0.0f;
ray->tmax = cam->cliplength;
#else
ray->tmin = 0.0f;
ray->tmax = FLT_MAX;
#endif
}
/* Common */
@ -378,7 +353,6 @@ ccl_device_inline void camera_sample(KernelGlobals kg,
float raster_x = x + lookup_table_read(kg, filter_u, filter_table_offset, FILTER_TABLE_SIZE);
float raster_y = y + lookup_table_read(kg, filter_v, filter_table_offset, FILTER_TABLE_SIZE);
#ifdef __CAMERA_MOTION__
/* motion blur */
if (kernel_data.cam.shuttertime == -1.0f) {
ray->time = 0.5f;
@ -416,7 +390,6 @@ ccl_device_inline void camera_sample(KernelGlobals kg,
}
}
}
#endif
/* sample */
if (kernel_data.cam.type == CAMERA_PERSPECTIVE) {
@ -426,12 +399,8 @@ ccl_device_inline void camera_sample(KernelGlobals kg,
camera_sample_orthographic(kg, raster_x, raster_y, lens_u, lens_v, ray);
}
else {
#ifdef __CAMERA_MOTION__
ccl_global const DecomposedTransform *cam_motion = kernel_data_array(camera_motion);
camera_sample_panorama(&kernel_data.cam, cam_motion, raster_x, raster_y, lens_u, lens_v, ray);
#else
camera_sample_panorama(&kernel_data.cam, raster_x, raster_y, lens_u, lens_v, ray);
#endif
}
}

View File

@ -182,14 +182,12 @@ ccl_device_inline int bsdf_sample(KernelGlobals kg,
case CLOSURE_BSDF_HAIR_PRINCIPLED_ID:
label = bsdf_principled_hair_sample(kg, sc, sd, randu, randv, eval, omega_in, pdf);
break;
# ifdef __PRINCIPLED__
case CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID:
label = bsdf_principled_diffuse_sample(sc, Ng, sd->I, randu, randv, eval, omega_in, pdf);
break;
case CLOSURE_BSDF_PRINCIPLED_SHEEN_ID:
label = bsdf_principled_sheen_sample(sc, Ng, sd->I, randu, randv, eval, omega_in, pdf);
break;
# endif /* __PRINCIPLED__ */
#endif
default:
label = LABEL_NONE;
@ -312,14 +310,12 @@ ccl_device_inline
case CLOSURE_BSDF_HAIR_TRANSMISSION_ID:
eval = bsdf_hair_transmission_eval_reflect(sc, sd->I, omega_in, pdf);
break;
# ifdef __PRINCIPLED__
case CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID:
eval = bsdf_principled_diffuse_eval_reflect(sc, sd->I, omega_in, pdf);
break;
case CLOSURE_BSDF_PRINCIPLED_SHEEN_ID:
eval = bsdf_principled_sheen_eval_reflect(sc, sd->I, omega_in, pdf);
break;
# endif /* __PRINCIPLED__ */
#endif
default:
break;
@ -397,14 +393,12 @@ ccl_device_inline
case CLOSURE_BSDF_HAIR_TRANSMISSION_ID:
eval = bsdf_hair_transmission_eval_transmit(sc, sd->I, omega_in, pdf);
break;
# ifdef __PRINCIPLED__
case CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID:
eval = bsdf_principled_diffuse_eval_transmit(sc, sd->I, omega_in, pdf);
break;
case CLOSURE_BSDF_PRINCIPLED_SHEEN_ID:
eval = bsdf_principled_sheen_eval_transmit(sc, sd->I, omega_in, pdf);
break;
# endif /* __PRINCIPLED__ */
#endif
default:
break;

View File

@ -312,7 +312,6 @@ ccl_device int bssrdf_setup(ccl_private ShaderData *sd,
if (bssrdf_channels < SPECTRUM_CHANNELS) {
/* Add diffuse BSDF if any radius too small. */
#ifdef __PRINCIPLED__
if (bssrdf->roughness != FLT_MAX) {
ccl_private PrincipledDiffuseBsdf *bsdf = (ccl_private PrincipledDiffuseBsdf *)bsdf_alloc(
sd, sizeof(PrincipledDiffuseBsdf), diffuse_weight);
@ -323,9 +322,7 @@ ccl_device int bssrdf_setup(ccl_private ShaderData *sd,
flag |= bsdf_principled_diffuse_setup(bsdf, PRINCIPLED_DIFFUSE_LAMBERT);
}
}
else
#endif /* __PRINCIPLED__ */
{
else {
ccl_private DiffuseBsdf *bsdf = (ccl_private DiffuseBsdf *)bsdf_alloc(
sd, sizeof(DiffuseBsdf), diffuse_weight);

View File

@ -16,7 +16,6 @@ ccl_device Spectrum integrator_eval_background_shader(KernelGlobals kg,
IntegratorState state,
ccl_global float *ccl_restrict render_buffer)
{
#ifdef __BACKGROUND__
const int shader = kernel_data.background.surface_shader;
const uint32_t path_flag = INTEGRATOR_STATE(state, path, flag);
@ -57,9 +56,6 @@ ccl_device Spectrum integrator_eval_background_shader(KernelGlobals kg,
kg, state, emission_sd, render_buffer, path_flag | PATH_RAY_EMISSION);
return shader_background_eval(emission_sd);
#else
return make_spectrum(0.8f);
#endif
}
ccl_device_inline void integrate_background(KernelGlobals kg,
@ -115,7 +111,6 @@ ccl_device_inline void integrate_background(KernelGlobals kg,
/* Background MIS weights. */
float mis_weight = 1.0f;
#ifdef __BACKGROUND_MIS__
/* Check if background light exists or if we should skip pdf. */
if (!(INTEGRATOR_STATE(state, path, flag) & PATH_RAY_MIS_SKIP) &&
kernel_data.background.use_mis) {
@ -128,7 +123,6 @@ ccl_device_inline void integrate_background(KernelGlobals kg,
const float pdf = background_light_pdf(kg, ray_P, ray_D);
mis_weight = light_sample_mis_weight_forward(kg, mis_ray_pdf, pdf);
}
#endif
L *= mis_weight;
}

View File

@ -78,7 +78,6 @@ ccl_device_forceinline float3 integrate_surface_ray_offset(KernelGlobals kg,
}
}
#ifdef __HOLDOUT__
ccl_device_forceinline bool integrate_surface_holdout(KernelGlobals kg,
ConstIntegratorState state,
ccl_private ShaderData *sd,
@ -100,9 +99,7 @@ ccl_device_forceinline bool integrate_surface_holdout(KernelGlobals kg,
return true;
}
#endif /* __HOLDOUT__ */
#ifdef __EMISSION__
ccl_device_forceinline void integrate_surface_emission(KernelGlobals kg,
ConstIntegratorState state,
ccl_private const ShaderData *sd,
@ -115,12 +112,12 @@ ccl_device_forceinline void integrate_surface_emission(KernelGlobals kg,
Spectrum L = shader_emissive_eval(sd);
float mis_weight = 1.0f;
# ifdef __HAIR__
#ifdef __HAIR__
if (!(path_flag & PATH_RAY_MIS_SKIP) && (sd->flag & SD_USE_MIS) &&
(sd->type & PRIMITIVE_TRIANGLE))
# else
#else
if (!(path_flag & PATH_RAY_MIS_SKIP) && (sd->flag & SD_USE_MIS))
# endif
#endif
{
const float bsdf_pdf = INTEGRATOR_STATE(state, path, mis_ray_pdf);
const float t = sd->ray_length;
@ -134,9 +131,7 @@ ccl_device_forceinline void integrate_surface_emission(KernelGlobals kg,
film_write_surface_emission(
kg, state, L, mis_weight, render_buffer, object_lightgroup(kg, sd->object));
}
#endif /* __EMISSION__ */
#ifdef __EMISSION__
/* Path tracing: sample point on light and evaluate light shader, then
* queue shadow ray to be traced. */
template<uint node_feature_mask>
@ -178,7 +173,7 @@ ccl_device_forceinline void integrate_surface_direct_light(KernelGlobals kg,
BsdfEval bsdf_eval ccl_optional_struct_init;
const bool is_transmission = shader_bsdf_is_transmission(sd, ls.D);
# ifdef __MNEE__
#ifdef __MNEE__
int mnee_vertex_count = 0;
IF_KERNEL_FEATURE(MNEE)
{
@ -204,7 +199,7 @@ ccl_device_forceinline void integrate_surface_direct_light(KernelGlobals kg,
light_sample_to_surface_shadow_ray(kg, emission_sd, &ls, &ray);
}
else
# endif /* __MNEE__ */
#endif /* __MNEE__ */
{
const Spectrum light_eval = light_sample_shader_eval(kg, state, emission_sd, &ls, sd->time);
if (is_zero(light_eval)) {
@ -240,9 +235,9 @@ ccl_device_forceinline void integrate_surface_direct_light(KernelGlobals kg,
integrator_state_copy_volume_stack_to_shadow(kg, shadow_state, state);
if (is_transmission) {
# ifdef __VOLUME__
#ifdef __VOLUME__
shadow_volume_stack_enter_exit(kg, shadow_state, sd);
# endif
#endif
}
if (ray.self.object != OBJECT_NONE) {
@ -298,7 +293,7 @@ ccl_device_forceinline void integrate_surface_direct_light(KernelGlobals kg,
INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, glossy_bounce) = INTEGRATOR_STATE(
state, path, glossy_bounce);
# ifdef __MNEE__
#ifdef __MNEE__
if (mnee_vertex_count > 0) {
INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, transmission_bounce) =
INTEGRATOR_STATE(state, path, transmission_bounce) + mnee_vertex_count - 1;
@ -310,7 +305,7 @@ ccl_device_forceinline void integrate_surface_direct_light(KernelGlobals kg,
bounce) = INTEGRATOR_STATE(state, path, bounce) + mnee_vertex_count;
}
else
# endif
#endif
{
INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, transmission_bounce) = INTEGRATOR_STATE(
state, path, transmission_bounce);
@ -332,7 +327,6 @@ ccl_device_forceinline void integrate_surface_direct_light(KernelGlobals kg,
ls.group + 1 :
kernel_data.background.lightgroup + 1;
}
#endif
/* Path tracing: bounce off or through surface with new direction. */
ccl_device_forceinline int integrate_surface_bsdf_bssrdf_bounce(
@ -573,19 +567,15 @@ ccl_device bool integrate_surface(KernelGlobals kg,
/* Filter closures. */
shader_prepare_surface_closures(kg, state, &sd, path_flag);
#ifdef __HOLDOUT__
/* Evaluate holdout. */
if (!integrate_surface_holdout(kg, state, &sd, render_buffer)) {
return false;
}
#endif
#ifdef __EMISSION__
/* Write emission. */
if (sd.flag & SD_EMISSION) {
integrate_surface_emission(kg, state, &sd, render_buffer);
}
#endif
/* Perform path termination. Most paths have already been terminated in
* the intersect_closest kernel, this is just for emission and for dividing

View File

@ -677,7 +677,6 @@ ccl_device_forceinline void volume_integrate_heterogeneous(
# endif /* __DENOISING_FEATURES__ */
}
# ifdef __EMISSION__
/* Path tracing: sample point on light and evaluate light shader, then
* queue shadow ray to be traced. */
ccl_device_forceinline bool integrate_volume_sample_light(
@ -851,7 +850,6 @@ ccl_device_forceinline void integrate_volume_direct_light(
integrator_state_copy_volume_stack_to_shadow(kg, shadow_state, state);
}
# endif
/* Path tracing: scatter in new direction using phase function */
ccl_device_forceinline bool integrate_volume_phase_scatter(

View File

@ -52,11 +52,9 @@ ccl_device int subsurface_bounce(KernelGlobals kg,
/* Compute weight, optionally including Fresnel from entry point. */
Spectrum weight = shader_bssrdf_sample_weight(sd, sc);
# ifdef __PRINCIPLED__
if (bssrdf->roughness != FLT_MAX) {
path_flag |= PATH_RAY_SUBSURFACE_USE_FRESNEL;
}
# endif
if (sd->flag & SD_BACKFACING) {
path_flag |= PATH_RAY_SUBSURFACE_BACKFACING;
@ -101,7 +99,6 @@ ccl_device void subsurface_shader_data_setup(KernelGlobals kg,
const Spectrum weight = one_spectrum();
# ifdef __PRINCIPLED__
if (path_flag & PATH_RAY_SUBSURFACE_USE_FRESNEL) {
ccl_private PrincipledDiffuseBsdf *bsdf = (ccl_private PrincipledDiffuseBsdf *)bsdf_alloc(
sd, sizeof(PrincipledDiffuseBsdf), weight);
@ -112,9 +109,7 @@ ccl_device void subsurface_shader_data_setup(KernelGlobals kg,
sd->flag |= bsdf_principled_diffuse_setup(bsdf, PRINCIPLED_DIFFUSE_LAMBERT_EXIT);
}
}
else
# endif /* __PRINCIPLED__ */
{
else {
ccl_private DiffuseBsdf *bsdf = (ccl_private DiffuseBsdf *)bsdf_alloc(
sd, sizeof(DiffuseBsdf), weight);

View File

@ -9,8 +9,6 @@ CCL_NAMESPACE_BEGIN
/* Background Light */
#ifdef __BACKGROUND_MIS__
ccl_device float3 background_map_sample(KernelGlobals kg,
float randu,
float randv,
@ -435,6 +433,4 @@ ccl_device float background_light_pdf(KernelGlobals kg, float3 P, float3 directi
return pdf * kernel_data.integrator.pdf_lights;
}
#endif
CCL_NAMESPACE_END

View File

@ -86,7 +86,6 @@ ccl_device_inline bool light_sample(KernelGlobals kg,
ls->pdf = invarea / (costheta * costheta * costheta);
ls->eval_fac = ls->pdf;
}
#ifdef __BACKGROUND_MIS__
else if (type == LIGHT_BACKGROUND) {
/* infinite area light (e.g. light dome or env light) */
float3 D = -background_light_sample(kg, P, randu, randv, &ls->pdf);
@ -97,7 +96,6 @@ ccl_device_inline bool light_sample(KernelGlobals kg,
ls->t = FLT_MAX;
ls->eval_fac = 1.0f;
}
#endif
else {
ls->P = make_float3(klight->co[0], klight->co[1], klight->co[2]);

View File

@ -33,13 +33,10 @@ light_sample_shader_eval(KernelGlobals kg,
/* Setup shader data and call shader_eval_surface once, better
* for GPU coherence and compile times. */
PROFILING_INIT_FOR_SHADER(kg, PROFILING_SHADE_LIGHT_SETUP);
#ifdef __BACKGROUND_MIS__
if (ls->type == LIGHT_BACKGROUND) {
shader_setup_from_background(kg, emission_sd, ls->P, ls->D, time);
}
else
#endif
{
else {
shader_setup_from_sample(kg,
emission_sd,
ls->P,
@ -67,13 +64,10 @@ light_sample_shader_eval(KernelGlobals kg,
kg, state, emission_sd, NULL, PATH_RAY_EMISSION);
/* Evaluate closures. */
#ifdef __BACKGROUND_MIS__
if (ls->type == LIGHT_BACKGROUND) {
eval = shader_background_eval(emission_sd);
}
else
#endif
{
else {
eval = shader_emissive_eval(emission_sd);
}
}

View File

@ -106,7 +106,6 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
__uint_as_float(node.w);
switch (type) {
#ifdef __PRINCIPLED__
case CLOSURE_BSDF_PRINCIPLED_ID: {
uint specular_offset, roughness_offset, specular_tint_offset, anisotropic_offset,
sheen_offset, sheen_tint_offset, clearcoat_offset, clearcoat_roughness_offset,
@ -202,7 +201,7 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
Spectrum weight = sd->svm_closure_weight * mix_weight;
# ifdef __SUBSURFACE__
#ifdef __SUBSURFACE__
float3 mixed_ss_base_color = subsurface_color * subsurface +
base_color * (1.0f - subsurface);
Spectrum subsurf_weight = weight * rgb_to_spectrum(mixed_ss_base_color) * diffuse_weight;
@ -253,7 +252,7 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
}
}
}
# else
#else
/* diffuse */
if (diffuse_weight > CLOSURE_WEIGHT_CUTOFF) {
Spectrum diff_weight = weight * rgb_to_spectrum(base_color) * diffuse_weight;
@ -269,7 +268,7 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
sd->flag |= bsdf_principled_diffuse_setup(bsdf, PRINCIPLED_DIFFUSE_FULL);
}
}
# endif
#endif
/* sheen */
if (diffuse_weight > CLOSURE_WEIGHT_CUTOFF && sheen > CLOSURE_WEIGHT_CUTOFF) {
@ -294,9 +293,9 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
}
/* specular reflection */
# ifdef __CAUSTICS_TRICKS__
#ifdef __CAUSTICS_TRICKS__
if (kernel_data.integrator.caustics_reflective || (path_flag & PATH_RAY_DIFFUSE) == 0) {
# endif
#endif
if (specular_weight > CLOSURE_WEIGHT_CUTOFF &&
(specular > CLOSURE_WEIGHT_CUTOFF || metallic > CLOSURE_WEIGHT_CUTOFF)) {
Spectrum spec_weight = weight * specular_weight;
@ -339,15 +338,15 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
sd->flag |= bsdf_microfacet_multi_ggx_fresnel_setup(bsdf, sd);
}
}
# ifdef __CAUSTICS_TRICKS__
#ifdef __CAUSTICS_TRICKS__
}
# endif
#endif
/* BSDF */
# ifdef __CAUSTICS_TRICKS__
#ifdef __CAUSTICS_TRICKS__
if (kernel_data.integrator.caustics_reflective ||
kernel_data.integrator.caustics_refractive || (path_flag & PATH_RAY_DIFFUSE) == 0) {
# endif
#endif
if (final_transmission > CLOSURE_WEIGHT_CUTOFF) {
Spectrum glass_weight = weight * final_transmission;
float3 cspec0 = base_color * specular_tint + make_float3(1.0f - specular_tint);
@ -357,9 +356,9 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
float refl_roughness = roughness;
/* reflection */
# ifdef __CAUSTICS_TRICKS__
#ifdef __CAUSTICS_TRICKS__
if (kernel_data.integrator.caustics_reflective || (path_flag & PATH_RAY_DIFFUSE) == 0)
# endif
#endif
{
ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
sd, sizeof(MicrofacetBsdf), glass_weight * fresnel);
@ -387,9 +386,9 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
}
/* refraction */
# ifdef __CAUSTICS_TRICKS__
#ifdef __CAUSTICS_TRICKS__
if (kernel_data.integrator.caustics_refractive || (path_flag & PATH_RAY_DIFFUSE) == 0)
# endif
#endif
{
/* This is to prevent MNEE from receiving a null BSDF. */
float refraction_fresnel = fmaxf(0.0001f, 1.0f - fresnel);
@ -443,14 +442,14 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
}
}
}
# ifdef __CAUSTICS_TRICKS__
#ifdef __CAUSTICS_TRICKS__
}
# endif
#endif
/* clearcoat */
# ifdef __CAUSTICS_TRICKS__
#ifdef __CAUSTICS_TRICKS__
if (kernel_data.integrator.caustics_reflective || (path_flag & PATH_RAY_DIFFUSE) == 0) {
# endif
#endif
if (clearcoat > CLOSURE_WEIGHT_CUTOFF) {
ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
sd, sizeof(MicrofacetBsdf), weight);
@ -476,13 +475,12 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
sd->flag |= bsdf_microfacet_ggx_clearcoat_setup(bsdf, sd);
}
}
# ifdef __CAUSTICS_TRICKS__
#ifdef __CAUSTICS_TRICKS__
}
# endif
#endif
break;
}
#endif /* __PRINCIPLED__ */
case CLOSURE_BSDF_DIFFUSE_ID: {
Spectrum weight = sd->svm_closure_weight * mix_weight;
ccl_private OrenNayarBsdf *bsdf = (ccl_private OrenNayarBsdf *)bsdf_alloc(

View File

@ -54,36 +54,25 @@ CCL_NAMESPACE_BEGIN
#endif
/* Kernel features */
#define __DPDU__
#define __BACKGROUND__
#define __CAUSTICS_TRICKS__
#define __VISIBILITY_FLAG__
#define __RAY_DIFFERENTIALS__
#define __CAMERA_CLIPPING__
#define __INTERSECTION_REFINE__
#define __CLAMP_SAMPLE__
#define __PATCH_EVAL__
#define __SHADOW_CATCHER__
#define __DENOISING_FEATURES__
#define __SHADER_RAYTRACE__
#define __AO__
#define __PASSES__
#define __CAUSTICS_TRICKS__
#define __CLAMP_SAMPLE__
#define __DENOISING_FEATURES__
#define __DPDU__
#define __HAIR__
#define __POINTCLOUD__
#define __SVM__
#define __EMISSION__
#define __HOLDOUT__
#define __TRANSPARENT_SHADOWS__
#define __BACKGROUND_MIS__
#define __LAMP_MIS__
#define __CAMERA_MOTION__
#define __OBJECT_MOTION__
#define __PRINCIPLED__
#define __SUBSURFACE__
#define __VOLUME__
#define __CMJ__
#define __PASSES__
#define __PATCH_EVAL__
#define __POINTCLOUD__
#define __RAY_DIFFERENTIALS__
#define __SHADER_RAYTRACE__
#define __SHADOW_CATCHER__
#define __SHADOW_RECORD_ALL__
#define __BRANCHED_PATH__
#define __SUBSURFACE__
#define __SVM__
#define __TRANSPARENT_SHADOWS__
#define __VISIBILITY_FLAG__
#define __VOLUME__
/* Device specific features */
#ifndef __KERNEL_GPU__
@ -101,9 +90,6 @@ CCL_NAMESPACE_BEGIN
/* Scene-based selective features compilation. */
#ifdef __KERNEL_FEATURES__
# if !(__KERNEL_FEATURES & KERNEL_FEATURE_CAMERA_MOTION)
# undef __CAMERA_MOTION__
# endif
# if !(__KERNEL_FEATURES & KERNEL_FEATURE_OBJECT_MOTION)
# undef __OBJECT_MOTION__
# endif
@ -128,9 +114,6 @@ CCL_NAMESPACE_BEGIN
# if !(__KERNEL_FEATURES & KERNEL_FEATURE_SHADOW_CATCHER)
# undef __SHADOW_CATCHER__
# endif
# if !(__KERNEL_FEATURES & KERNEL_FEATURE_PRINCIPLED)
# undef __PRINCIPLED__
# endif
# if !(__KERNEL_FEATURES & KERNEL_FEATURE_DENOISING)
# undef __DENOISING_FEATURES__
# endif
@ -1488,42 +1471,38 @@ enum KernelFeatureFlag : uint32_t {
KERNEL_FEATURE_HAIR = (1U << 12U),
KERNEL_FEATURE_HAIR_THICK = (1U << 13U),
KERNEL_FEATURE_OBJECT_MOTION = (1U << 14U),
KERNEL_FEATURE_CAMERA_MOTION = (1U << 15U),
/* Denotes whether baking functionality is needed. */
KERNEL_FEATURE_BAKING = (1U << 16U),
KERNEL_FEATURE_BAKING = (1U << 15U),
/* Use subsurface scattering materials. */
KERNEL_FEATURE_SUBSURFACE = (1U << 17U),
KERNEL_FEATURE_SUBSURFACE = (1U << 16U),
/* Use volume materials. */
KERNEL_FEATURE_VOLUME = (1U << 18U),
KERNEL_FEATURE_VOLUME = (1U << 17U),
/* Use OpenSubdiv patch evaluation */
KERNEL_FEATURE_PATCH_EVALUATION = (1U << 19U),
KERNEL_FEATURE_PATCH_EVALUATION = (1U << 18U),
/* Use Transparent shadows */
KERNEL_FEATURE_TRANSPARENT = (1U << 20U),
KERNEL_FEATURE_TRANSPARENT = (1U << 19U),
/* Use shadow catcher. */
KERNEL_FEATURE_SHADOW_CATCHER = (1U << 21U),
/* Per-uber shader usage flags. */
KERNEL_FEATURE_PRINCIPLED = (1U << 22U),
KERNEL_FEATURE_SHADOW_CATCHER = (1U << 29U),
/* Light render passes. */
KERNEL_FEATURE_LIGHT_PASSES = (1U << 23U),
KERNEL_FEATURE_LIGHT_PASSES = (1U << 21U),
/* Shadow render pass. */
KERNEL_FEATURE_SHADOW_PASS = (1U << 24U),
KERNEL_FEATURE_SHADOW_PASS = (1U << 22U),
/* AO. */
KERNEL_FEATURE_AO_PASS = (1U << 25U),
KERNEL_FEATURE_AO_ADDITIVE = (1U << 26U),
KERNEL_FEATURE_AO_PASS = (1U << 23U),
KERNEL_FEATURE_AO_ADDITIVE = (1U << 24U),
KERNEL_FEATURE_AO = (KERNEL_FEATURE_AO_PASS | KERNEL_FEATURE_AO_ADDITIVE),
/* MNEE. */
KERNEL_FEATURE_MNEE = (1U << 27U),
KERNEL_FEATURE_MNEE = (1U << 25U),
};
/* Shader node feature mask, to specialize shader evaluation for kernels. */

View File

@ -761,9 +761,7 @@ float Camera::world_to_raster_size(float3 P)
}
#else
camera_sample_panorama(&kernel_camera,
# ifdef __CAMERA_MOTION__
kernel_camera_motion.data(),
# endif
0.5f * full_width,
0.5f * full_height,
0.0f,

View File

@ -497,9 +497,6 @@ void Scene::update_kernel_features()
if (params.hair_shape == CURVE_THICK) {
kernel_features |= KERNEL_FEATURE_HAIR_THICK;
}
if (use_motion && camera->use_motion()) {
kernel_features |= KERNEL_FEATURE_CAMERA_MOTION;
}
/* Figure out whether the scene will use shader ray-trace we need at least
* one caustic light, one caustic caster and one caustic receiver to use
@ -520,9 +517,6 @@ void Scene::update_kernel_features()
if (object->use_motion() || geom->get_use_motion_blur()) {
kernel_features |= KERNEL_FEATURE_OBJECT_MOTION;
}
if (geom->get_use_motion_blur()) {
kernel_features |= KERNEL_FEATURE_CAMERA_MOTION;
}
}
if (object->get_is_shadow_catcher()) {
kernel_features |= KERNEL_FEATURE_SHADOW_CATCHER;
@ -590,8 +584,6 @@ static void log_kernel_features(const uint features)
{
VLOG_INFO << "Requested features:\n";
VLOG_INFO << "Use BSDF " << string_from_bool(features & KERNEL_FEATURE_NODE_BSDF) << "\n";
VLOG_INFO << "Use Principled BSDF " << string_from_bool(features & KERNEL_FEATURE_PRINCIPLED)
<< "\n";
VLOG_INFO << "Use Emission " << string_from_bool(features & KERNEL_FEATURE_NODE_EMISSION)
<< "\n";
VLOG_INFO << "Use Volume " << string_from_bool(features & KERNEL_FEATURE_NODE_VOLUME) << "\n";
@ -611,8 +603,6 @@ static void log_kernel_features(const uint features)
<< "\n";
VLOG_INFO << "Use Object Motion " << string_from_bool(features & KERNEL_FEATURE_OBJECT_MOTION)
<< "\n";
VLOG_INFO << "Use Camera Motion " << string_from_bool(features & KERNEL_FEATURE_CAMERA_MOTION)
<< "\n";
VLOG_INFO << "Use Baking " << string_from_bool(features & KERNEL_FEATURE_BAKING) << "\n";
VLOG_INFO << "Use Subsurface " << string_from_bool(features & KERNEL_FEATURE_SUBSURFACE) << "\n";
VLOG_INFO << "Use Volume " << string_from_bool(features & KERNEL_FEATURE_VOLUME) << "\n";

View File

@ -685,9 +685,6 @@ uint ShaderManager::get_graph_kernel_features(ShaderGraph *graph)
if (CLOSURE_IS_VOLUME(bsdf_node->get_closure_type())) {
kernel_features |= KERNEL_FEATURE_NODE_VOLUME;
}
else if (CLOSURE_IS_PRINCIPLED(bsdf_node->get_closure_type())) {
kernel_features |= KERNEL_FEATURE_PRINCIPLED;
}
}
if (node->has_surface_bssrdf()) {
kernel_features |= KERNEL_FEATURE_SUBSURFACE;