diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-05-30 19:04:14 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-05-31 18:24:43 +0300 |
commit | f2cd7e08fed02fdf02060c17c943e15e85638cb5 (patch) | |
tree | 27e4ea7864f1716979ab9e27e60cdcdf361566f2 /intern/cycles/kernel/types.h | |
parent | 52cb24a7796c1043dab076d3ef025b4c8545c1ef (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/types.h')
-rw-r--r-- | intern/cycles/kernel/types.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/intern/cycles/kernel/types.h b/intern/cycles/kernel/types.h index 01df7948241..80eccd6d41f 100644 --- a/intern/cycles/kernel/types.h +++ b/intern/cycles/kernel/types.h @@ -1572,6 +1572,7 @@ typedef enum DeviceKernel { DEVICE_KERNEL_INTEGRATOR_SHADE_LIGHT, DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE, DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_RAYTRACE, + DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_MNEE, DEVICE_KERNEL_INTEGRATOR_SHADE_VOLUME, DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW, DEVICE_KERNEL_INTEGRATOR_MEGAKERNEL, @@ -1689,6 +1690,9 @@ enum KernelFeatureFlag : uint32_t { KERNEL_FEATURE_AO_PASS = (1U << 25U), KERNEL_FEATURE_AO_ADDITIVE = (1U << 26U), KERNEL_FEATURE_AO = (KERNEL_FEATURE_AO_PASS | KERNEL_FEATURE_AO_ADDITIVE), + + /* MNEE. */ + KERNEL_FEATURE_MNEE = (1U << 27U), }; /* Shader node feature mask, to specialize shader evaluation for kernels. */ @@ -1714,9 +1718,12 @@ enum KernelFeatureFlag : uint32_t { * are different depending on the main, shadow or null path. For GPU we don't have * C++17 everywhere so can't use it. */ #ifdef __KERNEL_CPU__ +# define IF_KERNEL_FEATURE(feature) \ + if constexpr ((node_feature_mask & (KERNEL_FEATURE_##feature)) != 0U) # define IF_KERNEL_NODES_FEATURE(feature) \ if constexpr ((node_feature_mask & (KERNEL_FEATURE_NODE_##feature)) != 0U) #else +# define IF_KERNEL_FEATURE(feature) if ((node_feature_mask & (KERNEL_FEATURE_##feature)) != 0U) # define IF_KERNEL_NODES_FEATURE(feature) \ if ((node_feature_mask & (KERNEL_FEATURE_NODE_##feature)) != 0U) #endif |