diff --git a/build_files/build_environment/cmake/download.cmake b/build_files/build_environment/cmake/download.cmake index d51a2909f48..26f6d908efc 100644 --- a/build_files/build_environment/cmake/download.cmake +++ b/build_files/build_environment/cmake/download.cmake @@ -12,9 +12,9 @@ function(download_source dep) if(PACKAGE_USE_UPSTREAM_SOURCES) set(TARGET_URI ${${dep}_URI}) elseif(BLENDER_VERSION) - set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/tags/blender-${BLENDER_VERSION}-release/lib/packages/${TARGET_FILE}) + set(TARGET_URI https://projects.blender.org/blender/lib-source/media/branch/blender-v${BLENDER_VERSION}-release/${TARGET_FILE}) else() - set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/trunk/lib/packages/${TARGET_FILE}) + set(TARGET_URI https://projects.blender.org/blender/lib-source/media/branch/main/${TARGET_FILE}) endif() # Validate all required variables are set and give an explicit error message # rather than CMake erroring out later on with a more ambigious error. diff --git a/intern/cycles/device/metal/device_impl.mm b/intern/cycles/device/metal/device_impl.mm index b7fd6658f64..319a348db7f 100644 --- a/intern/cycles/device/metal/device_impl.mm +++ b/intern/cycles/device/metal/device_impl.mm @@ -340,11 +340,6 @@ string MetalDevice::preprocess_source(MetalPipelineType pso_type, } } - if (@available(macos 14.0, *)) { - /* Use Program Scope Global Built-ins, when available. */ - global_defines += "#define __METAL_GLOBAL_BUILTINS__\n"; - } - # ifdef WITH_CYCLES_DEBUG global_defines += "#define __KERNEL_DEBUG__\n"; # endif @@ -359,13 +354,22 @@ string MetalDevice::preprocess_source(MetalPipelineType pso_type, global_defines += "#define __KERNEL_METAL_AMD__\n"; /* The increased amount of BSDF code leads to a big performance regression * on AMD. There is currently no workaround to fix this general. Instead - * disable Principled Hair. */ + * disable Principled Hair and patch evaluation. */ if (kernel_features & KERNEL_FEATURE_NODE_PRINCIPLED_HAIR) { global_defines += "#define WITH_PRINCIPLED_HAIR\n"; } + if (kernel_features & KERNEL_FEATURE_PATCH_EVALUATION) { + global_defines += "#define WITH_PATCH_EVAL\n"; + } break; case METAL_GPU_APPLE: global_defines += "#define __KERNEL_METAL_APPLE__\n"; + + if (@available(macos 14.0, *)) { + /* Use Program Scope Global Built-ins, when available. */ + global_defines += "#define __METAL_GLOBAL_BUILTINS__\n"; + } + # ifdef WITH_NANOVDB /* Compiling in NanoVDB results in a marginal drop in render performance, * so disable it for specialized PSOs when no textures are using it. */ diff --git a/intern/cycles/kernel/geom/triangle.h b/intern/cycles/kernel/geom/triangle.h index d633364f925..d2c1172c963 100644 --- a/intern/cycles/kernel/geom/triangle.h +++ b/intern/cycles/kernel/geom/triangle.h @@ -10,6 +10,8 @@ #pragma once +#include "util/color.h" + CCL_NAMESPACE_BEGIN /* Normal on triangle. */ diff --git a/intern/cycles/kernel/types.h b/intern/cycles/kernel/types.h index 4974e7a1306..6f581ac2611 100644 --- a/intern/cycles/kernel/types.h +++ b/intern/cycles/kernel/types.h @@ -116,6 +116,9 @@ CCL_NAMESPACE_BEGIN # ifndef WITH_PRINCIPLED_HAIR # undef __PRINCIPLED_HAIR__ # endif +# ifndef WITH_PATCH_EVAL +# undef __PATCH_EVAL__ +# endif #endif /* Scene-based selective features compilation. */ diff --git a/source/blender/blenkernel/intern/mesh_legacy_convert.cc b/source/blender/blenkernel/intern/mesh_legacy_convert.cc index 8765eb3a798..86e3bb3ed66 100644 --- a/source/blender/blenkernel/intern/mesh_legacy_convert.cc +++ b/source/blender/blenkernel/intern/mesh_legacy_convert.cc @@ -2248,8 +2248,17 @@ void BKE_main_mesh_legacy_convert_auto_smooth(Main &bmain) continue; } if (CustomData_has_layer(&mesh->corner_data, CD_CUSTOMLOOPNORMAL)) { + /* Auto-smooth disabled sharp edge tagging when the evaluated mesh had custom normals. + * When the original mesh has custom normals, that's a good sign the evaluated mesh will + * have custom normals as well. */ continue; } + if (ModifierData *last_md = static_cast(object->modifiers.last)) { + if (ELEM(last_md->type, eModifierType_WeightedNormal, eModifierType_NormalEdit)) { + /* These modifiers always generate custom normals which disabled sharp edge tagging. */ + continue; + } + } if (!auto_smooth_node_tree) { auto_smooth_node_tree = add_auto_smooth_node_tree(bmain); BKE_ntree_update_main_tree(&bmain, auto_smooth_node_tree, nullptr); diff --git a/source/blender/draw/intern/draw_cache_impl_curves.cc b/source/blender/draw/intern/draw_cache_impl_curves.cc index 7606750c726..f1d1ac4b1e3 100644 --- a/source/blender/draw/intern/draw_cache_impl_curves.cc +++ b/source/blender/draw/intern/draw_cache_impl_curves.cc @@ -511,7 +511,7 @@ static bool curves_ensure_attributes(const Curves &curves, for (const int i : IndexRange(final_cache.attr_used.num_requests)) { const DRW_AttributeRequest &request = final_cache.attr_used.requests[i]; - if (cache.curves_cache.proc_attributes_buf[i] != nullptr) { + if (cache.curves_cache.final[subdiv].attributes_buf[i] != nullptr) { continue; }