Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2022-05-30 19:04:14 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-05-31 18:24:43 +0300
commitf2cd7e08fed02fdf02060c17c943e15e85638cb5 (patch)
tree27e4ea7864f1716979ab9e27e60cdcdf361566f2 /intern/cycles/kernel/integrator/intersect_closest.h
parent52cb24a7796c1043dab076d3ef025b4c8545c1ef (diff)
Fix Cycles MNEE not working for Metal
Move MNEE to own kernel, separate from shader ray-tracing. This does introduce the limitation that a shader can't use both MNEE and AO/bevel, but that seems like the better trade-off for now. We can experiment with bigger kernel organization changes later. Differential Revision: https://developer.blender.org/D15070
Diffstat (limited to 'intern/cycles/kernel/integrator/intersect_closest.h')
-rw-r--r--intern/cycles/kernel/integrator/intersect_closest.h31
1 files changed, 23 insertions, 8 deletions
diff --git a/intern/cycles/kernel/integrator/intersect_closest.h b/intern/cycles/kernel/integrator/intersect_closest.h
index b8ce625c11b..2dfac44b414 100644
--- a/intern/cycles/kernel/integrator/intersect_closest.h
+++ b/intern/cycles/kernel/integrator/intersect_closest.h
@@ -125,9 +125,12 @@ ccl_device_forceinline void integrator_split_shadow_catcher(
const int flags = kernel_tex_fetch(__shaders, shader).flags;
const bool use_caustics = kernel_data.integrator.use_caustics &&
(object_flags & SD_OBJECT_CAUSTICS);
- const bool use_raytrace_kernel = (flags & SD_HAS_RAYTRACE) || use_caustics;
+ const bool use_raytrace_kernel = (flags & SD_HAS_RAYTRACE);
- if (use_raytrace_kernel) {
+ if (use_caustics) {
+ INTEGRATOR_PATH_INIT_SORTED(DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_MNEE, shader);
+ }
+ else if (use_raytrace_kernel) {
INTEGRATOR_PATH_INIT_SORTED(DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_RAYTRACE, shader);
}
else {
@@ -150,9 +153,13 @@ ccl_device_forceinline void integrator_intersect_next_kernel_after_shadow_catche
const int object_flags = intersection_get_object_flags(kg, &isect);
const bool use_caustics = kernel_data.integrator.use_caustics &&
(object_flags & SD_OBJECT_CAUSTICS);
- const bool use_raytrace_kernel = (flags & SD_HAS_RAYTRACE) || use_caustics;
+ const bool use_raytrace_kernel = (flags & SD_HAS_RAYTRACE);
- if (use_raytrace_kernel) {
+ if (use_caustics) {
+ INTEGRATOR_PATH_NEXT_SORTED(
+ current_kernel, DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_MNEE, shader);
+ }
+ else if (use_raytrace_kernel) {
INTEGRATOR_PATH_NEXT_SORTED(
current_kernel, DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_RAYTRACE, shader);
}
@@ -222,8 +229,12 @@ ccl_device_forceinline void integrator_intersect_next_kernel(
const int object_flags = intersection_get_object_flags(kg, isect);
const bool use_caustics = kernel_data.integrator.use_caustics &&
(object_flags & SD_OBJECT_CAUSTICS);
- const bool use_raytrace_kernel = (flags & SD_HAS_RAYTRACE) || use_caustics;
- if (use_raytrace_kernel) {
+ const bool use_raytrace_kernel = (flags & SD_HAS_RAYTRACE);
+ if (use_caustics) {
+ INTEGRATOR_PATH_NEXT_SORTED(
+ current_kernel, DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_MNEE, shader);
+ }
+ else if (use_raytrace_kernel) {
INTEGRATOR_PATH_NEXT_SORTED(
current_kernel, DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_RAYTRACE, shader);
}
@@ -272,9 +283,13 @@ ccl_device_forceinline void integrator_intersect_next_kernel_after_volume(
const int object_flags = intersection_get_object_flags(kg, isect);
const bool use_caustics = kernel_data.integrator.use_caustics &&
(object_flags & SD_OBJECT_CAUSTICS);
- const bool use_raytrace_kernel = (flags & SD_HAS_RAYTRACE) || use_caustics;
+ const bool use_raytrace_kernel = (flags & SD_HAS_RAYTRACE);
- if (use_raytrace_kernel) {
+ if (use_caustics) {
+ INTEGRATOR_PATH_NEXT_SORTED(
+ current_kernel, DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_MNEE, shader);
+ }
+ else if (use_raytrace_kernel) {
INTEGRATOR_PATH_NEXT_SORTED(
current_kernel, DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_RAYTRACE, shader);
}