From b2e43a4a9db37757ab436ea68f229c0801441ba3 Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Fri, 4 Feb 2022 09:19:10 -0700 Subject: [PATCH 1/6] deps_builder: Update to freetype 2.11.1 Required to solve a crash on windows (T95367) Mostly an uneventful update, except for FreeType giving its cmake options a rename. Reviewed By: brecht, sybren Differential Revision: https://developer.blender.org/D13968 --- build_files/build_environment/cmake/freetype.cmake | 11 ++++------- build_files/build_environment/cmake/versions.cmake | 4 ++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/build_files/build_environment/cmake/freetype.cmake b/build_files/build_environment/cmake/freetype.cmake index 52261b47618..c6663c287b1 100644 --- a/build_files/build_environment/cmake/freetype.cmake +++ b/build_files/build_environment/cmake/freetype.cmake @@ -19,13 +19,10 @@ set(FREETYPE_EXTRA_ARGS -DCMAKE_RELEASE_POSTFIX:STRING=2ST -DCMAKE_DEBUG_POSTFIX:STRING=2ST_d - -DWITH_BZip2=OFF - -DWITH_HarfBuzz=OFF - -DFT_WITH_HARFBUZZ=OFF - -DFT_WITH_BZIP2=OFF - -DFT_WITH_BROTLI=ON - -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE - -DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE + -DFT_DISABLE_BZIP2=ON + -DFT_DISABLE_HARFBUZZ=ON + -DFT_DISABLE_PNG=ON + -DFT_REQUIRE_BROTLI=ON -DPC_BROTLIDEC_INCLUDEDIR=${LIBDIR}/brotli/include -DPC_BROTLIDEC_LIBDIR=${LIBDIR}/brotli/lib ) diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake index c5f9aecabbf..28a27023818 100644 --- a/build_files/build_environment/cmake/versions.cmake +++ b/build_files/build_environment/cmake/versions.cmake @@ -83,9 +83,9 @@ else() set(OPENEXR_VERSION_POSTFIX) endif() -set(FREETYPE_VERSION 2.11.0) +set(FREETYPE_VERSION 2.11.1) set(FREETYPE_URI http://prdownloads.sourceforge.net/freetype/freetype-${FREETYPE_VERSION}.tar.gz) -set(FREETYPE_HASH cf09172322f6b50cf8f568bf8fe14bde) +set(FREETYPE_HASH bd4e3b007474319909a6b79d50908e85) set(FREETYPE_HASH_TYPE MD5) set(FREETYPE_FILE freetype-${FREETYPE_VERSION}.tar.gz) From 0f40855a09d8696b91f4da06f1b5b1d5c720f303 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 4 Feb 2022 16:36:26 +0100 Subject: [PATCH 2/6] Fix T93851: Cycles wrong glossy indirect pass with volumes --- .../cycles/kernel/integrator/shade_surface.h | 23 ++++++++++++------- .../cycles/kernel/integrator/shade_volume.h | 22 +++++++++++++----- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/intern/cycles/kernel/integrator/shade_surface.h b/intern/cycles/kernel/integrator/shade_surface.h index 329380fc464..10d3cbf7f57 100644 --- a/intern/cycles/kernel/integrator/shade_surface.h +++ b/intern/cycles/kernel/integrator/shade_surface.h @@ -193,17 +193,24 @@ ccl_device_forceinline void integrate_surface_direct_light(KernelGlobals kg, const uint16_t transparent_bounce = INTEGRATOR_STATE(state, path, transparent_bounce); uint32_t shadow_flag = INTEGRATOR_STATE(state, path, flag); shadow_flag |= (is_light) ? PATH_RAY_SHADOW_FOR_LIGHT : 0; - shadow_flag |= (shadow_flag & PATH_RAY_ANY_PASS) ? 0 : PATH_RAY_SURFACE_PASS; const float3 throughput = INTEGRATOR_STATE(state, path, throughput) * bsdf_eval_sum(&bsdf_eval); if (kernel_data.kernel_features & KERNEL_FEATURE_LIGHT_PASSES) { - const packed_float3 pass_diffuse_weight = - (bounce == 0) ? packed_float3(bsdf_eval_pass_diffuse_weight(&bsdf_eval)) : - INTEGRATOR_STATE(state, path, pass_diffuse_weight); - const packed_float3 pass_glossy_weight = (bounce == 0) ? - packed_float3( - bsdf_eval_pass_glossy_weight(&bsdf_eval)) : - INTEGRATOR_STATE(state, path, pass_glossy_weight); + packed_float3 pass_diffuse_weight; + packed_float3 pass_glossy_weight; + + if (shadow_flag & PATH_RAY_ANY_PASS) { + /* Indirect bounce, use weights from earlier surface or volume bounce. */ + pass_diffuse_weight = INTEGRATOR_STATE(state, path, pass_diffuse_weight); + pass_glossy_weight = INTEGRATOR_STATE(state, path, pass_glossy_weight); + } + else { + /* Direct light, use BSDFs at this bounce. */ + shadow_flag |= PATH_RAY_SURFACE_PASS; + pass_diffuse_weight = packed_float3(bsdf_eval_pass_diffuse_weight(&bsdf_eval)); + pass_glossy_weight = packed_float3(bsdf_eval_pass_glossy_weight(&bsdf_eval)); + } + INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, pass_diffuse_weight) = pass_diffuse_weight; INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, pass_glossy_weight) = pass_glossy_weight; } diff --git a/intern/cycles/kernel/integrator/shade_volume.h b/intern/cycles/kernel/integrator/shade_volume.h index e8d7bfa1374..c59234553a7 100644 --- a/intern/cycles/kernel/integrator/shade_volume.h +++ b/intern/cycles/kernel/integrator/shade_volume.h @@ -801,16 +801,26 @@ ccl_device_forceinline void integrate_volume_direct_light( const uint16_t transparent_bounce = INTEGRATOR_STATE(state, path, transparent_bounce); uint32_t shadow_flag = INTEGRATOR_STATE(state, path, flag); shadow_flag |= (is_light) ? PATH_RAY_SHADOW_FOR_LIGHT : 0; - shadow_flag |= (shadow_flag & PATH_RAY_ANY_PASS) ? 0 : PATH_RAY_VOLUME_PASS; const float3 throughput_phase = throughput * bsdf_eval_sum(&phase_eval); if (kernel_data.kernel_features & KERNEL_FEATURE_LIGHT_PASSES) { - const packed_float3 pass_diffuse_weight = (bounce == 0) ? - packed_float3(one_float3()) : - INTEGRATOR_STATE( - state, path, pass_diffuse_weight); + packed_float3 pass_diffuse_weight; + packed_float3 pass_glossy_weight; + + if (shadow_flag & PATH_RAY_ANY_PASS) { + /* Indirect bounce, use weights from earlier surface or volume bounce. */ + pass_diffuse_weight = INTEGRATOR_STATE(state, path, pass_diffuse_weight); + pass_glossy_weight = INTEGRATOR_STATE(state, path, pass_glossy_weight); + } + else { + /* Direct light, no diffuse/glossy distinction needed for volumes. */ + shadow_flag |= PATH_RAY_VOLUME_PASS; + pass_diffuse_weight = packed_float3(one_float3()); + pass_glossy_weight = packed_float3(zero_float3()); + } + INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, pass_diffuse_weight) = pass_diffuse_weight; - INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, pass_glossy_weight) = zero_float3(); + INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, pass_glossy_weight) = pass_glossy_weight; } INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, render_pixel_index) = INTEGRATOR_STATE( From edb0e7ca303381a83debfb3de159e3cd71d39312 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 4 Feb 2022 18:15:39 +0100 Subject: [PATCH 3/6] Fix T95471: baking normals wrong after recent MVert normals refactor --- source/blender/render/intern/bake.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/render/intern/bake.c b/source/blender/render/intern/bake.c index 93d2f721cc5..883e026472b 100644 --- a/source/blender/render/intern/bake.c +++ b/source/blender/render/intern/bake.c @@ -512,9 +512,9 @@ static TriTessFace *mesh_calc_tri_tessface(Mesh *me, bool tangent, Mesh *me_eval triangles[i].mverts[0] = &mvert[me->mloop[lt->tri[0]].v]; triangles[i].mverts[1] = &mvert[me->mloop[lt->tri[1]].v]; triangles[i].mverts[2] = &mvert[me->mloop[lt->tri[2]].v]; - triangles[i].vert_normals[0] = &vert_normals[me->mloop[lt->tri[0]].v][0]; - triangles[i].vert_normals[1] = &vert_normals[me->mloop[lt->tri[1]].v][1]; - triangles[i].vert_normals[2] = &vert_normals[me->mloop[lt->tri[2]].v][2]; + triangles[i].vert_normals[0] = vert_normals[me->mloop[lt->tri[0]].v]; + triangles[i].vert_normals[1] = vert_normals[me->mloop[lt->tri[1]].v]; + triangles[i].vert_normals[2] = vert_normals[me->mloop[lt->tri[2]].v]; triangles[i].is_smooth = (mp->flag & ME_SMOOTH) != 0; if (tangent) { From b61cb67e6d3059861947c90d073b3b00fdbb4571 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 4 Feb 2022 18:52:47 +0100 Subject: [PATCH 4/6] Fix T94410: stopping Cycles render in 3D viewport quad view keeps using CPU Only one of the four renders was being stopped. --- source/blender/editors/space_view3d/space_view3d.c | 1 - 1 file changed, 1 deletion(-) diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 0a5bebac8a8..595ae3d8457 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -243,7 +243,6 @@ void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *area) for (region = area->regionbase.first; region; region = region->next) { if ((region->regiontype == RGN_TYPE_WINDOW) && region->regiondata) { ED_view3d_stop_render_preview(wm, region); - break; } } } From 0446c9c87564ce233a8cb58a69c9ffa4a6f78969 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Fri, 4 Feb 2022 12:21:01 -0600 Subject: [PATCH 5/6] Fix: Incorrect default distance for merge by distance node This was an oversight in the patch that added this node, the default merge distance is meant to be the same as the weld modifier, 0.001m, meaning by in most situations it removes vertices generally at the same location. --- .../blender/nodes/geometry/nodes/node_geo_merge_by_distance.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/nodes/geometry/nodes/node_geo_merge_by_distance.cc b/source/blender/nodes/geometry/nodes/node_geo_merge_by_distance.cc index deb149fd0f0..3c790079b5b 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_merge_by_distance.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_merge_by_distance.cc @@ -26,7 +26,7 @@ static void node_declare(NodeDeclarationBuilder &b) b.add_input(N_("Geometry")) .supported_type({GEO_COMPONENT_TYPE_POINT_CLOUD, GEO_COMPONENT_TYPE_MESH}); b.add_input(N_("Selection")).default_value(true).hide_value().supports_field(); - b.add_input(N_("Distance")).default_value(0.1f).min(0.0f).subtype(PROP_DISTANCE); + b.add_input(N_("Distance")).default_value(0.001f).min(0.0f).subtype(PROP_DISTANCE); b.add_output(N_("Geometry")); } From 260e6fd46b6684a7f52a02073ce567003fc52045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 4 Feb 2022 19:34:43 +0100 Subject: [PATCH 6/6] Workbench: Fix unreported heavily quantized mesh due to driver issue Detected on `amdgpu-pro` libGL implementation. The workaround is to not use explicit location for vertex attributes. This is not a real problem as we don't rely on them for now. --- source/blender/gpu/opengl/gl_shader.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/gpu/opengl/gl_shader.cc b/source/blender/gpu/opengl/gl_shader.cc index e031047f844..f0a4b5b7f58 100644 --- a/source/blender/gpu/opengl/gl_shader.cc +++ b/source/blender/gpu/opengl/gl_shader.cc @@ -432,7 +432,9 @@ std::string GLShader::vertex_interface_declare(const ShaderCreateInfo &info) con ss << "\n/* Inputs. */\n"; for (const ShaderCreateInfo::VertIn &attr : info.vertex_inputs_) { - if (GLContext::explicit_location_support) { + if (GLContext::explicit_location_support && + /* Fix issue with amdgpu-pro + workbench_prepass_mesh_vert.glsl being quantized. */ + GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_OFFICIAL) == false) { ss << "layout(location = " << attr.index << ") "; } ss << "in " << to_string(attr.type) << " " << attr.name << ";\n";