[Bf-blender-cvs] [563e2086902] cycles-x: Cleanup: pass full kernel name to integrator state macros
Brecht Van Lommel
noreply at git.blender.org
Thu May 27 19:15:40 CEST 2021
Commit: 563e208690238ff86f61dbf1fad37ae559c23813
Author: Brecht Van Lommel
Date: Thu May 27 12:43:10 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB563e208690238ff86f61dbf1fad37ae559c23813
Cleanup: pass full kernel name to integrator state macros
So we can make this dynamic.
===================================================================
M intern/cycles/kernel/integrator/integrator_init_from_camera.h
M intern/cycles/kernel/integrator/integrator_intersect_closest.h
M intern/cycles/kernel/integrator/integrator_intersect_shadow.h
M intern/cycles/kernel/integrator/integrator_intersect_subsurface.h
M intern/cycles/kernel/integrator/integrator_shade_background.h
M intern/cycles/kernel/integrator/integrator_shade_light.h
M intern/cycles/kernel/integrator/integrator_shade_shadow.h
M intern/cycles/kernel/integrator/integrator_shade_surface.h
M intern/cycles/kernel/integrator/integrator_shade_volume.h
M intern/cycles/kernel/integrator/integrator_state_flow.h
M intern/cycles/kernel/integrator/integrator_subsurface.h
===================================================================
diff --git a/intern/cycles/kernel/integrator/integrator_init_from_camera.h b/intern/cycles/kernel/integrator/integrator_init_from_camera.h
index 751e6e6afac..6c90487424e 100644
--- a/intern/cycles/kernel/integrator/integrator_init_from_camera.h
+++ b/intern/cycles/kernel/integrator/integrator_init_from_camera.h
@@ -108,7 +108,7 @@ ccl_device bool integrator_init_from_camera(INTEGRATOR_STATE_ARGS,
path_state_init_integrator(INTEGRATOR_STATE_PASS, sample, rng_hash);
/* Continue with intersect_closest kernel. */
- INTEGRATOR_PATH_INIT(INTERSECT_CLOSEST);
+ INTEGRATOR_PATH_INIT(DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST);
return true;
}
diff --git a/intern/cycles/kernel/integrator/integrator_intersect_closest.h b/intern/cycles/kernel/integrator/integrator_intersect_closest.h
index ed671a6d595..6ee9579fdca 100644
--- a/intern/cycles/kernel/integrator/integrator_intersect_closest.h
+++ b/intern/cycles/kernel/integrator/integrator_intersect_closest.h
@@ -71,7 +71,7 @@ ccl_device_forceinline bool integrator_intersect_shader_next_kernel(
/* Setup next kernel to execute. */
const int next_kernel = DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE;
- INTEGRATOR_PATH_NEXT_SORTED(INTERSECT_CLOSEST, next_kernel, shader);
+ INTEGRATOR_PATH_NEXT_SORTED(DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST, next_kernel, shader);
return true;
}
@@ -117,7 +117,8 @@ ccl_device void integrator_intersect_closest(INTEGRATOR_STATE_ARGS)
if (INTEGRATOR_STATE_ARRAY(volume_stack, 0, object) != OBJECT_NONE) {
/* Continue with volume kernel if we are inside a volume, regardless
* if we hit anything. */
- INTEGRATOR_PATH_NEXT(INTERSECT_CLOSEST, SHADE_VOLUME);
+ INTEGRATOR_PATH_NEXT(DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST,
+ DEVICE_KERNEL_INTEGRATOR_SHADE_VOLUME);
return;
}
#endif
@@ -125,7 +126,8 @@ ccl_device void integrator_intersect_closest(INTEGRATOR_STATE_ARGS)
if (hit) {
/* Hit a surface, continue with light or surface kernel. */
if (isect.type & PRIMITIVE_LAMP) {
- INTEGRATOR_PATH_NEXT(INTERSECT_CLOSEST, SHADE_LIGHT);
+ INTEGRATOR_PATH_NEXT(DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST,
+ DEVICE_KERNEL_INTEGRATOR_SHADE_LIGHT);
return;
}
else {
@@ -136,14 +138,15 @@ ccl_device void integrator_intersect_closest(INTEGRATOR_STATE_ARGS)
return;
}
else {
- INTEGRATOR_PATH_TERMINATE(INTERSECT_CLOSEST);
+ INTEGRATOR_PATH_TERMINATE(DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST);
return;
}
}
}
else {
/* Nothing hit, continue with background kernel. */
- INTEGRATOR_PATH_NEXT(INTERSECT_CLOSEST, SHADE_BACKGROUND);
+ INTEGRATOR_PATH_NEXT(DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST,
+ DEVICE_KERNEL_INTEGRATOR_SHADE_BACKGROUND);
return;
}
}
diff --git a/intern/cycles/kernel/integrator/integrator_intersect_shadow.h b/intern/cycles/kernel/integrator/integrator_intersect_shadow.h
index 5280aada446..06830d3d1c9 100644
--- a/intern/cycles/kernel/integrator/integrator_intersect_shadow.h
+++ b/intern/cycles/kernel/integrator/integrator_intersect_shadow.h
@@ -125,7 +125,7 @@ ccl_device void integrator_intersect_shadow(INTEGRATOR_STATE_ARGS)
if (opaque_hit) {
/* Hit an opaque surface, shadow path ends here. */
- INTEGRATOR_SHADOW_PATH_TERMINATE(INTERSECT_SHADOW);
+ INTEGRATOR_SHADOW_PATH_TERMINATE(DEVICE_KERNEL_INTEGRATOR_INTERSECT_SHADOW);
return;
}
else {
@@ -134,7 +134,8 @@ ccl_device void integrator_intersect_shadow(INTEGRATOR_STATE_ARGS)
*
* TODO: could also write to render buffer directly if no transparent shadows?
* Could save a kernel execution for the common case. */
- INTEGRATOR_SHADOW_PATH_NEXT(INTERSECT_SHADOW, SHADE_SHADOW);
+ INTEGRATOR_SHADOW_PATH_NEXT(DEVICE_KERNEL_INTEGRATOR_INTERSECT_SHADOW,
+ DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW);
return;
}
}
diff --git a/intern/cycles/kernel/integrator/integrator_intersect_subsurface.h b/intern/cycles/kernel/integrator/integrator_intersect_subsurface.h
index 59e151ad287..b8bafd8d1bc 100644
--- a/intern/cycles/kernel/integrator/integrator_intersect_subsurface.h
+++ b/intern/cycles/kernel/integrator/integrator_intersect_subsurface.h
@@ -47,7 +47,7 @@ ccl_device void integrator_intersect_subsurface(INTEGRATOR_STATE_ARGS)
# endif /* __VOLUME__ */
#endif
- INTEGRATOR_PATH_TERMINATE(INTERSECT_SUBSURFACE);
+ INTEGRATOR_PATH_TERMINATE(DEVICE_KERNEL_INTEGRATOR_INTERSECT_SUBSURFACE);
}
CCL_NAMESPACE_END
diff --git a/intern/cycles/kernel/integrator/integrator_shade_background.h b/intern/cycles/kernel/integrator/integrator_shade_background.h
index 4401a27935b..93a61dbe962 100644
--- a/intern/cycles/kernel/integrator/integrator_shade_background.h
+++ b/intern/cycles/kernel/integrator/integrator_shade_background.h
@@ -179,7 +179,7 @@ ccl_device void integrator_shade_background(INTEGRATOR_STATE_ARGS,
integrate_background(INTEGRATOR_STATE_PASS, render_buffer);
/* Path ends here. */
- INTEGRATOR_PATH_TERMINATE(SHADE_BACKGROUND);
+ INTEGRATOR_PATH_TERMINATE(DEVICE_KERNEL_INTEGRATOR_SHADE_BACKGROUND);
}
CCL_NAMESPACE_END
diff --git a/intern/cycles/kernel/integrator/integrator_shade_light.h b/intern/cycles/kernel/integrator/integrator_shade_light.h
index c2f0ddebb0a..d22fb069f1d 100644
--- a/intern/cycles/kernel/integrator/integrator_shade_light.h
+++ b/intern/cycles/kernel/integrator/integrator_shade_light.h
@@ -106,11 +106,12 @@ ccl_device void integrator_shade_light(INTEGRATOR_STATE_ARGS,
INTEGRATOR_STATE_WRITE(path, transparent_bounce) = transparent_bounce;
if (transparent_bounce >= kernel_data.integrator.transparent_max_bounce) {
- INTEGRATOR_PATH_TERMINATE(SHADE_LIGHT);
+ INTEGRATOR_PATH_TERMINATE(DEVICE_KERNEL_INTEGRATOR_SHADE_LIGHT);
return;
}
else {
- INTEGRATOR_PATH_NEXT(SHADE_LIGHT, INTERSECT_CLOSEST);
+ INTEGRATOR_PATH_NEXT(DEVICE_KERNEL_INTEGRATOR_SHADE_LIGHT,
+ DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST);
return;
}
diff --git a/intern/cycles/kernel/integrator/integrator_shade_shadow.h b/intern/cycles/kernel/integrator/integrator_shade_shadow.h
index 4abd510ca52..34d1a84314d 100644
--- a/intern/cycles/kernel/integrator/integrator_shade_shadow.h
+++ b/intern/cycles/kernel/integrator/integrator_shade_shadow.h
@@ -92,19 +92,20 @@ ccl_device void integrator_shade_shadow(INTEGRATOR_STATE_ARGS,
/* Evaluate transparent shadows. */
const bool opaque = integrate_transparent_shadow(INTEGRATOR_STATE_PASS, num_hits);
if (opaque) {
- INTEGRATOR_SHADOW_PATH_TERMINATE(SHADE_SHADOW);
+ INTEGRATOR_SHADOW_PATH_TERMINATE(DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW);
return;
}
#endif
if (num_hits >= INTEGRATOR_SHADOW_ISECT_SIZE) {
/* More intersections to find, continue shadow ray. */
- INTEGRATOR_SHADOW_PATH_NEXT(SHADE_SHADOW, INTERSECT_SHADOW);
+ INTEGRATOR_SHADOW_PATH_NEXT(DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW,
+ DEVICE_KERNEL_INTEGRATOR_INTERSECT_SHADOW);
return;
}
else {
kernel_accum_light(INTEGRATOR_STATE_PASS, render_buffer);
- INTEGRATOR_SHADOW_PATH_TERMINATE(SHADE_SHADOW);
+ INTEGRATOR_SHADOW_PATH_TERMINATE(DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW);
return;
}
}
diff --git a/intern/cycles/kernel/integrator/integrator_shade_surface.h b/intern/cycles/kernel/integrator/integrator_shade_surface.h
index 4f69b031237..cdce6236524 100644
--- a/intern/cycles/kernel/integrator/integrator_shade_surface.h
+++ b/intern/cycles/kernel/integrator/integrator_shade_surface.h
@@ -176,7 +176,7 @@ ccl_device_inline void integrate_surface_direct_light(INTEGRATOR_STATE_ARGS,
integrator_state_copy_volume_stack_to_shadow(INTEGRATOR_STATE_PASS);
/* Branch of shadow kernel. */
- INTEGRATOR_SHADOW_PATH_INIT(INTERSECT_SHADOW);
+ INTEGRATOR_SHADOW_PATH_INIT(DEVICE_KERNEL_INTEGRATOR_INTERSECT_SHADOW);
}
#endif
@@ -384,15 +384,17 @@ ccl_device void integrator_shade_surface(INTEGRATOR_STATE_ARGS,
{
if (integrate_surface(INTEGRATOR_STATE_PASS, render_buffer)) {
if (INTEGRATOR_STATE(path, flag) & PATH_RAY_SUBSURFACE) {
- INTEGRATOR_PATH_NEXT(SHADE_SURFACE, INTERSECT_SUBSURFACE);
+ INTEGRATOR_PATH_NEXT(DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE,
+ DEVICE_KERNEL_INTEGRATOR_INTERSECT_SUBSURFACE);
}
else {
kernel_assert(INTEGRATOR_STATE(ray, t) != 0.0f);
- INTEGRATOR_PATH_NEXT(SHADE_SURFACE, INTERSECT_CLOSEST);
+ INTEGRATOR_PATH_NEXT(DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE,
+ DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST);
}
}
else {
- INTEGRATOR_PATH_TERMINATE(SHADE_SURFACE);
+ INTEGRATOR_PATH_TERMINATE(DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE);
}
}
diff --git a/intern/cycles/kernel/integrator/integrator_shade_volume.h b/intern/cycles/kernel/integrator/integrator_shade_volume.h
index 3d905e10a9b..408fd69579c 100644
--- a/intern/cycles/kernel/integrator/integrator_shade_volume.h
+++ b/intern/cycles/kernel/integrator/integrator_shade_volume.h
@@ -37,7 +37,7 @@ ccl_device void integrator_shade_volume(INTEGRATOR_STATE_ARGS,
INTEGRATOR_STATE_WRITE(shadow_path, throughput) = INTEGRATOR_STATE(path, throughput);
/* Queue intersect_shadow kernel. */
- INTEGRATOR_SHADOW_PATH_INIT(INTERSECT_SHADOW);
+ INTEGRATOR_SHADOW_PATH_INIT(DEVICE_KERNEL_INTEGRATOR_INTERSECT_SHADOW);
}
const bool end_path = true;
@@ -45,7 +45,7 @@ ccl_device void integrator_shade_volume(INTEGRATOR_STATE_ARGS,
if (end_path) {
/* End path. */
- INTEGRATOR_PATH_TERMINATE(SHADE_VOLUME);
+ INTEGRATOR_PATH_TERMINATE(DEVICE_KERNEL_INTEGRATOR_SHADE_VOLUME);
return;
}
else if (scatter) {
@@ -59,7 +59,8 @@ ccl_device void integrator_shade_volume(INTEGRATOR_STATE_ARGS,
INTEGRATOR_STATE_WRITE(path, throughput) = throughput;
/* Queue intersect_closest kernel. */
- INTEGRATOR_PATH_NEXT(SHADE_VOLUME, INTERSECT_CLOSEST);
+ INTEGRATOR_PATH_NEXT(DEVICE_KERNEL_INTEGRATOR_SHADE_VOLUME,
+ DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST);
re
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list