[Bf-blender-cvs] [773a36d2f80] master: Fix Cycles OneAPI build error after recent changes

2023-02-06 Thread Brecht Van Lommel
Commit: 773a36d2f8056c8a81dc50d2308f1fb95d994e0e
Author: Brecht Van Lommel
Date:   Mon Feb 6 15:28:40 2023 +0100
Branches: master
https://developer.blender.org/rB773a36d2f8056c8a81dc50d2308f1fb95d994e0e

Fix Cycles OneAPI build error after recent changes

===

M   intern/cycles/kernel/device/gpu/kernel.h
M   intern/cycles/kernel/device/oneapi/kernel.cpp

===

diff --git a/intern/cycles/kernel/device/gpu/kernel.h 
b/intern/cycles/kernel/device/gpu/kernel.h
index a9d19615900..821fc1eaf15 100644
--- a/intern/cycles/kernel/device/gpu/kernel.h
+++ b/intern/cycles/kernel/device/gpu/kernel.h
@@ -431,6 +431,7 @@ ccl_gpu_kernel_threads(GPU_PARALLEL_SORT_BLOCK_SIZE)
 metal_grid_id);
 #endif
 }
+ccl_gpu_kernel_postfix
 
 ccl_gpu_kernel_threads(GPU_PARALLEL_SORT_BLOCK_SIZE)
 ccl_gpu_kernel_signature(integrator_sort_write_pass,
diff --git a/intern/cycles/kernel/device/oneapi/kernel.cpp 
b/intern/cycles/kernel/device/oneapi/kernel.cpp
index 56c1e7ca47c..c53088d49ce 100644
--- a/intern/cycles/kernel/device/oneapi/kernel.cpp
+++ b/intern/cycles/kernel/device/oneapi/kernel.cpp
@@ -372,6 +372,16 @@ bool oneapi_enqueue_kernel(KernelContext *kernel_context,
   kg, cgh, global_size, local_size, args, 
oneapi_kernel_integrator_sorted_paths_array);
   break;
 }
+case DEVICE_KERNEL_INTEGRATOR_SORT_BUCKET_PASS: {
+  oneapi_call(
+  kg, cgh, global_size, local_size, args, 
oneapi_kernel_integrator_sort_bucket_pass);
+  break;
+}
+case DEVICE_KERNEL_INTEGRATOR_SORT_WRITE_PASS: {
+  oneapi_call(
+  kg, cgh, global_size, local_size, args, 
oneapi_kernel_integrator_sort_write_pass);
+  break;
+}
 case DEVICE_KERNEL_INTEGRATOR_COMPACT_PATHS_ARRAY: {
   oneapi_call(kg,
   cgh,

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9ad3a85f8b5] master: Fix Cycles GPU binaries build error after recent changes for Metal

2023-02-06 Thread Brecht Van Lommel
Commit: 9ad3a85f8b5639c47bd0600475bd3c81d6437d50
Author: Brecht Van Lommel
Date:   Mon Feb 6 13:17:57 2023 +0100
Branches: master
https://developer.blender.org/rB9ad3a85f8b5639c47bd0600475bd3c81d6437d50

Fix Cycles GPU binaries build error after recent changes for Metal

===

M   intern/cycles/kernel/device/gpu/parallel_sorted_index.h

===

diff --git a/intern/cycles/kernel/device/gpu/parallel_sorted_index.h 
b/intern/cycles/kernel/device/gpu/parallel_sorted_index.h
index d58ba6134ee..749221af8f9 100644
--- a/intern/cycles/kernel/device/gpu/parallel_sorted_index.h
+++ b/intern/cycles/kernel/device/gpu/parallel_sorted_index.h
@@ -19,11 +19,10 @@ CCL_NAMESPACE_BEGIN
 #  define GPU_PARALLEL_SORTED_INDEX_DEFAULT_BLOCK_SIZE 512
 #endif
 #define GPU_PARALLEL_SORTED_INDEX_INACTIVE_KEY (~0)
+#define GPU_PARALLEL_SORT_BLOCK_SIZE 1024
 
 #if defined(__KERNEL_LOCAL_ATOMIC_SORT__)
 
-#  define GPU_PARALLEL_SORT_BLOCK_SIZE 1024
-
 #  define atomic_store_local(p, x) \
 atomic_store_explicit((threadgroup atomic_int *)p, x, memory_order_relaxed)
 #  define atomic_load_local(p) \

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8c7cca66f06] blender-v3.3-release: Build: library security updates for Blender 3.3.4

2023-02-02 Thread Brecht Van Lommel
Commit: 8c7cca66f06ba756dd29354e3583d7aba9145bfa
Author: Brecht Van Lommel
Date:   Thu Feb 2 16:42:03 2023 +0100
Branches: blender-v3.3-release
https://developer.blender.org/rB8c7cca66f06ba756dd29354e3583d7aba9145bfa

Build: library security updates for Blender 3.3.4

Various things found by make cve_check.

Differential Revision: https://developer.blender.org/D16956

===

M   build_files/build_environment/cmake/cve_check.csv.in
M   build_files/build_environment/cmake/python_site_packages.cmake
M   build_files/build_environment/cmake/versions.cmake

===

diff --git a/build_files/build_environment/cmake/cve_check.csv.in 
b/build_files/build_environment/cmake/cve_check.csv.in
index 946dda5ab17..5a4acb97a4d 100644
--- a/build_files/build_environment/cmake/cve_check.csv.in
+++ b/build_files/build_environment/cmake/cve_check.csv.in
@@ -1,5 +1,10 @@
 vendor,product,version,cve_number,remarks,comment
+@FMT_ID@,OSV-2021-991,Ignored,CVE marked as invalid but OSV not updated
+@FREETYPE_ID@,CVE-2022-27404,Ignored,does not affect blender usage of freetype
+@FREETYPE_ID@,CVE-2022-27405,Ignored,does not affect blender usage of freetype
+@FREETYPE_ID@,CVE-2022-27406,Ignored,does not affect blender usage of freetype
 @OPENJPEG_ID@,CVE-2016-9675,Ignored,issue in convert command line tool not 
used by blender
+@OPENJPEG_ID@,OSV-2022-416,Mitigated,using newer git revision with fix included
 @PYTHON_ID@,CVE-2009-2940,Ignored,issue in pygresql not used by blender
 @PYTHON_ID@,CVE-2020-29396,Ignored,issue in odoo not used by blender
 @PYTHON_ID@,CVE-2021-32052,Ignored,issue in django not used by blender
@@ -23,7 +28,13 @@ vendor,product,version,cve_number,remarks,comment
 @TIFF_ID@,CVE-2022-3599,Ignored,issue in tiff command line tool not used by 
blender
 @TIFF_ID@,CVE-2022-3626,Ignored,issue in tiff command line tool not used by 
blender
 @TIFF_ID@,CVE-2022-3627,Ignored,issue in tiff command line tool not used by 
blender
+@TIFF_ID@,CVE-2022-48281,Ignored,issue in tiff command line tool not used by 
blender
 @XML2_ID@,CVE-2016-3709,Ignored,not affecting blender and not considered a 
security issue upstream
+@XML2_ID@,OSV-2021-777,Ignored,already fixed in version used so OSV invalid
+@XML2_ID@,CVE-2022-40303,Ignored,fixed and cve_check version comparison is 
wrong
+@XML2_ID@,CVE-2022-40304,Ignored,fixed and cve_check version comparison is 
wrong
 @GMP_ID@,CVE-2021-43618,Mitigated,patched using upstream commit 561a9c25298e
 @SQLITE_ID@,CVE-2022-35737,Ignored,only affects SQLITE_ENABLE_STAT4 compile 
option not used by blender or python
+@SQLITE_ID@,CVE-2022-46908,Ignored,only affects CLI tools not used by blender 
or python
+@BROTLI_ID@,CVE-2020-8927,Ignored,fixed and cve_check version comparison is 
wrong
 @SBOMCONTENTS@
diff --git a/build_files/build_environment/cmake/python_site_packages.cmake 
b/build_files/build_environment/cmake/python_site_packages.cmake
index 55d0d6c7400..3bb12512d44 100644
--- a/build_files/build_environment/cmake/python_site_packages.cmake
+++ b/build_files/build_environment/cmake/python_site_packages.cmake
@@ -15,7 +15,21 @@ ExternalProject_Add(external_python_site_packages
   CONFIGURE_COMMAND ${PIP_CONFIGURE_COMMAND}
   BUILD_COMMAND ""
   PREFIX ${BUILD_DIR}/site_packages
-  INSTALL_COMMAND ${PYTHON_BINARY} -m pip install --no-cache-dir 
${SITE_PACKAGES_EXTRA} cython==${CYTHON_VERSION} idna==${IDNA_VERSION} 
charset-normalizer==${CHARSET_NORMALIZER_VERSION} urllib3==${URLLIB3_VERSION} 
certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} 
zstandard==${ZSTANDARD_VERSION} autopep8==${AUTOPEP8_VERSION} 
pycodestyle==${PYCODESTYLE_VERSION} toml==${TOML_VERSION} --no-binary :all:
+  # setuptools is downgraded to 63.2.0 (same as python 3.10.8) since numpy 
1.23.x seemingly has
+  # issues building on windows with the newer versions that ships with python 
3.10.9+
+  INSTALL_COMMAND ${PYTHON_BINARY} -m pip install --no-cache-dir 
${SITE_PACKAGES_EXTRA}
+  setuptools==63.2.0
+  cython==${CYTHON_VERSION}
+  idna==${IDNA_VERSION}
+  charset-normalizer==${CHARSET_NORMALIZER_VERSION}
+  urllib3==${URLLIB3_VERSION}
+  certifi==${CERTIFI_VERSION}
+  requests==${REQUESTS_VERSION}
+  zstandard==${ZSTANDARD_VERSION}
+  autopep8==${AUTOPEP8_VERSION}
+  pycodestyle==${PYCODESTYLE_VERSION}
+  toml==${TOML_VERSION}
+  --no-binary :all:
 )
 
 if(USE_PIP_NUMPY)
diff --git a/build_files/build_environment/cmake/versions.cmake 
b/build_files/build_environment/cmake/versions.cmake
index 6f7c62477cf..d6727dbacfe 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -182,9 +182,9 @@ set(ROBINMAP_HASH 
c08ec4b1bf1c85eb0d6432244a6a89862229da1cb834f3f90fba8dc35d8c8e
 set(ROBINMAP_HASH_TYPE SHA256)
 set(ROBINMAP_FILE robinmap-${ROBINMAP_VERSION}.tar.gz)
 
-set(TIFF_VERSION 4.4.0)
+set(TIFF_VERSION 4.5.0)
 se

[Bf-blender-cvs] [e636c4e4c4a] blender-v3.3-release: Bump version to 3.3.4rc

2023-02-02 Thread Brecht Van Lommel
Commit: e636c4e4c4ab84730dca7f8d5d0587279c462ebb
Author: Brecht Van Lommel
Date:   Wed Feb 1 17:45:04 2023 +0100
Branches: blender-v3.3-release
https://developer.blender.org/rBe636c4e4c4ab84730dca7f8d5d0587279c462ebb

Bump version to 3.3.4rc

===

M   source/blender/blenkernel/BKE_blender_version.h

===

diff --git a/source/blender/blenkernel/BKE_blender_version.h 
b/source/blender/blenkernel/BKE_blender_version.h
index 176f500803e..63ca11b9406 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -19,9 +19,9 @@ extern "C" {
 /* Blender major and minor version. */
 #define BLENDER_VERSION 303
 /* Blender patch version for bugfix releases. */
-#define BLENDER_VERSION_PATCH 3
+#define BLENDER_VERSION_PATCH 4
 /** Blender release cycle stage: alpha/beta/rc/release. */
-#define BLENDER_VERSION_CYCLE release
+#define BLENDER_VERSION_CYCLE rc
 
 /* Blender file format version. */
 #define BLENDER_FILE_VERSION BLENDER_VERSION

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ea8fd343eb2] master: Gitea: add merge message templates

2023-01-30 Thread Brecht Van Lommel
Commit: ea8fd343eb2cd44057db1bb6bcca4b832da5ad35
Author: Brecht Van Lommel
Date:   Mon Jan 30 23:48:01 2023 +0100
Branches: master
https://developer.blender.org/rBea8fd343eb2cd44057db1bb6bcca4b832da5ad35

Gitea: add merge message templates

To add the pull request # at the end of the commit.

===

A   .gitea/default_merge_message/REBASE_TEMPLATE.md
A   .gitea/default_merge_message/SQUASH_TEMPLATE.md

===

diff --git a/.gitea/default_merge_message/REBASE_TEMPLATE.md 
b/.gitea/default_merge_message/REBASE_TEMPLATE.md
new file mode 100644
index 000..87a09370e27
--- /dev/null
+++ b/.gitea/default_merge_message/REBASE_TEMPLATE.md
@@ -0,0 +1,5 @@
+${CommitTitle}
+
+${CommitBody}
+
+Pull Request #${PullRequestIndex}
diff --git a/.gitea/default_merge_message/SQUASH_TEMPLATE.md 
b/.gitea/default_merge_message/SQUASH_TEMPLATE.md
new file mode 100644
index 000..36123d4d8ce
--- /dev/null
+++ b/.gitea/default_merge_message/SQUASH_TEMPLATE.md
@@ -0,0 +1,3 @@
+${PullRequestTitle}
+
+Pull Request #${PullRequestIndex}

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [52ed8bcb274] master: Gitea: fix pull request template so commit body can be set as description

2023-01-28 Thread Brecht Van Lommel
Commit: 52ed8bcb274e2b2fb636c03447ba4263fa9bdd24
Author: Brecht Van Lommel
Date:   Sat Jan 28 18:10:34 2023 +0100
Branches: master
https://developer.blender.org/rB52ed8bcb274e2b2fb636c03447ba4263fa9bdd24

Gitea: fix pull request template so commit body can be set as description

===

M   .gitea/pull_request_template.yaml

===

diff --git a/.gitea/pull_request_template.yaml 
b/.gitea/pull_request_template.yaml
index a6f1f2db20f..b3f45baf96b 100644
--- a/.gitea/pull_request_template.yaml
+++ b/.gitea/pull_request_template.yaml
@@ -15,7 +15,3 @@ body:
 attributes:
   label: "Description"
   hide_label: true
-  value: |
-   Description of the problem that is addressed in the patch.
-
-   Description of the proposed solution and its implementation.

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [feae1c7d055] master: Gitea: update issue template with new scoped labels and other tweaks

2023-01-25 Thread Brecht Van Lommel
Commit: feae1c7d055f8817a9f0cedbb9a1432aede7f9cb
Author: Brecht Van Lommel
Date:   Wed Jan 25 13:54:51 2023 +0100
Branches: master
https://developer.blender.org/rBfeae1c7d055f8817a9f0cedbb9a1432aede7f9cb

Gitea: update issue template with new scoped labels and other tweaks

===

M   .gitea/issue_template/bug.yaml
M   .gitea/issue_template/design.yaml
M   .gitea/issue_template/todo.yaml
M   .gitea/pull_request_template.yaml

===

diff --git a/.gitea/issue_template/bug.yaml b/.gitea/issue_template/bug.yaml
index 9c4618c3223..4e3c550dae9 100644
--- a/.gitea/issue_template/bug.yaml
+++ b/.gitea/issue_template/bug.yaml
@@ -1,13 +1,15 @@
 name: Bug Report
 about: File a bug report
 labels:
-  - bug
+  - "type::Report"
+  - "status::Needs Triage"
+  - "priority::Normal"
 body:
   - type: markdown
 attributes:
   value: |
 ### Instructions
-First time reporting? See 
[tips](https://wiki.blender.org/wiki/Process/Bug_Reports) and [walkthrough 
video](https://www.youtube.com/watch?v=JTD0OJq_rF4).
+First time reporting? See 
[tips](https://wiki.blender.org/wiki/Process/Bug_Reports).
 
 * Use **Help > Report a Bug** in Blender to fill system 
information and exact Blender version.
 * Test [daily builds](https://builder.blender.org/) to verify 
if the issue is already fixed.
@@ -19,6 +21,7 @@ body:
 id: body
 attributes:
   label: "Description"
+  hide_label: true
   value: |
**System Information**
Operating system:
diff --git a/.gitea/issue_template/design.yaml 
b/.gitea/issue_template/design.yaml
index 8c2c6deef29..a1dcd8b0eda 100644
--- a/.gitea/issue_template/design.yaml
+++ b/.gitea/issue_template/design.yaml
@@ -1,9 +1,10 @@
 name: Design
 about: Create a design task (for developers only)
 labels:
-  - design
+  - "type::Design"
 body:
   - type: textarea
 id: body
 attributes:
   label: "Description"
+  hide_label: true
diff --git a/.gitea/issue_template/todo.yaml b/.gitea/issue_template/todo.yaml
index e7fecf043ca..58e848c3e18 100644
--- a/.gitea/issue_template/todo.yaml
+++ b/.gitea/issue_template/todo.yaml
@@ -1,9 +1,10 @@
 name: To Do
 about: Create a to do task (for developers only)
 labels:
-  - todo
+  - "type::To Do"
 body:
   - type: textarea
 id: body
 attributes:
   label: "Description"
+  hide_label: true
diff --git a/.gitea/pull_request_template.yaml 
b/.gitea/pull_request_template.yaml
index 6affe8cf8d2..a6f1f2db20f 100644
--- a/.gitea/pull_request_template.yaml
+++ b/.gitea/pull_request_template.yaml
@@ -14,6 +14,7 @@ body:
 id: body
 attributes:
   label: "Description"
+  hide_label: true
   value: |
Description of the problem that is addressed in the patch.

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8e56ded86d6] master: Cycles: temporarily disable AMD Vega GPU rendering due to compiler bug

2023-01-23 Thread Brecht Van Lommel
Commit: 8e56ded86d6261e8a937ab6ca8d724f0f42814c2
Author: Brecht Van Lommel
Date:   Mon Jan 23 11:56:12 2023 +0100
Branches: master
https://developer.blender.org/rB8e56ded86d6261e8a937ab6ca8d724f0f42814c2

Cycles: temporarily disable AMD Vega GPU rendering due to compiler bug

To make daily builds pass while we figure this out.

Ref T104097

===

M   CMakeLists.txt
M   intern/cycles/blender/addon/properties.py
M   intern/cycles/device/hip/util.h

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 94bad8c20fc..df1a5a88550 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -506,7 +506,7 @@ endif()
 if(NOT APPLE)
   option(WITH_CYCLES_DEVICE_HIP"Enable Cycles AMD HIP support" ON)
   option(WITH_CYCLES_HIP_BINARIES  "Build Cycles AMD HIP binaries" OFF)
-  set(CYCLES_HIP_BINARIES_ARCH gfx900 gfx906 gfx90c gfx902 gfx1010 gfx1011 
gfx1012 gfx1030 gfx1031 gfx1032 gfx1034 gfx1035 gfx1100 gfx1101 gfx1102 CACHE 
STRING "AMD HIP architectures to build binaries for")
+  set(CYCLES_HIP_BINARIES_ARCH gfx1010 gfx1011 gfx1012 gfx1030 gfx1031 gfx1032 
gfx1034 gfx1035 gfx1100 gfx1101 gfx1102 CACHE STRING "AMD HIP architectures to 
build binaries for")
   mark_as_advanced(WITH_CYCLES_DEVICE_HIP)
   mark_as_advanced(CYCLES_HIP_BINARIES_ARCH)
 endif()
diff --git a/intern/cycles/blender/addon/properties.py 
b/intern/cycles/blender/addon/properties.py
index 9c1cb0a1b4a..62d5ce8a572 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -1671,10 +1671,10 @@ class CyclesPreferences(bpy.types.AddonPreferences):
 elif device_type == 'HIP':
 import sys
 if sys.platform[:3] == "win":
-col.label(text="Requires AMD GPU with Vega or RDNA 
architecture", icon='BLANK1')
+col.label(text="Requires AMD GPU with RDNA architecture", 
icon='BLANK1')
 col.label(text="and AMD Radeon Pro 21.Q4 driver or newer", 
icon='BLANK1')
 elif sys.platform.startswith("linux"):
-col.label(text="Requires AMD GPU with Vega or RDNA 
architecture", icon='BLANK1')
+col.label(text="Requires AMD GPU with RDNA architecture", 
icon='BLANK1')
 col.label(text="and AMD driver version 22.10 or newer", 
icon='BLANK1')
 elif device_type == 'ONEAPI':
 import sys
diff --git a/intern/cycles/device/hip/util.h b/intern/cycles/device/hip/util.h
index 4e4906171d1..c8b4b67ded8 100644
--- a/intern/cycles/device/hip/util.h
+++ b/intern/cycles/device/hip/util.h
@@ -51,7 +51,7 @@ static inline bool hipSupportsDevice(const int hipDevId)
   hipDeviceGetAttribute(, hipDeviceAttributeComputeCapabilityMajor, 
hipDevId);
   hipDeviceGetAttribute(, hipDeviceAttributeComputeCapabilityMinor, 
hipDevId);
 
-  return (major >= 9);
+  return (major >= 10);
 }
 
 CCL_NAMESPACE_END

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [37dfce550f1] master: Fix Cycles CUDA compiler warning with if constexpr

2023-01-20 Thread Brecht Van Lommel
Commit: 37dfce550f10462b4d2e5bf8185d21ea01a1eb9f
Author: Brecht Van Lommel
Date:   Fri Jan 20 20:15:31 2023 +0100
Branches: master
https://developer.blender.org/rB37dfce550f10462b4d2e5bf8185d21ea01a1eb9f

Fix Cycles CUDA compiler warning with if constexpr

This is a C++17 feature, compiler should be able to figure this out
without the hint.

===

M   intern/cycles/kernel/closure/bsdf_microfacet.h

===

diff --git a/intern/cycles/kernel/closure/bsdf_microfacet.h 
b/intern/cycles/kernel/closure/bsdf_microfacet.h
index 83051f08f40..80c47bc9542 100644
--- a/intern/cycles/kernel/closure/bsdf_microfacet.h
+++ b/intern/cycles/kernel/closure/bsdf_microfacet.h
@@ -210,7 +210,7 @@ ccl_device_forceinline float3 
microfacet_sample_stretched(KernelGlobals kg,
   /* 2. sample P22_{wi}(x_slope, y_slope, 1, 1) */
   float slope_x, slope_y;
 
-  if constexpr (m_type == MicrofacetType::BECKMANN) {
+  if (m_type == MicrofacetType::BECKMANN) {
 microfacet_beckmann_sample_slopes(
 kg, costheta_, sintheta_, randu, randv, _x, _y, G1i);
   }
@@ -275,13 +275,14 @@ ccl_device_forceinline float bsdf_clearcoat_D(float 
alpha2, float cos_NH)
 template
 ccl_device_inline float bsdf_G1_from_sqr_alpha_tan_n(float sqr_alpha_tan_n)
 {
-  if constexpr (m_type == MicrofacetType::GGX) {
+  if (m_type == MicrofacetType::GGX) {
 return 2.0f / (1.0f + sqrtf(1.0f + sqr_alpha_tan_n));
   }
-
-  /* m_type == MicrofacetType::BECKMANN */
-  const float a = inversesqrtf(sqr_alpha_tan_n);
-  return (a > 1.6f) ? 1.0f : ((2.181f * a + 3.535f) * a) / ((2.577f * a + 
2.276f) * a + 1.0f);
+  else {
+/* m_type == MicrofacetType::BECKMANN */
+const float a = inversesqrtf(sqr_alpha_tan_n);
+return (a > 1.6f) ? 1.0f : ((2.181f * a + 3.535f) * a) / ((2.577f * a + 
2.276f) * a + 1.0f);
+  }
 }
 
 template ccl_device_inline float bsdf_G1(float alpha2, 
float cos_N)
@@ -308,12 +309,13 @@ template ccl_device_inline float 
bsdf_D(float alpha2, flo
 {
   const float cos_NH2 = sqr(cos_NH);
 
-  if constexpr (m_type == MicrofacetType::BECKMANN) {
+  if (m_type == MicrofacetType::BECKMANN) {
 return expf((1.0f - 1.0f / cos_NH2) / alpha2) / (M_PI_F * alpha2 * 
sqr(cos_NH2));
   }
-
-  /* m_type == MicrofacetType::GGX */
-  return alpha2 / (M_PI_F * sqr(1.0f + (alpha2 - 1.0f) * cos_NH2));
+  else {
+/* m_type == MicrofacetType::GGX */
+return alpha2 / (M_PI_F * sqr(1.0f + (alpha2 - 1.0f) * cos_NH2));
+  }
 }
 
 template
@@ -324,12 +326,13 @@ ccl_device_inline float bsdf_aniso_D(float alpha_x, float 
alpha_y, float3 H)
   const float cos_NH2 = sqr(H.z);
   const float alpha2 = alpha_x * alpha_y;
 
-  if constexpr (m_type == MicrofacetType::BECKMANN) {
+  if (m_type == MicrofacetType::BECKMANN) {
 return expf(-(sqr(H.x) + sqr(H.y)) / cos_NH2) / (M_PI_F * alpha2 * 
sqr(cos_NH2));
   }
-
-  /* m_type == MicrofacetType::GGX */
-  return M_1_PI_F / (alpha2 * sqr(len_squared(H)));
+  else {
+/* m_type == MicrofacetType::GGX */
+return M_1_PI_F / (alpha2 * sqr(len_squared(H)));
+  }
 }
 
 ccl_device_forceinline void bsdf_microfacet_fresnel_color(ccl_private const 
ShaderData *sd,

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [670b3c5013d] master: Cleanup: compiler warnings

2023-01-19 Thread Brecht Van Lommel
Commit: 670b3c5013d107bde5504f2ef5930fb604888ffc
Author: Brecht Van Lommel
Date:   Thu Jan 19 22:36:07 2023 +0100
Branches: master
https://developer.blender.org/rB670b3c5013d107bde5504f2ef5930fb604888ffc

Cleanup: compiler warnings

===

M   intern/cycles/kernel/data_template.h
M   source/blender/modifiers/intern/MOD_ocean.c

===

diff --git a/intern/cycles/kernel/data_template.h 
b/intern/cycles/kernel/data_template.h
index dceae4b77c1..f1589a4d10b 100644
--- a/intern/cycles/kernel/data_template.h
+++ b/intern/cycles/kernel/data_template.h
@@ -220,4 +220,5 @@ KERNEL_STRUCT_END(KernelSVMUsage)
 
 #undef KERNEL_STRUCT_BEGIN
 #undef KERNEL_STRUCT_MEMBER
+#undef KERNEL_STRUCT_MEMBER_DONT_SPECIALIZE
 #undef KERNEL_STRUCT_END
diff --git a/source/blender/modifiers/intern/MOD_ocean.c 
b/source/blender/modifiers/intern/MOD_ocean.c
index 9081ebd85fb..cad2f57e45a 100644
--- a/source/blender/modifiers/intern/MOD_ocean.c
+++ b/source/blender/modifiers/intern/MOD_ocean.c
@@ -336,7 +336,7 @@ static Mesh *doOcean(ModifierData *md, const 
ModifierEvalContext *ctx, Mesh *mes
   }
 
   /* do ocean simulation */
-  if (omd->cached == true) {
+  if (omd->cached) {
 if (!omd->oceancache) {
   init_cache_data(ob, omd, resolution);
 }
@@ -403,7 +403,7 @@ static Mesh *doOcean(ModifierData *md, const 
ModifierEvalContext *ctx, Mesh *mes
   const float v = OCEAN_CO(size_co_inv, vco[1]);
   float foam;
 
-  if (omd->oceancache && omd->cached == true) {
+  if (omd->oceancache && omd->cached) {
 BKE_ocean_cache_eval_uv(omd->oceancache, , cfra_for_cache, u, 
v);
 foam = ocr.foam;
 CLAMP(foam, 0.0f, 1.0f);
@@ -450,7 +450,7 @@ static Mesh *doOcean(ModifierData *md, const 
ModifierEvalContext *ctx, Mesh *mes
   const float u = OCEAN_CO(size_co_inv, vco[0]);
   const float v = OCEAN_CO(size_co_inv, vco[1]);
 
-  if (omd->oceancache && omd->cached == true) {
+  if (omd->oceancache && omd->cached) {
 BKE_ocean_cache_eval_uv(omd->oceancache, , cfra_for_cache, u, v);
   }
   else {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [fe552bf236f] master: Cleanup: make format

2023-01-19 Thread Brecht Van Lommel
Commit: fe552bf236fcbff92f54299e575c5eda74cfb57f
Author: Brecht Van Lommel
Date:   Thu Jan 19 22:30:10 2023 +0100
Branches: master
https://developer.blender.org/rBfe552bf236fcbff92f54299e575c5eda74cfb57f

Cleanup: make format

===

M   intern/cycles/device/metal/device_impl.mm
M   intern/cycles/device/metal/kernel.mm
M   intern/cycles/kernel/data_template.h
M   intern/cycles/kernel/osl/types.h

===

diff --git a/intern/cycles/device/metal/device_impl.mm 
b/intern/cycles/device/metal/device_impl.mm
index 917945fbdb6..453418386a4 100644
--- a/intern/cycles/device/metal/device_impl.mm
+++ b/intern/cycles/device/metal/device_impl.mm
@@ -335,9 +335,11 @@ void MetalDevice::make_source(MetalPipelineType pso_type, 
const uint kernel_feat
 #  define KERNEL_STRUCT_MEMBER(parent, _type, name) \
 if (next_member_is_specialized) { \
   baked_constants += string(#parent "." #name "=") + \
-to_string(_type(launch_params.data.parent.name)) + 
"\n"; \
-} else { \
-  string_replace(source, "kernel_data_" #parent "_" #name, "kernel_data." 
#parent ".__unused_" #name); \
+ to_string(_type(launch_params.data.parent.name)) + 
"\n"; \
+} \
+else { \
+  string_replace( \
+  source, "kernel_data_" #parent "_" #name, "kernel_data." #parent 
".__unused_" #name); \
   next_member_is_specialized = true; \
 }
 
diff --git a/intern/cycles/device/metal/kernel.mm 
b/intern/cycles/device/metal/kernel.mm
index febce2840ea..6312c5f88ee 100644
--- a/intern/cycles/device/metal/kernel.mm
+++ b/intern/cycles/device/metal/kernel.mm
@@ -467,7 +467,8 @@ static MTLFunctionConstantValues 
*GetConstantValues(KernelData const *data = nul
 #  define KERNEL_STRUCT_MEMBER_DONT_SPECIALIZE next_member_is_specialized = 
false;
 
 #  define KERNEL_STRUCT_MEMBER(parent, _type, name) \
-[constant_values setConstantValue:next_member_is_specialized ? 
(void*)>parent.name : (void*)_data \
+[constant_values setConstantValue:next_member_is_specialized ? (void 
*)>parent.name : \
+   (void 
*)_data \
  type:MTLDataType_##_type \
   atIndex:KernelData_##parent##_##name]; \
 next_member_is_specialized = true;
diff --git a/intern/cycles/kernel/data_template.h 
b/intern/cycles/kernel/data_template.h
index f1589a4d10b..fd25644e56b 100644
--- a/intern/cycles/kernel/data_template.h
+++ b/intern/cycles/kernel/data_template.h
@@ -14,7 +14,6 @@
 #  define KERNEL_STRUCT_MEMBER_DONT_SPECIALIZE
 #endif
 
-
 /* Background. */
 
 KERNEL_STRUCT_BEGIN(KernelBackground, background)
@@ -183,9 +182,12 @@ KERNEL_STRUCT_MEMBER(integrator, float, 
sample_clamp_indirect)
 KERNEL_STRUCT_MEMBER(integrator, int, use_caustics)
 /* Sampling pattern. */
 KERNEL_STRUCT_MEMBER(integrator, int, sampling_pattern)
-KERNEL_STRUCT_MEMBER_DONT_SPECIALIZE KERNEL_STRUCT_MEMBER(integrator, int, 
tabulated_sobol_sequence_size)
-KERNEL_STRUCT_MEMBER_DONT_SPECIALIZE KERNEL_STRUCT_MEMBER(integrator, int, 
sobol_index_mask)
 KERNEL_STRUCT_MEMBER(integrator, float, scrambling_distance)
+/* Sobol pattern. */
+KERNEL_STRUCT_MEMBER_DONT_SPECIALIZE
+KERNEL_STRUCT_MEMBER(integrator, int, tabulated_sobol_sequence_size)
+KERNEL_STRUCT_MEMBER_DONT_SPECIALIZE
+KERNEL_STRUCT_MEMBER(integrator, int, sobol_index_mask)
 /* Volume render. */
 KERNEL_STRUCT_MEMBER(integrator, int, use_volumes)
 KERNEL_STRUCT_MEMBER(integrator, int, volume_max_steps)
diff --git a/intern/cycles/kernel/osl/types.h b/intern/cycles/kernel/osl/types.h
index 528f07ad58c..67d0073f48d 100644
--- a/intern/cycles/kernel/osl/types.h
+++ b/intern/cycles/kernel/osl/types.h
@@ -90,9 +90,11 @@ struct ShaderGlobals {
   int backfacing;
 };
 
-struct OSLNoiseOptions {};
+struct OSLNoiseOptions {
+};
 
-struct OSLTextureOptions {};
+struct OSLTextureOptions {
+};
 
 #define OSL_TEXTURE_HANDLE_TYPE_IES ((uintptr_t)0x2 << 30)
 #define OSL_TEXTURE_HANDLE_TYPE_SVM ((uintptr_t)0x1 << 30)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [12a3de96bbc] master: Fix T103972: crash with cloth simulation rest shape key and subdivision surface

2023-01-19 Thread Brecht Van Lommel
Commit: 12a3de96bbc9085748af53f61ac7a9fc6405844f
Author: Brecht Van Lommel
Date:   Thu Jan 19 17:32:09 2023 +0100
Branches: master
https://developer.blender.org/rB12a3de96bbc9085748af53f61ac7a9fc6405844f

Fix T103972: crash with cloth simulation rest shape key and subdivision surface

===

M   source/blender/blenkernel/intern/subdiv_mesh.cc

===

diff --git a/source/blender/blenkernel/intern/subdiv_mesh.cc 
b/source/blender/blenkernel/intern/subdiv_mesh.cc
index dbb58fd73de..dbeefcb1e7b 100644
--- a/source/blender/blenkernel/intern/subdiv_mesh.cc
+++ b/source/blender/blenkernel/intern/subdiv_mesh.cc
@@ -471,11 +471,11 @@ static void subdiv_vertex_orco_evaluate(const 
SubdivMeshContext *ctx,
 if (ctx->orco) {
   copy_v3_v3(ctx->orco[subdiv_vertex_index], vertex_data);
   if (ctx->cloth_orco) {
-copy_v3_v3(ctx->orco[subdiv_vertex_index], vertex_data + 3);
+copy_v3_v3(ctx->cloth_orco[subdiv_vertex_index], vertex_data + 3);
   }
 }
 else if (ctx->cloth_orco) {
-  copy_v3_v3(ctx->orco[subdiv_vertex_index], vertex_data);
+  copy_v3_v3(ctx->cloth_orco[subdiv_vertex_index], vertex_data);
 }
   }
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8707cab70b6] master: Gitea: don't reference branch in issues by default

2023-01-18 Thread Brecht Van Lommel
Commit: 8707cab70b6959c70be793882d63711ddc36dd17
Author: Brecht Van Lommel
Date:   Wed Jan 18 16:58:09 2023 +0100
Branches: master
https://developer.blender.org/rB8707cab70b6959c70be793882d63711ddc36dd17

Gitea: don't reference branch in issues by default

===

M   .gitea/issue_template/bug.yaml
M   .gitea/issue_template/design.yaml
M   .gitea/issue_template/todo.yaml
M   .gitea/pull_request_template.yaml

===

diff --git a/.gitea/issue_template/bug.yaml b/.gitea/issue_template/bug.yaml
index fd0c35da87b..9c4618c3223 100644
--- a/.gitea/issue_template/bug.yaml
+++ b/.gitea/issue_template/bug.yaml
@@ -2,7 +2,6 @@ name: Bug Report
 about: File a bug report
 labels:
   - bug
-ref: master
 body:
   - type: markdown
 attributes:
diff --git a/.gitea/issue_template/design.yaml 
b/.gitea/issue_template/design.yaml
index b482c8fad42..8c2c6deef29 100644
--- a/.gitea/issue_template/design.yaml
+++ b/.gitea/issue_template/design.yaml
@@ -2,7 +2,6 @@ name: Design
 about: Create a design task (for developers only)
 labels:
   - design
-ref: master
 body:
   - type: textarea
 id: body
diff --git a/.gitea/issue_template/todo.yaml b/.gitea/issue_template/todo.yaml
index 8c08d897b2b..e7fecf043ca 100644
--- a/.gitea/issue_template/todo.yaml
+++ b/.gitea/issue_template/todo.yaml
@@ -2,7 +2,6 @@ name: To Do
 about: Create a to do task (for developers only)
 labels:
   - todo
-ref: master
 body:
   - type: textarea
 id: body
diff --git a/.gitea/pull_request_template.yaml 
b/.gitea/pull_request_template.yaml
index 2690223f366..6affe8cf8d2 100644
--- a/.gitea/pull_request_template.yaml
+++ b/.gitea/pull_request_template.yaml
@@ -1,6 +1,5 @@
 name: Pull Request
 about: Contribute code to Blender
-ref: master
 body:
   - type: markdown
 attributes:

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9ccec5715e9] master: Gitea: layout and wording tweaks to issue and pull request templates

2023-01-18 Thread Brecht Van Lommel
Commit: 9ccec5715e95aa267a4db50b52e0cad59e65de33
Author: Brecht Van Lommel
Date:   Wed Jan 18 13:48:44 2023 +0100
Branches: master
https://developer.blender.org/rB9ccec5715e95aa267a4db50b52e0cad59e65de33

Gitea: layout and wording tweaks to issue and pull request templates

===

M   .gitea/issue_template/bug.yaml
A   .gitea/issue_template/config.yaml
M   .gitea/pull_request_template.yaml

===

diff --git a/.gitea/issue_template/bug.yaml b/.gitea/issue_template/bug.yaml
index 94f61f6701b..fd0c35da87b 100644
--- a/.gitea/issue_template/bug.yaml
+++ b/.gitea/issue_template/bug.yaml
@@ -10,10 +10,10 @@ body:
 ### Instructions
 First time reporting? See 
[tips](https://wiki.blender.org/wiki/Process/Bug_Reports) and [walkthrough 
video](https://www.youtube.com/watch?v=JTD0OJq_rF4).
 
-* Use **Help > Report a Bug** in Blender to automatically fill 
system information and exact Blender version.
+* Use **Help > Report a Bug** in Blender to fill system 
information and exact Blender version.
 * Test [daily builds](https://builder.blender.org/) to verify 
if the issue is already fixed.
 * Test [previous 
versions](https://download.blender.org/release/) to find an older working 
version.
-* For feature requests, feedback, questions or issues building 
Blender, see [communication 
channels](https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests).
+* For feature requests, feedback, questions or build issues, 
see [communication 
channels](https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests).
 * If there are multiple bugs, make multiple bug reports.
 
   - type: textarea
@@ -39,4 +39,4 @@ body:
   value: |
 ### Help the developers
 
-Bug fixing is important, the developers will handle a report 
swiftly. For that reason, carefully provide exact steps and a **small and 
simple .blend file** to reproduce the problem. You do your half of the work, 
then we do our half!
+Bug fixing is important, the developers will handle reports 
swiftly. For that reason, carefully provide exact steps and a **small and 
simple .blend file** to reproduce the problem. You do your half of the work, 
then we do our half!
diff --git a/.gitea/issue_template/config.yaml 
b/.gitea/issue_template/config.yaml
new file mode 100644
index 000..3ba13e0cec6
--- /dev/null
+++ b/.gitea/issue_template/config.yaml
@@ -0,0 +1 @@
+blank_issues_enabled: false
diff --git a/.gitea/pull_request_template.yaml 
b/.gitea/pull_request_template.yaml
index f7c3242f55c..2690223f366 100644
--- a/.gitea/pull_request_template.yaml
+++ b/.gitea/pull_request_template.yaml
@@ -5,9 +5,11 @@ body:
   - type: markdown
 attributes:
   value: |
-Guides to [Contributing 
Code](https://wiki.blender.org/index.php/Dev:Doc/Process/Contributing_Code) and 
effective [Code 
Review](https://wiki.blender.org/index.php/Dev:Doc/Tools/Code_Review).
+### Instructions
 
-By submitting code here, **you agree that the code is (compatible 
with) GNU GPL v2 or later**.
+Guides to [contributing 
code](https://wiki.blender.org/index.php/Dev:Doc/Process/Contributing_Code) and 
effective [code 
review](https://wiki.blender.org/index.php/Dev:Doc/Tools/Code_Review).
+
+By submitting code here, you agree that the code is (compatible with) 
GNU GPL v2 or later.
 
   - type: textarea
 id: body

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [e8d1d1486e3] master: Fix T103960: build issue with GCC 13 in Cycles thread code

2023-01-18 Thread Brecht Van Lommel
Commit: e8d1d1486e3d9d8495af4c0903d6eb3e24a92094
Author: Brecht Van Lommel
Date:   Wed Jan 18 13:42:55 2023 +0100
Branches: master
https://developer.blender.org/rBe8d1d1486e3d9d8495af4c0903d6eb3e24a92094

Fix T103960: build issue with GCC 13 in Cycles thread code

===

M   intern/cycles/util/thread.cpp

===

diff --git a/intern/cycles/util/thread.cpp b/intern/cycles/util/thread.cpp
index f4949aa2b44..7f1e8eb4159 100644
--- a/intern/cycles/util/thread.cpp
+++ b/intern/cycles/util/thread.cpp
@@ -6,6 +6,8 @@
 #include "util/system.h"
 #include "util/windows.h"
 
+#include 
+
 CCL_NAMESPACE_BEGIN
 
 thread::thread(function run_cb) : run_cb_(run_cb), joined_(false)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [973db6b5c11] master: Gitea: make bug report template more compact

2023-01-18 Thread Brecht Van Lommel
Commit: 973db6b5c119f9c9bba50b8e6e082eca099f6909
Author: Brecht Van Lommel
Date:   Wed Jan 18 12:49:08 2023 +0100
Branches: master
https://developer.blender.org/rB973db6b5c119f9c9bba50b8e6e082eca099f6909

Gitea: make bug report template more compact

And split text before and after description field to reduce long distance
between title and description.

===

M   .gitea/issue_template/bug.yaml

===

diff --git a/.gitea/issue_template/bug.yaml b/.gitea/issue_template/bug.yaml
index 41cc6a4ed74..94f61f6701b 100644
--- a/.gitea/issue_template/bug.yaml
+++ b/.gitea/issue_template/bug.yaml
@@ -7,24 +7,14 @@ body:
   - type: markdown
 attributes:
   value: |
-### First time bug reporting?
-Read [these 
tips](https://wiki.blender.org/wiki/Process/Bug_Reports) and watch this **[How 
to Report a Bug](https://www.youtube.com/watch?v=JTD0OJq_rF4)** video to make a 
complete, valid bug report. Remember to write your bug report in **English**.
+### Instructions
+First time reporting? See 
[tips](https://wiki.blender.org/wiki/Process/Bug_Reports) and [walkthrough 
video](https://www.youtube.com/watch?v=JTD0OJq_rF4).
 
-### What not to report here
-For feature requests, feedback, questions or issues building 
Blender, see [communication 
channels](https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests).
-
-### Please verify
-* Always test with the latest official release from 
[blender.org](https://www.blender.org/) and daily build from 
[builder.blender.org](https://builder.blender.org/).
-* Please use `Help > Report a Bug` in Blender to automatically 
fill system information and exact Blender version.
-* Test [previous Blender 
versions](https://download.blender.org/release/) to find the latest version 
that was working as expected.
-* Find steps to redo the bug consistently without any 
non-official add-ons, and include a **small and simple .blend file** to 
demonstrate the bug.
+* Use **Help > Report a Bug** in Blender to automatically fill 
system information and exact Blender version.
+* Test [daily builds](https://builder.blender.org/) to verify 
if the issue is already fixed.
+* Test [previous 
versions](https://download.blender.org/release/) to find an older working 
version.
+* For feature requests, feedback, questions or issues building 
Blender, see [communication 
channels](https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests).
 * If there are multiple bugs, make multiple bug reports.
-* Sometimes, driver or software upgrades cause problems. On 
Windows, try a clean install of the graphics drivers.
-
-### Help the developers
-Bug fixing is important, the developers will handle a report 
swiftly. For that reason, we need your help to carefully provide instructions 
that others can follow quickly. You do your half of the work, then we do our 
half!
-
-If a report is tagged with Needs Information from User and it 
has no reply after a week, we will assume the issue is gone and close the 
report.
 
   - type: textarea
 id: body
@@ -44,3 +34,9 @@ body:
**Exact steps for others to reproduce the error**
Based on the default startup or an attached .blend file (as 
simple as possible).
 
+  - type: markdown
+attributes:
+  value: |
+### Help the developers
+
+Bug fixing is important, the developers will handle a report 
swiftly. For that reason, carefully provide exact steps and a **small and 
simple .blend file** to reproduce the problem. You do your half of the work, 
then we do our half!

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [bdb34c98041] master: Gitea: add more complete pull request template

2023-01-17 Thread Brecht Van Lommel
Commit: bdb34c98041dd1185a9c5f599e89bf04cfa9c0ea
Author: Brecht Van Lommel
Date:   Wed Jan 18 01:33:33 2023 +0100
Branches: master
https://developer.blender.org/rBbdb34c98041dd1185a9c5f599e89bf04cfa9c0ea

Gitea: add more complete pull request template

===

D   .gitea/pull_request_template.md
A   .gitea/pull_request_template.yaml

===

diff --git a/.gitea/pull_request_template.md b/.gitea/pull_request_template.md
deleted file mode 100644
index a6614b8ef00..000
--- a/.gitea/pull_request_template.md
+++ /dev/null
@@ -1,4 +0,0 @@

-name: Pull Request
-about: Submit a pull request

diff --git a/.gitea/pull_request_template.yaml 
b/.gitea/pull_request_template.yaml
new file mode 100644
index 000..f7c3242f55c
--- /dev/null
+++ b/.gitea/pull_request_template.yaml
@@ -0,0 +1,19 @@
+name: Pull Request
+about: Contribute code to Blender
+ref: master
+body:
+  - type: markdown
+attributes:
+  value: |
+Guides to [Contributing 
Code](https://wiki.blender.org/index.php/Dev:Doc/Process/Contributing_Code) and 
effective [Code 
Review](https://wiki.blender.org/index.php/Dev:Doc/Tools/Code_Review).
+
+By submitting code here, **you agree that the code is (compatible 
with) GNU GPL v2 or later**.
+
+  - type: textarea
+id: body
+attributes:
+  label: "Description"
+  value: |
+   Description of the problem that is addressed in the patch.
+
+   Description of the proposed solution and its implementation.

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [665732115ec] master: Gitea: add separate issue templates for bug, design and todo

2023-01-17 Thread Brecht Van Lommel
Commit: 665732115ec5779e121333fb3a9f34f141c1d06b
Author: Brecht Van Lommel
Date:   Tue Jan 17 19:31:00 2023 +0100
Branches: master
https://developer.blender.org/rB665732115ec5779e121333fb3a9f34f141c1d06b

Gitea: add separate issue templates for bug, design and todo

===

R099.gitea/issue_template.yaml  .gitea/issue_template/bug.yaml
A   .gitea/issue_template/design.yaml
A   .gitea/issue_template/todo.yaml

===

diff --git a/.gitea/issue_template.yaml b/.gitea/issue_template/bug.yaml
similarity index 99%
rename from .gitea/issue_template.yaml
rename to .gitea/issue_template/bug.yaml
index 08b98a0112e..41cc6a4ed74 100644
--- a/.gitea/issue_template.yaml
+++ b/.gitea/issue_template/bug.yaml
@@ -27,6 +27,7 @@ body:
 If a report is tagged with Needs Information from User and it 
has no reply after a week, we will assume the issue is gone and close the 
report.
 
   - type: textarea
+id: body
 attributes:
   label: "Description"
   value: |
diff --git a/.gitea/issue_template/design.yaml 
b/.gitea/issue_template/design.yaml
new file mode 100644
index 000..b482c8fad42
--- /dev/null
+++ b/.gitea/issue_template/design.yaml
@@ -0,0 +1,10 @@
+name: Design
+about: Create a design task (for developers only)
+labels:
+  - design
+ref: master
+body:
+  - type: textarea
+id: body
+attributes:
+  label: "Description"
diff --git a/.gitea/issue_template/todo.yaml b/.gitea/issue_template/todo.yaml
new file mode 100644
index 000..8c08d897b2b
--- /dev/null
+++ b/.gitea/issue_template/todo.yaml
@@ -0,0 +1,10 @@
+name: To Do
+about: Create a to do task (for developers only)
+labels:
+  - todo
+ref: master
+body:
+  - type: textarea
+id: body
+attributes:
+  label: "Description"

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [93ca4eeec13] master: Cleanup: remove unused functions

2023-01-16 Thread Brecht Van Lommel
Commit: 93ca4eeec135b2c0fe77b70cd982ed0e93e414cf
Author: Brecht Van Lommel
Date:   Mon Jan 16 19:40:25 2023 +0100
Branches: master
https://developer.blender.org/rB93ca4eeec135b2c0fe77b70cd982ed0e93e414cf

Cleanup: remove unused functions

===

M   intern/cycles/util/system.cpp

===

diff --git a/intern/cycles/util/system.cpp b/intern/cycles/util/system.cpp
index 3183ac06f26..c1c496380c5 100644
--- a/intern/cycles/util/system.cpp
+++ b/intern/cycles/util/system.cpp
@@ -204,24 +204,12 @@ bool system_cpu_support_sse2()
   return caps.sse2;
 }
 
-bool system_cpu_support_sse3()
-{
-  CPUCapabilities  = system_cpu_capabilities();
-  return caps.sse3;
-}
-
 bool system_cpu_support_sse41()
 {
   CPUCapabilities  = system_cpu_capabilities();
   return caps.sse41;
 }
 
-bool system_cpu_support_avx()
-{
-  CPUCapabilities  = system_cpu_capabilities();
-  return caps.avx;
-}
-
 bool system_cpu_support_avx2()
 {
   CPUCapabilities  = system_cpu_capabilities();
@@ -234,20 +222,11 @@ bool system_cpu_support_sse2()
   return false;
 }
 
-bool system_cpu_support_sse3()
-{
-  return false;
-}
-
 bool system_cpu_support_sse41()
 {
   return false;
 }
 
-bool system_cpu_support_avx()
-{
-  return false;
-}
 bool system_cpu_support_avx2()
 {
   return false;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a84a8a528da] master: Cycles: remove SSE3 and AVX kernel optimization levels

2023-01-16 Thread Brecht Van Lommel
Commit: a84a8a528da89677dc16551dbf545eb1891c4c40
Author: Brecht Van Lommel
Date:   Wed Jan 11 16:16:21 2023 +0100
Branches: master
https://developer.blender.org/rBa84a8a528da89677dc16551dbf545eb1891c4c40

Cycles: remove SSE3 and AVX kernel optimization levels

While keeping SSE2, SSE4.1 and AVX2. This does not affect hardware support, it
only slightly reduces performance for some older CPUs.

To reduce maintenance cost and improve compile times.

Differential Revision: https://developer.blender.org/D16978

===

M   intern/cycles/CMakeLists.txt
M   intern/cycles/blender/addon/properties.py
M   intern/cycles/blender/addon/ui.py
M   intern/cycles/blender/python.cpp
M   intern/cycles/device/cpu/device.cpp
M   intern/cycles/device/cpu/kernel.cpp
M   intern/cycles/device/cpu/kernel_function.h
M   intern/cycles/kernel/CMakeLists.txt
M   intern/cycles/kernel/device/cpu/kernel.h
D   intern/cycles/kernel/device/cpu/kernel_avx.cpp
D   intern/cycles/kernel/device/cpu/kernel_sse3.cpp
M   intern/cycles/test/CMakeLists.txt
M   intern/cycles/util/debug.cpp
M   intern/cycles/util/debug.h
M   intern/cycles/util/optimization.h
M   intern/cycles/util/system.h

===

diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index 53e87fc5c3a..366d38cc94c 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -85,15 +85,11 @@ elseif(WIN32 AND MSVC AND NOT CMAKE_CXX_COMPILER_ID MATCHES 
"Clang")
   # there is no /arch:SSE3, but intrinsics are available anyway
   if(CMAKE_CL_64)
 set(CYCLES_SSE2_KERNEL_FLAGS "${CYCLES_KERNEL_FLAGS}")
-set(CYCLES_SSE3_KERNEL_FLAGS "${CYCLES_KERNEL_FLAGS}")
 set(CYCLES_SSE41_KERNEL_FLAGS "${CYCLES_KERNEL_FLAGS}")
-set(CYCLES_AVX_KERNEL_FLAGS "${CYCLES_AVX_ARCH_FLAGS} 
${CYCLES_KERNEL_FLAGS}")
 set(CYCLES_AVX2_KERNEL_FLAGS "${CYCLES_AVX2_ARCH_FLAGS} 
${CYCLES_KERNEL_FLAGS}")
   else()
 set(CYCLES_SSE2_KERNEL_FLAGS "/arch:SSE2 ${CYCLES_KERNEL_FLAGS}")
-set(CYCLES_SSE3_KERNEL_FLAGS "/arch:SSE2 ${CYCLES_KERNEL_FLAGS}")
 set(CYCLES_SSE41_KERNEL_FLAGS "/arch:SSE2 ${CYCLES_KERNEL_FLAGS}")
-set(CYCLES_AVX_KERNEL_FLAGS "${CYCLES_AVX_ARCH_FLAGS} 
${CYCLES_KERNEL_FLAGS}")
 set(CYCLES_AVX2_KERNEL_FLAGS "${CYCLES_AVX2_ARCH_FLAGS} 
${CYCLES_KERNEL_FLAGS}")
   endif()
 
@@ -126,11 +122,7 @@ elseif(CMAKE_COMPILER_IS_GNUCC OR (CMAKE_CXX_COMPILER_ID 
MATCHES "Clang"))
 endif()
 
 set(CYCLES_SSE2_KERNEL_FLAGS "${CYCLES_KERNEL_FLAGS} -msse -msse2")
-set(CYCLES_SSE3_KERNEL_FLAGS "${CYCLES_SSE2_KERNEL_FLAGS} -msse3 -mssse3")
-set(CYCLES_SSE41_KERNEL_FLAGS "${CYCLES_SSE3_KERNEL_FLAGS} -msse4.1")
-if(CXX_HAS_AVX)
-  set(CYCLES_AVX_KERNEL_FLAGS "${CYCLES_SSE41_KERNEL_FLAGS} -mavx")
-endif()
+set(CYCLES_SSE41_KERNEL_FLAGS "${CYCLES_SSE2_KERNEL_FLAGS} -msse3 -mssse3 
-msse4.1")
 if(CXX_HAS_AVX2)
   set(CYCLES_AVX2_KERNEL_FLAGS "${CYCLES_SSE41_KERNEL_FLAGS} -mavx -mavx2 
-mfma -mlzcnt -mbmi -mbmi2 -mf16c")
 endif()
@@ -144,13 +136,8 @@ elseif(WIN32 AND CMAKE_CXX_COMPILER_ID MATCHES "Intel")
 
   if(CXX_HAS_SSE)
 set(CYCLES_SSE2_KERNEL_FLAGS "/QxSSE2")
-set(CYCLES_SSE3_KERNEL_FLAGS "/QxSSSE3")
 set(CYCLES_SSE41_KERNEL_FLAGS "/QxSSE4.1")
 
-if(CXX_HAS_AVX)
-  set(CYCLES_AVX_KERNEL_FLAGS "/arch:AVX")
-endif()
-
 if(CXX_HAS_AVX2)
   set(CYCLES_AVX2_KERNEL_FLAGS "/QxCORE-AVX2")
 endif()
@@ -174,13 +161,8 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
   set(CYCLES_SSE2_KERNEL_FLAGS "-xsse2")
 endif()
 
-set(CYCLES_SSE3_KERNEL_FLAGS "-xssse3")
 set(CYCLES_SSE41_KERNEL_FLAGS "-xsse4.1")
 
-if(CXX_HAS_AVX)
-  set(CYCLES_AVX_KERNEL_FLAGS "-xavx")
-endif()
-
 if(CXX_HAS_AVX2)
   set(CYCLES_AVX2_KERNEL_FLAGS "-xcore-avx2")
 endif()
@@ -190,15 +172,10 @@ endif()
 if(CXX_HAS_SSE)
   add_definitions(
 -DWITH_KERNEL_SSE2
--DWITH_KERNEL_SSE3
 -DWITH_KERNEL_SSE41
   )
 endif()
 
-if(CXX_HAS_AVX)
-  add_definitions(-DWITH_KERNEL_AVX)
-endif()
-
 if(CXX_HAS_AVX2)
   add_definitions(-DWITH_KERNEL_AVX2)
 endif()
diff --git a/intern/cycles/blender/addon/properties.py 
b/intern/cycles/blender/addon/properties.py
index 9ec663eb258..9c1cb0a1b4a 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -951,9 +951,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
 return _cycles.debug_flags_update(scene)
 
 debug_use_cpu_avx2: BoolProperty(name="AVX2", default=True)
-debug_u

[Bf-blender-cvs] [c66da0b267e] master: Docs: change readme.rst to README.md, as Gitea can't render rst

2023-01-16 Thread Brecht Van Lommel
Commit: c66da0b267e6eb46a3cd1c62284658a476e8f5ae
Author: Brecht Van Lommel
Date:   Mon Jan 16 17:49:21 2023 +0100
Branches: master
https://developer.blender.org/rBc66da0b267e6eb46a3cd1c62284658a476e8f5ae

Docs: change readme.rst to README.md, as Gitea can't render rst

===

A   README.md
D   readme.rst

===

diff --git a/README.md b/README.md
new file mode 100644
index 000..c1916806d76
--- /dev/null
+++ b/README.md
@@ -0,0 +1,38 @@
+
+
+Blender
+===
+
+Blender is the free and open source 3D creation suite.
+It supports the entirety of the 3D pipeline-modeling, rigging, animation, 
simulation, rendering, compositing,
+motion tracking and video editing.
+
+![Blender 
screenshot](https://code.blender.org/wp-content/uploads/2018/12/springrg.jpg 
"Blender screenshot")
+
+Project Pages
+-
+
+- [Main Website](http://www.blender.org)
+- [Reference Manual](https://docs.blender.org/manual/en/latest/index.html)
+- [User Community](https://www.blender.org/community/)
+
+Development
+---
+
+- [Build Instructions](https://wiki.blender.org/wiki/Building_Blender)
+- [Code Review & Bug Tracker](https://developer.blender.org)
+- [Developer Forum](https://devtalk.blender.org)
+- [Developer Documentation](https://wiki.blender.org)
+
+
+License
+---
+
+Blender as a whole is licensed under the GNU General Public License, Version 3.
+Individual files may have a different, but compatible license.
+
+See [blender.org/about/license](https://www.blender.org/about/license) for 
details.
diff --git a/readme.rst b/readme.rst
deleted file mode 100644
index 6d03d004be4..000
--- a/readme.rst
+++ /dev/null
@@ -1,41 +0,0 @@
-
-.. Keep this document short & concise,
-   linking to external resources instead of including content in-line.
-   See 'release/text/readme.html' for the end user read-me.
-
-
-Blender
-===
-
-Blender is the free and open source 3D creation suite.
-It supports the entirety of the 3D pipeline-modeling, rigging, animation, 
simulation, rendering, compositing,
-motion tracking and video editing.
-
-.. figure:: https://code.blender.org/wp-content/uploads/2018/12/springrg.jpg
-   :scale: 50 %
-   :align: center
-
-
-Project Pages
--
-
-- `Main Website <http://www.blender.org>`__
-- `Reference Manual <https://docs.blender.org/manual/en/latest/index.html>`__
-- `User Community <https://www.blender.org/community/>`__
-
-Development

-
-- `Build Instructions <https://wiki.blender.org/wiki/Building_Blender>`__
-- `Code Review & Bug Tracker <https://developer.blender.org>`__
-- `Developer Forum <https://devtalk.blender.org>`__
-- `Developer Documentation <https://wiki.blender.org>`__
-
-
-License

-
-Blender as a whole is licensed under the GNU General Public License, Version 3.
-Individual files may have a different, but compatible license.
-
-See `blender.org/about/license <https://www.blender.org/about/license>`__ for 
details.

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [3029bd2b0cd] blender-v3.3-release: Fix T102942: Cycles wrong alpha for multi-layer PSD files

2023-01-12 Thread Brecht Van Lommel
Commit: 3029bd2b0cd15cc5d08cf7d8f8fd492879b8438b
Author: Brecht Van Lommel
Date:   Mon Jan 9 18:13:36 2023 +0100
Branches: blender-v3.3-release
https://developer.blender.org/rB3029bd2b0cd15cc5d08cf7d8f8fd492879b8438b

Fix T102942: Cycles wrong alpha for multi-layer PSD files

===

M   intern/cycles/scene/image_oiio.cpp

===

diff --git a/intern/cycles/scene/image_oiio.cpp 
b/intern/cycles/scene/image_oiio.cpp
index 032b787bfba..131d3dd04e2 100644
--- a/intern/cycles/scene/image_oiio.cpp
+++ b/intern/cycles/scene/image_oiio.cpp
@@ -207,6 +207,11 @@ bool OIIOImageLoader::load_pixels(const ImageMetaData 
,
   if (strcmp(in->format_name(), "dds") == 0) {
 do_associate_alpha = true;
   }
+  /* Workaround OIIO bug that sets oiio:UnassociatedAlpha on the last layer
+   * but not composite image that we read. */
+  if (strcmp(in->format_name(), "psd") == 0) {
+do_associate_alpha = true;
+  }
 }
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d2050c7c36a] blender-v3.3-release: Fix T102990: OpenVDB files load very slow from network drives

2023-01-12 Thread Brecht Van Lommel
Commit: d2050c7c36a709b19dcf878eee63b491eb51619b
Author: Brecht Van Lommel
Date:   Mon Dec 12 18:21:34 2022 +0100
Branches: blender-v3.3-release
https://developer.blender.org/rBd2050c7c36a709b19dcf878eee63b491eb51619b

Fix T102990: OpenVDB files load very slow from network drives

The OpenVDB delay loading of voxel leaf data using mmap works poorly on network
drives. It has a mechanism to make a temporary local file copy to avoid this,
but we disabled that as it leads to other problems.

Now disable delay loading entirely. It's not clear that this has much benefit
in Blender. For rendering we need to load the entire grid to convert to NanoVDB,
and for geometry nodes there also are no cases where we only need part of grids.

===

M   intern/cycles/hydra/field.cpp
M   source/blender/blenkernel/intern/volume.cc

===

diff --git a/intern/cycles/hydra/field.cpp b/intern/cycles/hydra/field.cpp
index 67945be9d52..7cdb4c80d79 100644
--- a/intern/cycles/hydra/field.cpp
+++ b/intern/cycles/hydra/field.cpp
@@ -26,9 +26,12 @@ class HdCyclesVolumeLoader : public VDBImageLoader {
   HdCyclesVolumeLoader(const std::string , const std::string 
)
   : VDBImageLoader(gridName)
   {
+/* Disably delay loading and file copying, this has poor performance
+ * on network drivers. */
+const bool delay_load = false;
 openvdb::io::File file(filePath);
 file.setCopyMaxBytes(0);
-if (file.open()) {
+if (file.open(delay_load)) {
   grid = file.readGrid(gridName);
 }
   }
diff --git a/source/blender/blenkernel/intern/volume.cc 
b/source/blender/blenkernel/intern/volume.cc
index d7762400f64..2b71cb2c096 100644
--- a/source/blender/blenkernel/intern/volume.cc
+++ b/source/blender/blenkernel/intern/volume.cc
@@ -324,8 +324,11 @@ struct VolumeGrid {
  * holding a mutex lock. */
 blender::threading::isolate_task([&] {
   try {
+/* Disably delay loading and file copying, this has poor performance
+ * on network drivers. */
+const bool delay_load = false;
 file.setCopyMaxBytes(0);
-file.open();
+file.open(delay_load);
 openvdb::GridBase::Ptr vdb_grid = file.readGrid(name());
 entry->grid->setTree(vdb_grid->baseTreePtr());
   }
@@ -886,8 +889,11 @@ bool BKE_volume_load(const Volume *volume, const Main 
*bmain)
   openvdb::GridPtrVec vdb_grids;
 
   try {
+/* Disably delay loading and file copying, this has poor performance
+ * on network drivers. */
+const bool delay_load = false;
 file.setCopyMaxBytes(0);
-file.open();
+file.open(delay_load);
 vdb_grids = *(file.readAllGridMetadata());
 grids.metadata = file.getMetadata();
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [df5ebd348b6] master: Fix T103556: Cycles viewport unexpected pixel changes when hovering over UI

2023-01-10 Thread Brecht Van Lommel
Commit: df5ebd348b66c16084c47543f95a15fc53da5a0f
Author: Brecht Van Lommel
Date:   Tue Jan 10 16:31:21 2023 +0100
Branches: master
https://developer.blender.org/rBdf5ebd348b66c16084c47543f95a15fc53da5a0f

Fix T103556: Cycles viewport unexpected pixel changes when hovering over UI

With the GPU API the sampler can not be set after texture binding, which caused
a delay of the actual change. Now do both in a single call for correctness and
performance.

===

M   intern/cycles/blender/display_driver.cpp

===

diff --git a/intern/cycles/blender/display_driver.cpp 
b/intern/cycles/blender/display_driver.cpp
index 58f179d1824..8df0061d8ca 100644
--- a/intern/cycles/blender/display_driver.cpp
+++ b/intern/cycles/blender/display_driver.cpp
@@ -721,8 +721,6 @@ static void draw_tile(const float2 ,
 return;
   }
 
-  GPU_texture_bind(texture.gpu_texture, 0);
-
   /* Trick to keep sharp rendering without jagged edges on all GPUs.
*
* The idea here is to enforce driver to use linear interpolation when the 
image is not zoomed
@@ -735,14 +733,14 @@ static void draw_tile(const float2 ,
   const float zoomed_height = draw_tile.params.size.y * zoom.y;
   if (texture.width != draw_tile.params.size.x || texture.height != 
draw_tile.params.size.y) {
 /* Resolution divider is different from 1, force nearest interpolation. */
-GPU_texture_filter_mode(texture.gpu_texture, false);
+GPU_texture_bind_ex(texture.gpu_texture, GPU_SAMPLER_DEFAULT, 0, false);
   }
   else if (zoomed_width - draw_tile.params.size.x > 0.5f ||
zoomed_height - draw_tile.params.size.y > 0.5f) {
-GPU_texture_filter_mode(texture.gpu_texture, false);
+GPU_texture_bind_ex(texture.gpu_texture, GPU_SAMPLER_DEFAULT, 0, false);
   }
   else {
-GPU_texture_filter_mode(texture.gpu_texture, true);
+GPU_texture_bind_ex(texture.gpu_texture, GPU_SAMPLER_FILTER, 0, false);
   }
 
   /* Draw at the parameters for which the texture has been updated for. This 
allows to always draw

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b314d92e7db] master: Fix T102942: Cycles wrong alpha for multi-layer PSD files

2023-01-09 Thread Brecht Van Lommel
Commit: b314d92e7dbeefee5edd6e65d90e560b215fd992
Author: Brecht Van Lommel
Date:   Mon Jan 9 18:13:36 2023 +0100
Branches: master
https://developer.blender.org/rBb314d92e7dbeefee5edd6e65d90e560b215fd992

Fix T102942: Cycles wrong alpha for multi-layer PSD files

===

M   intern/cycles/scene/image_oiio.cpp

===

diff --git a/intern/cycles/scene/image_oiio.cpp 
b/intern/cycles/scene/image_oiio.cpp
index d0adef912be..a5824eeb267 100644
--- a/intern/cycles/scene/image_oiio.cpp
+++ b/intern/cycles/scene/image_oiio.cpp
@@ -211,6 +211,11 @@ bool OIIOImageLoader::load_pixels(const ImageMetaData 
,
   if (strcmp(in->format_name(), "dds") == 0) {
 do_associate_alpha = true;
   }
+  /* Workaround OIIO bug that sets oiio:UnassociatedAlpha on the last layer
+   * but not composite image that we read. */
+  if (strcmp(in->format_name(), "psd") == 0) {
+do_associate_alpha = true;
+  }
 }
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8d2f4ddb2fc] master: Fix T103423: boolean crash on macOS Apple silicon

2023-01-09 Thread Brecht Van Lommel
Commit: 8d2f4ddb2fc0af60bb46ccd6130416a0b10a29e4
Author: Brecht Van Lommel
Date:   Mon Jan 9 14:28:25 2023 +0100
Branches: master
https://developer.blender.org/rB8d2f4ddb2fc0af60bb46ccd6130416a0b10a29e4

Fix T103423: boolean crash on macOS Apple silicon

Thanks to Howard Trickey for finding the cause.

===

M   build_files/build_environment/cmake/gmp.cmake

===

diff --git a/build_files/build_environment/cmake/gmp.cmake 
b/build_files/build_environment/cmake/gmp.cmake
index 820da4bdf7d..ffab5ed00e5 100644
--- a/build_files/build_environment/cmake/gmp.cmake
+++ b/build_files/build_environment/cmake/gmp.cmake
@@ -22,6 +22,14 @@ elseif(UNIX AND NOT APPLE)
   )
 endif()
 
+# Boolean crashes with Arm assembly, see T103423.
+if(BLENDER_PLATFORM_ARM)
+  set(GMP_OPTIONS
+${GMP_OPTIONS}
+--disable-assembly
+  )
+endif()
+
 ExternalProject_Add(external_gmp
   URL file://${PACKAGE_DIR}/${GMP_FILE}
   DOWNLOAD_DIR ${DOWNLOAD_DIR}

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [4d25c6b86e7] blender-v3.3-release: Fix T103423: boolean crash on macOS Apple silicon

2023-01-09 Thread Brecht Van Lommel
Commit: 4d25c6b86e7656256e9e43dbb9d4a1ffbb3c6f4b
Author: Brecht Van Lommel
Date:   Mon Jan 9 14:28:25 2023 +0100
Branches: blender-v3.3-release
https://developer.blender.org/rB4d25c6b86e7656256e9e43dbb9d4a1ffbb3c6f4b

Fix T103423: boolean crash on macOS Apple silicon

Thanks to Howard Trickey for finding the cause.

===

M   build_files/build_environment/cmake/gmp.cmake

===

diff --git a/build_files/build_environment/cmake/gmp.cmake 
b/build_files/build_environment/cmake/gmp.cmake
index ddfdba6662d..c6f1a7f81b6 100644
--- a/build_files/build_environment/cmake/gmp.cmake
+++ b/build_files/build_environment/cmake/gmp.cmake
@@ -22,6 +22,14 @@ elseif(UNIX AND NOT APPLE)
   )
 endif()
 
+# Boolean crashes with Arm assembly, see T103423.
+if(BLENDER_PLATFORM_ARM)
+  set(GMP_OPTIONS
+${GMP_OPTIONS}
+--disable-assembly
+  )
+endif()
+
 ExternalProject_Add(external_gmp
   URL file://${PACKAGE_DIR}/${GMP_FILE}
   DOWNLOAD_DIR ${DOWNLOAD_DIR}

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [934af611343] blender-v3.3-release: Bump version to 3.3.3rc

2023-01-09 Thread Brecht Van Lommel
Commit: 934af611343c7d1158844deabe8916d4b6a78b50
Author: Brecht Van Lommel
Date:   Mon Jan 9 14:22:35 2023 +0100
Branches: blender-v3.3-release
https://developer.blender.org/rB934af611343c7d1158844deabe8916d4b6a78b50

Bump version to 3.3.3rc

===

M   source/blender/blenkernel/BKE_blender_version.h

===

diff --git a/source/blender/blenkernel/BKE_blender_version.h 
b/source/blender/blenkernel/BKE_blender_version.h
index a8704fb9111..88f808ee4fb 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -19,9 +19,9 @@ extern "C" {
 /* Blender major and minor version. */
 #define BLENDER_VERSION 303
 /* Blender patch version for bugfix releases. */
-#define BLENDER_VERSION_PATCH 2
+#define BLENDER_VERSION_PATCH 3
 /** Blender release cycle stage: alpha/beta/rc/release. */
-#define BLENDER_VERSION_CYCLE release
+#define BLENDER_VERSION_CYCLE rc
 
 /* Blender file format version. */
 #define BLENDER_FILE_VERSION BLENDER_VERSION

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [589cbbf0e38] master: Tests: test availability of new bundled Python libraries

2023-01-09 Thread Brecht Van Lommel
Commit: 589cbbf0e382a77b19f90886370682a0feab6fa6
Author: Brecht Van Lommel
Date:   Mon Jan 9 13:15:20 2023 +0100
Branches: master
https://developer.blender.org/rB589cbbf0e382a77b19f90886370682a0feab6fa6

Tests: test availability of new bundled Python libraries

Differential Revision: https://developer.blender.org/D16733

===

M   tests/python/CMakeLists.txt
M   tests/python/bl_bundled_modules.py

===

diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt
index e4916bb3ff5..cc16a5641e1 100644
--- a/tests/python/CMakeLists.txt
+++ b/tests/python/CMakeLists.txt
@@ -80,7 +80,7 @@ add_blender_test(
 
 add_blender_test(
   script_bundled_modules
-  --python ${CMAKE_CURRENT_LIST_DIR}/bl_bundled_modules.py
+  --python ${CMAKE_CURRENT_LIST_DIR}/bl_bundled_modules.py -- --inside-blender
 )
 
 # test running operators doesn't segfault under various conditions
diff --git a/tests/python/bl_bundled_modules.py 
b/tests/python/bl_bundled_modules.py
index 7728a2deb47..6cb87b5aaed 100644
--- a/tests/python/bl_bundled_modules.py
+++ b/tests/python/bl_bundled_modules.py
@@ -1,7 +1,16 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-# Test that modules we ship with our Python installation are available
+# Test that modules we ship with our Python installation are available,
+# both for Blender itself and the bundled Python executable.
 
+import os
+import subprocess
+import sys
+
+app = "Blender" if sys.argv[-1] == "--inside-blender" else "Python"
+sys.stderr.write(f"Testing bundled modules in {app} executable.\n")
+
+# General purpose modules.
 import bz2
 import certifi
 import ctypes
@@ -14,3 +23,16 @@ import ssl
 import urllib3
 import zlib
 import zstandard
+
+# VFX platform modules.
+from pxr import Usd
+import MaterialX
+import OpenImageIO
+import PyOpenColorIO
+import pyopenvdb
+
+# Test modules in bundled Python standalone executable.
+if app == "Blender":
+script_filepath = os.path.abspath(__file__)
+proc = subprocess.Popen([sys.executable, script_filepath])
+sys.exit(proc.wait())

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ddb30c4a02c] master: Fix T103396: crash extruding creased vertex with GPU subdivision

2023-01-06 Thread Brecht Van Lommel
Commit: ddb30c4a02cdf342128021024b8e3567247107bb
Author: Brecht Van Lommel
Date:   Fri Jan 6 17:44:49 2023 +0100
Branches: master
https://developer.blender.org/rBddb30c4a02cdf342128021024b8e3567247107bb

Fix T103396: crash extruding creased vertex with GPU subdivision

===

M   source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines.cc

===

diff --git 
a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines.cc 
b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines.cc
index 14467023f0f..d7625cb81d4 100644
--- a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines.cc
+++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines.cc
@@ -199,7 +199,7 @@ static void extract_lines_loose_geom_subdiv(const 
DRWSubdivCache *subdiv_cache,
 if (mr->bm) {
   for (DRWSubdivLooseEdge edge : loose_edges) {
 const BMEdge *bm_edge = bm_original_edge_get(mr, 
edge.coarse_edge_index);
-*flags_data++ = BM_elem_flag_test_bool(bm_edge, BM_ELEM_HIDDEN) != 
0;
+*flags_data++ = (bm_edge) ? BM_elem_flag_test_bool(bm_edge, 
BM_ELEM_HIDDEN) != 0 : 1;
   }
 }
 else {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [5cc793912ef] master: Fix T103671: memory leak in material preview render

2023-01-06 Thread Brecht Van Lommel
Commit: 5cc793912efe4432b51cc7ddda4005c56fcbc93b
Author: Brecht Van Lommel
Date:   Fri Jan 6 16:04:03 2023 +0100
Branches: master
https://developer.blender.org/rB5cc793912efe4432b51cc7ddda4005c56fcbc93b

Fix T103671: memory leak in material preview render

Introduced with the fix for T103101.

===

M   source/blender/render/intern/engine.cc

===

diff --git a/source/blender/render/intern/engine.cc 
b/source/blender/render/intern/engine.cc
index 77b1e240cda..b26c685b691 100644
--- a/source/blender/render/intern/engine.cc
+++ b/source/blender/render/intern/engine.cc
@@ -1049,7 +1049,7 @@ bool RE_engine_render(Render *re, bool do_all)
* inversion as this calls python to get the render passes, while python UI
* code can also hold a lock on the render result. */
   const bool create_new_result = (re->result == nullptr || !(re->r.scemode & 
R_BUTS_PREVIEW));
-  RenderResult *new_result = engine_render_create_result(re);
+  RenderResult *new_result = (create_new_result) ? 
engine_render_create_result(re) : nullptr;
 
   BLI_rw_mutex_lock(>resultmutex, THREAD_LOCK_WRITE);
   if (create_new_result) {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [87f7b630b5c] master: Cleanup: make format

2023-01-05 Thread Brecht Van Lommel
Commit: 87f7b630b5cc7f792b57907e4054e3ee2f60e707
Author: Brecht Van Lommel
Date:   Thu Jan 5 19:42:16 2023 +0100
Branches: master
https://developer.blender.org/rB87f7b630b5cc7f792b57907e4054e3ee2f60e707

Cleanup: make format

===

M   intern/cycles/blender/device.cpp
M   intern/cycles/blender/sync.cpp
M   intern/cycles/device/device.h
M   intern/cycles/device/metal/device_impl.mm
M   intern/cycles/device/metal/kernel.mm

===

diff --git a/intern/cycles/blender/device.cpp b/intern/cycles/blender/device.cpp
index 96e7bdd03aa..9d2fba11c1a 100644
--- a/intern/cycles/blender/device.cpp
+++ b/intern/cycles/blender/device.cpp
@@ -30,7 +30,10 @@ int blender_device_threads(BL::Scene _scene)
 return 0;
 }
 
-DeviceInfo blender_device_info(BL::Preferences _preferences, BL::Scene 
_scene, bool background, bool preview)
+DeviceInfo blender_device_info(BL::Preferences _preferences,
+   BL::Scene _scene,
+   bool background,
+   bool preview)
 {
   PointerRNA cscene = RNA_pointer_get(_scene.ptr, "cycles");
 
diff --git a/intern/cycles/blender/sync.cpp b/intern/cycles/blender/sync.cpp
index 45fe4334f06..7df2a8cf30f 100644
--- a/intern/cycles/blender/sync.cpp
+++ b/intern/cycles/blender/sync.cpp
@@ -866,7 +866,8 @@ SessionParams 
BlenderSync::get_session_params(BL::RenderEngine _engine,
 
   /* Device */
   params.threads = blender_device_threads(b_scene);
-  params.device = blender_device_info(b_preferences, b_scene, 
params.background, b_engine.is_preview());
+  params.device = blender_device_info(
+  b_preferences, b_scene, params.background, b_engine.is_preview());
 
   /* samples */
   int samples = get_int(cscene, "samples");
diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h
index 3923698b1cd..377c123b035 100644
--- a/intern/cycles/device/device.h
+++ b/intern/cycles/device/device.h
@@ -71,9 +71,9 @@ class DeviceInfo {
   string description;
   string id; /* used for user preferences, should stay fixed with changing 
hardware config */
   int num;
-  bool display_device;/* GPU is used as a display device. */
-  bool has_nanovdb;   /* Support NanoVDB volumes. */
-  bool has_light_tree;/* Support light tree. */
+  bool display_device;  /* GPU is used as a display device. */
+  bool has_nanovdb; /* Support NanoVDB volumes. */
+  bool has_light_tree;  /* Support light tree. */
   bool has_osl; /* Support Open Shading Language. */
   bool has_guiding; /* Support path guiding. */
   bool has_profiling;   /* Supports runtime collection of profiling info. */
diff --git a/intern/cycles/device/metal/device_impl.mm 
b/intern/cycles/device/metal/device_impl.mm
index 01578155931..85486c132d8 100644
--- a/intern/cycles/device/metal/device_impl.mm
+++ b/intern/cycles/device/metal/device_impl.mm
@@ -469,7 +469,8 @@ void MetalDevice::compile_and_load(int device_id, 
MetalPipelineType pso_type)
 
   [options release];
 
-  bool blocking_pso_build = (getenv("CYCLES_METAL_PROFILING") || 
MetalDeviceKernels::is_benchmark_warmup());
+  bool blocking_pso_build = (getenv("CYCLES_METAL_PROFILING") ||
+ MetalDeviceKernels::is_benchmark_warmup());
   if (blocking_pso_build) {
 MetalDeviceKernels::wait_for_all();
 starttime = 0.0;
diff --git a/intern/cycles/device/metal/kernel.mm 
b/intern/cycles/device/metal/kernel.mm
index 7b26085c75f..e4ce5e19f63 100644
--- a/intern/cycles/device/metal/kernel.mm
+++ b/intern/cycles/device/metal/kernel.mm
@@ -124,7 +124,7 @@ DeviceShaderCache 
g_shaderCache[MAX_POSSIBLE_GPUS_ON_SYSTEM];
 
 ShaderCache *get_shader_cache(id mtlDevice)
 {
-  for (int i=0; ikernel_features & 
KERNEL_FEATURE_OBJECT_MOTION;
 
   MetalKernelPipeline *best_pipeline = nullptr;
-  while(!best_pipeline) {
+  while (!best_pipeline) {
 {
   thread_scoped_lock lock(cache_mutex);
   for (auto  : pipelines[kernel]) {
@@ -366,7 +366,7 @@ MetalKernelPipeline 
*ShaderCache::get_best_pipeline(DeviceKernel kernel, const M
 bool pipeline_metalrt_hair_thick = pipeline->metalrt_features & 
KERNEL_FEATURE_HAIR_THICK;
 bool pipeline_metalrt_pointcloud = pipeline->metalrt_features & 
KERNEL_FEATURE_POINTCLOUD;
 bool pipeline_metalrt_motion = use_metalrt &&
-  pipeline->metalrt_features & 
KERNEL_FEATURE_OBJECT_MOTION;
+   pipeline->metalrt_features & 
KERNEL_FEATURE_OBJECT_MOTION;
 
 if (pipeline->use_metalrt != use_metalrt || pipeline_metalrt_hair != 
device_metalrt_hair ||
 pipeline_metalrt_hair_thick != device_metalrt_hair_thick ||
@@ -824,7 +824,7 @@ bool MetalDeviceKernels::load(MetalDevice *device, 
Meta

[Bf-blender-cvs] [084b52bcd8c] master: Cycles: take into account IES texture node strength input for light tree

2023-01-05 Thread Brecht Van Lommel
Commit: 084b52bcd8c9fde744985d753b36f4ba9804447f
Author: Brecht Van Lommel
Date:   Thu Jan 5 19:06:05 2023 +0100
Branches: master
https://developer.blender.org/rB084b52bcd8c9fde744985d753b36f4ba9804447f

Cycles: take into account IES texture node strength input for light tree

To better estimate light contribution. Note that estimating the texture
from the IES file is still missing.

Contributed by Alaska.

Differential Revision: https://developer.blender.org/D16901

===

M   intern/cycles/scene/shader.cpp

===

diff --git a/intern/cycles/scene/shader.cpp b/intern/cycles/scene/shader.cpp
index 09255d7cee4..e03b77917ef 100644
--- a/intern/cycles/scene/shader.cpp
+++ b/intern/cycles/scene/shader.cpp
@@ -263,8 +263,9 @@ static float3 output_estimate_emission(ShaderOutput 
*output, bool _constant)
 
 return estimate;
   }
-  else if (node->type == LightFalloffNode::get_node_type()) {
-/* Light Falloff node. */
+  else if (node->type == LightFalloffNode::get_node_type() ||
+   node->type == IESLightNode::get_node_type()) {
+/* Get strength from Light Falloff and IES texture node. */
 ShaderInput *strength_in = node->input("Strength");
 is_constant = false;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [14d7cd46ba6] master: Fix CMake configuration error with Cycles enabled and Boost diabled

2023-01-04 Thread Brecht Van Lommel
Commit: 14d7cd46ba60f1f7f08ec3e4af2ecf53bdba5720
Author: Brecht Van Lommel
Date:   Wed Jan 4 14:32:29 2023 +0100
Branches: master
https://developer.blender.org/rB14d7cd46ba60f1f7f08ec3e4af2ecf53bdba5720

Fix CMake configuration error with Cycles enabled and Boost diabled

This is now only an indirect dependency on shared libraries, which means
this combination is valid.

Also remove mechanism that automatically disabled WITH_BOOST if no libraries
are using it, this is no longer really helpful with shared boost libraries.

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b3e9eb55c15..76779726e21 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -837,15 +837,10 @@ set_and_warn_dependency(WITH_BOOST WITH_OPENVDB
OFF)
 set_and_warn_dependency(WITH_BOOST WITH_QUADRIFLOW OFF)
 set_and_warn_dependency(WITH_BOOST WITH_USDOFF)
 if(WITH_CYCLES)
+  set_and_warn_dependency(WITH_BOOST   WITH_CYCLES_OSL   OFF)
   set_and_warn_dependency(WITH_PUGIXML WITH_CYCLES_OSL   OFF)
 endif()
 
-if(WITH_BOOST AND NOT (WITH_INTERNATIONAL OR WITH_OPENVDB OR
-   WITH_QUADRIFOLOW OR WITH_USD))
-  message(STATUS "No dependencies need 'WITH_BOOST' forcing WITH_BOOST=OFF")
-  set(WITH_BOOST OFF)
-endif()
-
 set_and_warn_dependency(WITH_TBB WITH_CYCLESOFF)
 set_and_warn_dependency(WITH_TBB WITH_USD   OFF)
 set_and_warn_dependency(WITH_TBB WITH_OPENVDB   OFF)
@@ -1075,14 +1070,6 @@ if(WITH_CYCLES)
   "Configure OIIO or disable WITH_CYCLES"
 )
   endif()
-  if(NOT WITH_BOOST)
-message(
-  FATAL_ERROR
-  "Cycles requires WITH_BOOST, the library may not have been found. "
-  "Configure BOOST or disable WITH_CYCLES"
-)
-  endif()
-
   if(WITH_CYCLES_OSL)
 if(NOT WITH_LLVM)
   message(

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [f9ddfffd6f3] master: Cleanup: compiler warnings

2023-01-04 Thread Brecht Van Lommel
Commit: f9ddfffd6f323f67066e325205cf16df1a92569c
Author: Brecht Van Lommel
Date:   Wed Jan 4 10:37:58 2023 +0100
Branches: master
https://developer.blender.org/rBf9ddfffd6f323f67066e325205cf16df1a92569c

Cleanup: compiler warnings

===

M   build_files/cmake/platform/platform_old_libs_update.cmake
M   source/blender/nodes/geometry/nodes/node_geo_blur_attribute.cc
M   source/blender/nodes/geometry/nodes/node_geo_curve_endpoint_selection.cc
M   
source/blender/nodes/geometry/nodes/node_geo_curve_topology_points_of_curve.cc
M   source/blender/nodes/geometry/nodes/node_geo_edge_paths_to_selection.cc
M   source/blender/nodes/geometry/nodes/node_geo_input_curve_handles.cc
M   
source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_is_planar.cc
M   
source/blender/nodes/geometry/nodes/node_geo_input_shortest_edge_paths.cc
M   source/blender/nodes/geometry/nodes/node_geo_interpolate_domain.cc
M   source/blender/nodes/geometry/nodes/node_geo_mesh_face_set_boundaries.cc
M   
source/blender/nodes/geometry/nodes/node_geo_mesh_topology_corners_of_face.cc
M   
source/blender/nodes/geometry/nodes/node_geo_mesh_topology_corners_of_vertex.cc
M   
source/blender/nodes/geometry/nodes/node_geo_mesh_topology_edges_of_vertex.cc
M   
source/blender/nodes/geometry/nodes/node_geo_mesh_topology_offset_corner_in_face.cc
M   source/blender/nodes/geometry/nodes/node_geo_offset_point_in_curve.cc
M   source/blender/nodes/geometry/nodes/node_geo_uv_pack_islands.cc
M   source/blender/nodes/geometry/nodes/node_geo_uv_unwrap.cc

===

diff --git a/build_files/cmake/platform/platform_old_libs_update.cmake 
b/build_files/cmake/platform/platform_old_libs_update.cmake
index 12ab9a44cf1..ab27dd89385 100644
--- a/build_files/cmake/platform/platform_old_libs_update.cmake
+++ b/build_files/cmake/platform/platform_old_libs_update.cmake
@@ -91,9 +91,10 @@ endif()
 
 if(UNIX AND (NOT APPLE) AND LIBDIR AND (EXISTS ${LIBDIR}))
   # Only search for the path if it's found on the system.
-  set(LIBDIR_STALE "/lib/linux_centos7_x86_64/")
+  set(_libdir_stale "/lib/linux_centos7_x86_64/")
   unset_cached_varables_containting(
-"${LIBDIR_STALE}"
-"Auto clearing old ${LIBDIR_STALE} paths from CMake configuration"
+"${_libdir_stale}"
+"Auto clearing old ${_libdir_stale} paths from CMake configuration"
   )
+  unset(_libdir_stale)
 endif()
diff --git a/source/blender/nodes/geometry/nodes/node_geo_blur_attribute.cc 
b/source/blender/nodes/geometry/nodes/node_geo_blur_attribute.cc
index 174c6c8c509..891ac2614ef 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_blur_attribute.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_blur_attribute.cc
@@ -440,7 +440,7 @@ class BlurAttributeFieldInput final : public 
bke::GeometryFieldInput {
 return GVArray::ForGArray(std::move(main_buffer));
   }
 
-  void for_each_field_input_recursive(FunctionRef 
fn) const
+  void for_each_field_input_recursive(FunctionRef 
fn) const override
   {
 weight_field_.node().for_each_field_input_recursive(fn);
 value_field_.node().for_each_field_input_recursive(fn);
diff --git 
a/source/blender/nodes/geometry/nodes/node_geo_curve_endpoint_selection.cc 
b/source/blender/nodes/geometry/nodes/node_geo_curve_endpoint_selection.cc
index 3b48abfbd7d..7eb958fe576 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_endpoint_selection.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_endpoint_selection.cc
@@ -77,7 +77,7 @@ class EndpointFieldInput final : public bke::CurvesFieldInput 
{
 return VArray::ForContainer(std::move(selection));
   };
 
-  void for_each_field_input_recursive(FunctionRef 
fn) const
+  void for_each_field_input_recursive(FunctionRef 
fn) const override
   {
 start_size_.node().for_each_field_input_recursive(fn);
 end_size_.node().for_each_field_input_recursive(fn);
diff --git 
a/source/blender/nodes/geometry/nodes/node_geo_curve_topology_points_of_curve.cc
 
b/source/blender/nodes/geometry/nodes/node_geo_curve_topology_points_of_curve.cc
index ceb5c12fe5d..4ffada76497 100644
--- 
a/source/blender/nodes/geometry/nodes/node_geo_curve_topology_points_of_curve.cc
+++ 
b/source/blender/nodes/geometry/nodes/node_geo_curve_topology_points_of_curve.cc
@@ -101,7 +101,7 @@ class PointsOfCurveInput final : public 
bke::CurvesFieldInput {
 return VArray::ForContainer(std::move(point_of_curve));
   }
 
-  void for_each_field_input_recursive(FunctionRef 
fn) const
+  void for_each_field_input_recursive(FunctionRef 
fn) const override
   {
 curve_index_.node().for_each_field_input_recursive(fn);
 sort_index_.node().for_each_field_input_recursive(fn);
diff --git 
a/source/blender/nodes/geometry/nodes/node_geo_edge_paths_to_selection.cc 
b/source/blen

[Bf-blender-cvs] [32b861b14ac] master: Cleanup: fix deprecation warnings after OpenImageIO upgrade

2023-01-04 Thread Brecht Van Lommel
Commit: 32b861b14ac6e22ff93dec80ba6b4dd86d2c0611
Author: Brecht Van Lommel
Date:   Tue Dec 20 02:57:02 2022 +0100
Branches: master
https://developer.blender.org/rB32b861b14ac6e22ff93dec80ba6b4dd86d2c0611

Cleanup: fix deprecation warnings after OpenImageIO upgrade

===

M   intern/cycles/scene/image_oiio.cpp
M   intern/cycles/session/denoising.cpp
M   intern/cycles/session/merge.cpp
M   intern/cycles/session/tile.cpp
M   source/blender/imbuf/intern/oiio/openimageio_api.cpp

===

diff --git a/intern/cycles/scene/image_oiio.cpp 
b/intern/cycles/scene/image_oiio.cpp
index 5790c179d77..d0adef912be 100644
--- a/intern/cycles/scene/image_oiio.cpp
+++ b/intern/cycles/scene/image_oiio.cpp
@@ -113,14 +113,18 @@ static void oiio_load_pixels(const ImageMetaData 
,
 
   if (depth <= 1) {
 size_t scanlinesize = width * components * sizeof(StorageType);
-in->read_image(FileFormat,
+in->read_image(0,
+   0,
+   0,
+   components,
+   FileFormat,
(uchar *)readpixels + (height - 1) * scanlinesize,
AutoStride,
-scanlinesize,
AutoStride);
   }
   else {
-in->read_image(FileFormat, (uchar *)readpixels);
+in->read_image(0, 0, 0, components, FileFormat, (uchar *)readpixels);
   }
 
   if (components > 4) {
diff --git a/intern/cycles/session/denoising.cpp 
b/intern/cycles/session/denoising.cpp
index a9377d412e8..5086aa896d1 100644
--- a/intern/cycles/session/denoising.cpp
+++ b/intern/cycles/session/denoising.cpp
@@ -439,9 +439,12 @@ bool DenoiseImage::read_previous_pixels(const 
DenoiseImageLayer ,
 {
   /* Load pixels from neighboring frames, and copy them into device buffer
* with channels reshuffled. */
-  size_t num_pixels = (size_t)width * (size_t)height;
+  const size_t num_pixels = (size_t)width * (size_t)height;
+  const int num_channels = in_previous->spec().nchannels;
+
   array neighbor_pixels(num_pixels * num_channels);
-  if (!in_previous->read_image(TypeDesc::FLOAT, neighbor_pixels.data())) {
+
+  if (!in_previous->read_image(0, 0, 0, num_channels, TypeDesc::FLOAT, 
neighbor_pixels.data())) {
 return false;
   }
 
@@ -491,7 +494,7 @@ bool DenoiseImage::load(const string _filepath, string 
)
 
   /* Read all channels into buffer. Reading all channels at once is faster
* than individually due to interleaved EXR channel storage. */
-  if (!in->read_image(TypeDesc::FLOAT, pixels.data())) {
+  if (!in->read_image(0, 0, 0, num_channels, TypeDesc::FLOAT, pixels.data())) {
 error = "Failed to read image: " + in_filepath;
 return false;
   }
diff --git a/intern/cycles/session/merge.cpp b/intern/cycles/session/merge.cpp
index 316f56630d6..e8e1dd62b4a 100644
--- a/intern/cycles/session/merge.cpp
+++ b/intern/cycles/session/merge.cpp
@@ -401,8 +401,8 @@ static bool merge_pixels(const vector ,
  * faster than individually due to interleaved EXR channel storage. */
 array pixels;
 alloc_pixels(image.in->spec(), pixels);
-
-if (!image.in->read_image(TypeDesc::FLOAT, pixels.data())) {
+const int num_channels = image.in->spec().nchannels;
+if (!image.in->read_image(0, 0, 0, num_channels, TypeDesc::FLOAT, 
pixels.data())) {
   error = "Failed to read image: " + image.filepath;
   return false;
 }
@@ -538,6 +538,7 @@ static void read_layer_samples(vector ,
 /* Load the "Debug Sample Count" pass and add the samples to the 
layer's sample count. */
 array sample_count_buffer;
 sample_count_buffer.resize(in_spec.width * in_spec.height);
+
 image.in->read_image(0,
  0,
  layer.sample_pass_offset,
diff --git a/intern/cycles/session/tile.cpp b/intern/cycles/session/tile.cpp
index 071c72a2c17..ab858e6f192 100644
--- a/intern/cycles/session/tile.cpp
+++ b/intern/cycles/session/tile.cpp
@@ -646,7 +646,8 @@ bool TileManager::read_full_buffer_from_disk(const 
string_view filename,
 return false;
   }
 
-  if (!in->read_image(TypeDesc::FLOAT, buffers->buffer.data())) {
+  const int num_channels = in->spec().nchannels;
+  if (!in->read_image(0, 0, 0, num_channels, TypeDesc::FLOAT, 
buffers->buffer.data())) {
 LOG(ERROR) << "Error reading pixels from the tile file " << in->geterror();
 return false;
   }
diff --git a/source/blender/imbuf/intern/oiio/openimageio_api.cpp 
b/source/blender/imbuf/intern/oiio/openimageio_api.cpp
index f8d00b5222f..7ed084b7144 100644
--- a/source/blender/imbuf/intern/oiio/openimageio_api.cpp
+++ b/source/blender/imbuf/intern/oiio/openimageio_api.cpp
@@ -73,7 +73,11 @@ static ImBuf *imb_oiio_load_image(
   ibuf = IMB_allocImBuf(width, height,

[Bf-blender-cvs] [eb7ac996cc2] master: Build: install all shared libraries regardless of build options

2023-01-04 Thread Brecht Van Lommel
Commit: eb7ac996cc2a00e05aaa5644a684cf32d3f288c7
Author: Brecht Van Lommel
Date:   Fri Dec 16 13:55:46 2022 +0100
Branches: master
https://developer.blender.org/rBeb7ac996cc2a00e05aaa5644a684cf32d3f288c7

Build: install all shared libraries regardless of build options

There are dependencies between shared libraries, and Python modules which are
always installed on Linux and macOS can use these also.

Instead of adding logic for dealing with dependencies and conditional Python
module installs, just always install everything when using precompiled
libraries. This does not affect compile time which would be the main reason to
turn off build options, and it does not affect the case where system libraries
are used.

===

M   CMakeLists.txt
M   build_files/cmake/platform/platform_apple.cmake
M   build_files/cmake/platform/platform_unix.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b68fd630748..b3e9eb55c15 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -832,27 +832,22 @@ endif()
 # enable boost for cycles, audaspace or i18n
 # otherwise if the user disabled
 
-set_and_warn_dependency(WITH_BOOST WITH_CYCLES OFF)
 set_and_warn_dependency(WITH_BOOST WITH_INTERNATIONAL  OFF)
 set_and_warn_dependency(WITH_BOOST WITH_OPENVDBOFF)
-set_and_warn_dependency(WITH_BOOST WITH_OPENCOLORIOOFF)
 set_and_warn_dependency(WITH_BOOST WITH_QUADRIFLOW OFF)
 set_and_warn_dependency(WITH_BOOST WITH_USDOFF)
-set_and_warn_dependency(WITH_BOOST WITH_ALEMBICOFF)
 if(WITH_CYCLES)
   set_and_warn_dependency(WITH_PUGIXML WITH_CYCLES_OSL   OFF)
 endif()
-set_and_warn_dependency(WITH_PUGIXML WITH_OPENIMAGEIO  OFF)
 
-if(WITH_BOOST AND NOT (WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
-  WITH_OPENVDB OR WITH_OPENCOLORIO OR WITH_USD OR WITH_ALEMBIC))
+if(WITH_BOOST AND NOT (WITH_INTERNATIONAL OR WITH_OPENVDB OR
+   WITH_QUADRIFOLOW OR WITH_USD))
   message(STATUS "No dependencies need 'WITH_BOOST' forcing WITH_BOOST=OFF")
   set(WITH_BOOST OFF)
 endif()
 
 set_and_warn_dependency(WITH_TBB WITH_CYCLESOFF)
 set_and_warn_dependency(WITH_TBB WITH_USD   OFF)
-set_and_warn_dependency(WITH_TBB WITH_OPENIMAGEDENOISE  OFF)
 set_and_warn_dependency(WITH_TBB WITH_OPENVDB   OFF)
 set_and_warn_dependency(WITH_TBB WITH_MOD_FLUID OFF)
 
@@ -861,14 +856,10 @@ set_and_warn_dependency(WITH_OPENVDB WITH_NANOVDB   
OFF)
 
 # OpenVDB and OpenColorIO uses 'half' type from OpenEXR
 set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENVDB OFF)
-set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENCOLORIO  OFF)
 
 # Haru needs `TIFFFaxBlackCodes` & `TIFFFaxWhiteCodes` symbols from TIFF.
 set_and_warn_dependency(WITH_IMAGE_TIFF WITH_HARU   OFF)
 
-# USD needs OpenSubDiv, since that is used by the Cycles Hydra render delegate.
-set_and_warn_dependency(WITH_OPENSUBDIV WITH_USDOFF)
-
 # auto enable openimageio for cycles
 if(WITH_CYCLES)
   set(WITH_OPENIMAGEIO ON)
@@ -882,17 +873,6 @@ else()
   set(WITH_CYCLES_OSL OFF)
 endif()
 
-# auto enable openimageio linking dependencies
-if(WITH_OPENIMAGEIO)
-  set(WITH_IMAGE_OPENEXR ON)
-  set(WITH_IMAGE_TIFF ON)
-endif()
-
-# auto enable alembic linking dependencies
-if(WITH_ALEMBIC)
-  set(WITH_IMAGE_OPENEXR ON)
-endif()
-
 # don't store paths to libs for portable distribution
 if(WITH_INSTALL_PORTABLE)
   set(CMAKE_SKIP_BUILD_RPATH TRUE)
diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index b2101662969..e9e07229b2d 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -86,16 +86,14 @@ endif()
 
 if(WITH_USD)
   find_package(USD REQUIRED)
-  add_bundled_libraries(usd/lib)
 endif()
+add_bundled_libraries(usd/lib)
 
 if(WITH_MATERIALX)
   find_package(MaterialX)
   set_and_warn_library_found("MaterialX" MaterialX_FOUND WITH_MATERIALX)
-  if(WITH_MATERIALX)
-add_bundled_libraries(materialx/lib)
-  endif()
 endif()
+add_bundled_libraries(materialx/lib)
 
 if(WITH_VULKAN_BACKEND)
   find_package(MoltenVK REQUIRED)
@@ -117,8 +115,8 @@ endif()
 
 if(WITH_OPENSUBDIV)
   find_package(OpenSubdiv)
-  add_bundled_libraries(opensubdiv/lib)
 endif()
+add_bundled_libraries(opensubdiv/lib)
 
 if(WITH_CODEC_SNDFILE)
   find_package(SndFile)
@@ -156,9 +154,9 @@ list(APPEND FREETYPE_LIBRARIES
 
 if(WITH_IMAGE_OPENEXR)
   find_package(OpenEXR)
-  add_bundled_libraries(openexr/lib)
-  add_bundled_libraries(imath/lib)
 endif()
+add_bundled_libraries(openexr/lib)
+add_bundled_libraries(imath/lib)
 
 if(WITH_CODEC_FFMPEG)
   set(FFMPEG_ROOT_DIR ${LIBDIR}/ffmpeg)
@@ -270,12 +268,11 @@ if(WITH_BOOST)
   set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
   set(BOOST_DEFINITIONS)
 

[Bf-blender-cvs] [d28588f31e5] master: Cleanup: compiler warning on Arm with sse2neon

2023-01-04 Thread Brecht Van Lommel
Commit: d28588f31e5881d7bc5ea22bb629baa9448e936d
Author: Brecht Van Lommel
Date:   Tue Dec 20 03:03:14 2022 +0100
Branches: master
https://developer.blender.org/rBd28588f31e5881d7bc5ea22bb629baa9448e936d

Cleanup: compiler warning on Arm with sse2neon

Reorder includes to avoid BLI_simd.h redefining SSE2NEON_PRECISE macros.

===

M   intern/cycles/blender/display_driver.cpp

===

diff --git a/intern/cycles/blender/display_driver.cpp 
b/intern/cycles/blender/display_driver.cpp
index 60dd5e2c1d2..58f179d1824 100644
--- a/intern/cycles/blender/display_driver.cpp
+++ b/intern/cycles/blender/display_driver.cpp
@@ -1,12 +1,6 @@
 /* SPDX-License-Identifier: Apache-2.0
  * Copyright 2021-2022 Blender Foundation */
 
-#include "blender/display_driver.h"
-
-#include "device/device.h"
-#include "util/log.h"
-#include "util/math.h"
-
 #include "GPU_context.h"
 #include "GPU_immediate.h"
 #include "GPU_shader.h"
@@ -15,6 +9,12 @@
 
 #include "RE_engine.h"
 
+#include "blender/display_driver.h"
+
+#include "device/device.h"
+#include "util/log.h"
+#include "util/math.h"
+
 CCL_NAMESPACE_BEGIN
 
 /* 

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [65d8da97b8b] master: Build: clear old linux centos7 cache variables instead of printing them

2023-01-04 Thread Brecht Van Lommel
Commit: 65d8da97b8b6f24a6503ad7ad74cc4381f5d85b4
Author: Brecht Van Lommel
Date:   Wed Jan 4 10:26:03 2023 +0100
Branches: master
https://developer.blender.org/rB65d8da97b8b6f24a6503ad7ad74cc4381f5d85b4

Build: clear old linux centos7 cache variables instead of printing them

More automatic and convenient to update existing configurations this way.

Also move into platform_old_libs_update.cmake where similar logic was put
already.

===

M   CMakeLists.txt
M   build_files/cmake/macros.cmake
M   build_files/cmake/platform/platform_old_libs_update.cmake

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index acfab6ffc60..b68fd630748 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2009,24 +2009,6 @@ if(0)
   print_all_vars()
 endif()
 
-set(LIBDIR_STALE)
-
-if(UNIX AND NOT APPLE)
-  # Only search for the path if it's found on the system.
-  if(EXISTS "../lib/linux_centos7_x86_64")
-set(LIBDIR_STALE "/lib/linux_centos7_x86_64/")
-  endif()
-endif()
-
-if(LIBDIR_STALE)
-  print_cached_vars_containing_value(
-"${LIBDIR_STALE}"
-"\nWARNING: found cached references to old library paths!\n"
-"\nIt is *strongly* recommended to reference updated library paths!\n"
-  )
-endif()
-unset(LIBDIR_STALE)
-
 # Should be the last step of configuration.
 if(POSTCONFIGURE_SCRIPT)
   include(${POSTCONFIGURE_SCRIPT})
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index b632cb9c551..9965f892395 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -1209,43 +1209,6 @@ function(print_all_vars)
   endforeach()
 endfunction()
 
-# Print a list of all cached variables with values containing `contents`.
-function(print_cached_vars_containing_value
-  contents
-  msg_header
-  msg_footer
-  )
-  set(_list_info)
-  set(_found)
-  get_cmake_property(_vars VARIABLES)
-  foreach(_var ${_vars})
-if(DEFINED CACHE{${_var}})
-  # Skip "_" prefixed variables, these are used for internal book-keeping,
-  # not under user control.
-  string(FIND "${_var}" "_" _found)
-  if(NOT (_found EQUAL 0))
-string(FIND "${${_var}}" "${contents}" _found)
-if(NOT (_found EQUAL -1))
-  if(_found)
-list(APPEND _list_info "${_var}=${${_var}}")
-  endif()
-endif()
-  endif()
-endif()
-  endforeach()
-  unset(_var)
-  unset(_vars)
-  unset(_found)
-  if(_list_info)
-message(${msg_header})
-foreach(_var ${_list_info})
-  message(" * ${_var}")
-endforeach()
-message(${msg_footer})
-  endif()
-  unset(_list_info)
-endfunction()
-
 macro(openmp_delayload
   projectname
   )
diff --git a/build_files/cmake/platform/platform_old_libs_update.cmake 
b/build_files/cmake/platform/platform_old_libs_update.cmake
index c51029ab570..12ab9a44cf1 100644
--- a/build_files/cmake/platform/platform_old_libs_update.cmake
+++ b/build_files/cmake/platform/platform_old_libs_update.cmake
@@ -3,6 +3,7 @@
 
 # Auto update existing CMake caches for new libraries
 
+# Clear cached variables whose name matches `pattern`.
 function(unset_cache_variables pattern)
   get_cmake_property(_cache_variables CACHE_VARIABLES)
   foreach(_cache_variable ${_cache_variables})
@@ -12,6 +13,30 @@ function(unset_cache_variables pattern)
   endforeach()
 endfunction()
 
+# Clear cached variables with values containing `contents`.
+function(unset_cached_varables_containting contents msg)
+  get_cmake_property(_cache_variables CACHE_VARIABLES)
+  set(_found)
+  set(_print_msg)
+  foreach(_cache_variable ${_cache_variables})
+# Skip "_" prefixed variables, these are used for internal book-keeping,
+# not under user control.
+string(FIND "${_cache_variable}" "_" _found)
+if(NOT (_found EQUAL 0))
+  string(FIND "${${_cache_variable}}" "${contents}" _found)
+  if(NOT (_found EQUAL -1))
+if(_found)
+  unset(${_cache_variable} CACHE)
+  set(_print_msg ON)
+endif()
+  endif()
+endif()
+  endforeach()
+  if(_print_msg)
+message(STATUS ${msg})
+  endif()
+endfunction()
+
 # Detect update from 3.1 to 3.2 libs.
 if(UNIX AND
DEFINED OPENEXR_VERSION AND
@@ -63,3 +88,12 @@ if(UNIX AND
   unset_cache_variables("^TBB")
   unset_cache_variables("^USD")
 endif()
+
+if(UNIX AND (NOT APPLE) AND LIBDIR AND (EXISTS ${LIBDIR}))
+  # Only search for the path if it's found on the system.
+  set(LIBDIR_STALE "/lib/linux_centos7_x86_64/")
+  unset_cached_varables_containting(
+"${LIBDIR_STALE}"
+"Auto clearing old ${LIBDIR_STALE} paths from CMake configuration"
+  )
+endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [bd2d7a4a815] master: Fix build error in debug mode due to wrong code in assert

2023-01-04 Thread Brecht Van Lommel
Commit: bd2d7a4a815d814d39b770138cd8133f0b089694
Author: Brecht Van Lommel
Date:   Wed Jan 4 10:43:31 2023 +0100
Branches: master
https://developer.blender.org/rBbd2d7a4a815d814d39b770138cd8133f0b089694

Fix build error in debug mode due to wrong code in assert

===

M   source/blender/functions/FN_lazy_function_execute.hh

===

diff --git a/source/blender/functions/FN_lazy_function_execute.hh 
b/source/blender/functions/FN_lazy_function_execute.hh
index 1d82ac94ee8..5785fddaa51 100644
--- a/source/blender/functions/FN_lazy_function_execute.hh
+++ b/source/blender/functions/FN_lazy_function_execute.hh
@@ -95,7 +95,7 @@ inline void execute_lazy_function_eagerly_impl(
   fn.destruct_storage(context.storage);
 
   /* Make sure all outputs have been computed.  */
-  BLI_assert(!Span(set_outputs).contains(false));
+  BLI_assert(!Span(set_outputs).contains(false));
 }
 
 }  // namespace detail

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ac59dfeffd5] geometry-nodes-simulation: Fix T103049: Cycles specular light leak regression

2022-12-19 Thread Brecht Van Lommel
Commit: ac59dfeffd57e479a1f31169ea4047a9576203cd
Author: Brecht Van Lommel
Date:   Thu Dec 15 21:29:56 2022 +0100
Branches: geometry-nodes-simulation
https://developer.blender.org/rBac59dfeffd57e479a1f31169ea4047a9576203cd

Fix T103049: Cycles specular light leak regression

The logic here is not ideal but was unintentionally changed in refactoring
for path guiding, now restore it back to 3.3 behavior again.

===

M   intern/cycles/kernel/closure/bsdf.h
M   intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h
M   intern/cycles/kernel/closure/bsdf_microfacet.h
M   intern/cycles/kernel/closure/bsdf_microfacet_multi.h

===

diff --git a/intern/cycles/kernel/closure/bsdf.h 
b/intern/cycles/kernel/closure/bsdf.h
index 2f5c5d7bd0c..6de645cd1fe 100644
--- a/intern/cycles/kernel/closure/bsdf.h
+++ b/intern/cycles/kernel/closure/bsdf.h
@@ -580,11 +580,11 @@ ccl_device_inline
 case CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID:
 case CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID:
 case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID:
-  eval = bsdf_microfacet_ggx_eval(sc, sd->I, omega_in, pdf);
+  eval = bsdf_microfacet_ggx_eval(sc, sd->N, sd->I, omega_in, pdf);
   break;
 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID:
 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID:
-  eval = bsdf_microfacet_multi_ggx_eval(sc, sd->I, omega_in, pdf, 
>lcg_state);
+  eval = bsdf_microfacet_multi_ggx_eval(sc, sd->N, sd->I, omega_in, pdf, 
>lcg_state);
   break;
 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID:
 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID:
@@ -592,10 +592,10 @@ ccl_device_inline
   break;
 case CLOSURE_BSDF_MICROFACET_BECKMANN_ID:
 case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID:
-  eval = bsdf_microfacet_beckmann_eval(sc, sd->I, omega_in, pdf);
+  eval = bsdf_microfacet_beckmann_eval(sc, sd->N, sd->I, omega_in, pdf);
   break;
 case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID:
-  eval = bsdf_ashikhmin_shirley_eval(sc, sd->I, omega_in, pdf);
+  eval = bsdf_ashikhmin_shirley_eval(sc, sd->N, sd->I, omega_in, pdf);
   break;
 case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID:
   eval = bsdf_ashikhmin_velvet_eval(sc, sd->I, omega_in, pdf);
diff --git a/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h 
b/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h
index 14a4094d485..db02dad3909 100644
--- a/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h
+++ b/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h
@@ -40,11 +40,13 @@ ccl_device_inline float 
bsdf_ashikhmin_shirley_roughness_to_exponent(float rough
 }
 
 ccl_device_forceinline Spectrum bsdf_ashikhmin_shirley_eval(ccl_private const 
ShaderClosure *sc,
+const float3 Ng,
 const float3 I,
 const float3 
omega_in,
 ccl_private float 
*pdf)
 {
   ccl_private const MicrofacetBsdf *bsdf = (ccl_private const MicrofacetBsdf 
*)sc;
+  const float cosNgI = dot(Ng, omega_in);
   float3 N = bsdf->N;
 
   float NdotI = dot(N, I);/* in Cycles/OSL convention I is omega_out */
@@ -52,7 +54,8 @@ ccl_device_forceinline Spectrum 
bsdf_ashikhmin_shirley_eval(ccl_private const Sh
 
   float out = 0.0f;
 
-  if (fmaxf(bsdf->alpha_x, bsdf->alpha_y) <= 1e-4f || !(NdotI > 0.0f && NdotO 
> 0.0f)) {
+  if ((cosNgI < 0.0f) || fmaxf(bsdf->alpha_x, bsdf->alpha_y) <= 1e-4f ||
+  !(NdotI > 0.0f && NdotO > 0.0f)) {
 *pdf = 0.0f;
 return zero_spectrum();
   }
@@ -210,7 +213,7 @@ ccl_device int bsdf_ashikhmin_shirley_sample(ccl_private 
const ShaderClosure *sc
   }
   else {
 /* leave the rest to eval */
-*eval = bsdf_ashikhmin_shirley_eval(sc, I, *omega_in, pdf);
+*eval = bsdf_ashikhmin_shirley_eval(sc, N, I, *omega_in, pdf);
   }
 
   return label;
diff --git a/intern/cycles/kernel/closure/bsdf_microfacet.h 
b/intern/cycles/kernel/closure/bsdf_microfacet.h
index 39d0fb8f5f5..dcd55dc9bd7 100644
--- a/intern/cycles/kernel/closure/bsdf_microfacet.h
+++ b/intern/cycles/kernel/closure/bsdf_microfacet.h
@@ -517,27 +517,30 @@ ccl_device Spectrum 
bsdf_microfacet_ggx_eval_transmit(ccl_private const Microfac
 }
 
 ccl_device Spectrum bsdf_microfacet_ggx_eval(ccl_private const ShaderClosure 
*sc,
+ const float3 Ng,
  const float3 I,
  const float3 omega_in,
  ccl_private float *pdf)
 {
   ccl_private const Microf

[Bf-blender-cvs] [6b26b0db213] geometry-nodes-simulation: Fix build issue with NanoVDB and HIP on Linux

2022-12-19 Thread Brecht Van Lommel
Commit: 6b26b0db213e7ea7a2cd3197b7b877c18eaa4c3f
Author: Brecht Van Lommel
Date:   Thu Dec 15 15:10:09 2022 +0100
Branches: geometry-nodes-simulation
https://developer.blender.org/rB6b26b0db213e7ea7a2cd3197b7b877c18eaa4c3f

Fix build issue with NanoVDB and HIP on Linux

This patch was already accepted upstream, so this is temporary until we update
to a new OpenVDB release that includes it.

===

M   build_files/build_environment/patches/openvdb.diff

===

diff --git a/build_files/build_environment/patches/openvdb.diff 
b/build_files/build_environment/patches/openvdb.diff
index 9896460c26c..d3f19985815 100644
--- a/build_files/build_environment/patches/openvdb.diff
+++ b/build_files/build_environment/patches/openvdb.diff
@@ -90,3 +90,25 @@ diff -Naur orig/openvdb/openvdb/tree/ValueAccessor.h 
openvdb/openvdb/openvdb/tre
  
  CacheItem(TreeCacheT& parent)
  : mParent()
+diff --git a/nanovdb/nanovdb/NanoVDB.h b/nanovdb/nanovdb/NanoVDB.h
+index f7fc304..fde5c47 100644
+--- a/nanovdb/nanovdb/NanoVDB.h
 b/nanovdb/nanovdb/NanoVDB.h
+@@ -1877,7 +1877,7 @@ __hostdev__ static inline uint32_t FindLowestOn(uint64_t 
v)
+ {
+ NANOVDB_ASSERT(v);
+ #if (defined(__CUDA_ARCH__) || defined(__HIP__)) && 
defined(NANOVDB_USE_INTRINSICS)
+-return __ffsll(v);
++return __ffsll(static_cast(v));
+ #elif defined(_MSC_VER) && defined(NANOVDB_USE_INTRINSICS)
+ unsigned long index;
+ _BitScanForward64(, v);
+@@ -2592,7 +2592,7 @@ public:
+ ///
+ /// @note This method is only defined for IndexGrid = NanoGrid
+ template 
+-__hostdev__ typename enable_if::value, 
uint64_t>::type valueCount() const {return DataType::mData1;}
++__hostdev__ typename enable_if::value, const 
uint64_t&>::type valueCount() const {return DataType::mData1;}
+ 
+ /// @brief Return a const reference to the tree
+ __hostdev__ const TreeT& tree() const { return *reinterpret_cast(this->treePtr()); }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [f1f2ff11164] geometry-nodes-simulation: Fix T103170: missing Cycles viewport light threshold update after exposure edit

2022-12-19 Thread Brecht Van Lommel
Commit: f1f2ff1116400f9041124a3716583963f1ce7520
Author: Brecht Van Lommel
Date:   Thu Dec 15 19:13:55 2022 +0100
Branches: geometry-nodes-simulation
https://developer.blender.org/rBf1f2ff1116400f9041124a3716583963f1ce7520

Fix T103170: missing Cycles viewport light threshold update after exposure edit

===

M   intern/cycles/scene/scene.cpp

===

diff --git a/intern/cycles/scene/scene.cpp b/intern/cycles/scene/scene.cpp
index db96af19530..e4552713a9d 100644
--- a/intern/cycles/scene/scene.cpp
+++ b/intern/cycles/scene/scene.cpp
@@ -257,6 +257,9 @@ void Scene::device_update(Device *device_, Progress 
)
 light_manager->tag_update(this, ccl::LightManager::LIGHT_MODIFIED);
 object_manager->tag_update(this, ccl::ObjectManager::OBJECT_MODIFIED);
   }
+  if (film->exposure_is_modified()) {
+integrator->tag_modified();
+  }
 
   progress.set_status("Updating Shaders");
   shader_manager->device_update(device, , this, progress);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [cc9d9c7724e] geometry-nodes-simulation: Fix make deps harvest error on Linux, due to macOS specific folder in Vulkan

2022-12-19 Thread Brecht Van Lommel
Commit: cc9d9c7724ee86e87b03c8553cb1d3a6111b7755
Author: Brecht Van Lommel
Date:   Thu Dec 15 19:17:36 2022 +0100
Branches: geometry-nodes-simulation
https://developer.blender.org/rBcc9d9c7724ee86e87b03c8553cb1d3a6111b7755

Fix make deps harvest error on Linux, due to macOS specific folder in Vulkan

===

M   build_files/build_environment/cmake/harvest.cmake

===

diff --git a/build_files/build_environment/cmake/harvest.cmake 
b/build_files/build_environment/cmake/harvest.cmake
index 60d633c0ca9..252e52361c5 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -271,7 +271,9 @@ harvest(zstd/lib zstd/lib "*.a")
 harvest(shaderc shaderc "*")
 harvest(vulkan_headers vulkan "*")
 harvest_rpath_lib(vulkan_loader/lib vulkan/lib "*${SHAREDLIBEXT}*")
-harvest(vulkan_loader/loader vulkan/loader "*")
+if(APPLE)
+  harvest(vulkan_loader/loader vulkan/loader "*")
+endif()
 
 if(UNIX AND NOT APPLE)
   harvest(libglu/lib mesa/lib "*${SHAREDLIBEXT}*")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [fd3943dbd5d] blender-v3.4-release: Fix T103049: Cycles specular light leak regression

2022-12-15 Thread Brecht Van Lommel
Commit: fd3943dbd5d95ec5d5dda24acf7646796280997f
Author: Brecht Van Lommel
Date:   Thu Dec 15 21:29:56 2022 +0100
Branches: blender-v3.4-release
https://developer.blender.org/rBfd3943dbd5d95ec5d5dda24acf7646796280997f

Fix T103049: Cycles specular light leak regression

The logic here is not ideal but was unintentionally changed in refactoring
for path guiding, now restore it back to 3.3 behavior again.

===

M   intern/cycles/kernel/closure/bsdf.h
M   intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h
M   intern/cycles/kernel/closure/bsdf_microfacet.h
M   intern/cycles/kernel/closure/bsdf_microfacet_multi.h

===

diff --git a/intern/cycles/kernel/closure/bsdf.h 
b/intern/cycles/kernel/closure/bsdf.h
index 71af68aa80e..10948d56b4b 100644
--- a/intern/cycles/kernel/closure/bsdf.h
+++ b/intern/cycles/kernel/closure/bsdf.h
@@ -578,11 +578,11 @@ ccl_device_inline
 case CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID:
 case CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID:
 case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID:
-  eval = bsdf_microfacet_ggx_eval(sc, sd->I, omega_in, pdf);
+  eval = bsdf_microfacet_ggx_eval(sc, sd->N, sd->I, omega_in, pdf);
   break;
 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID:
 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID:
-  eval = bsdf_microfacet_multi_ggx_eval(sc, sd->I, omega_in, pdf, 
>lcg_state);
+  eval = bsdf_microfacet_multi_ggx_eval(sc, sd->N, sd->I, omega_in, pdf, 
>lcg_state);
   break;
 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID:
 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID:
@@ -590,10 +590,10 @@ ccl_device_inline
   break;
 case CLOSURE_BSDF_MICROFACET_BECKMANN_ID:
 case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID:
-  eval = bsdf_microfacet_beckmann_eval(sc, sd->I, omega_in, pdf);
+  eval = bsdf_microfacet_beckmann_eval(sc, sd->N, sd->I, omega_in, pdf);
   break;
 case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID:
-  eval = bsdf_ashikhmin_shirley_eval(sc, sd->I, omega_in, pdf);
+  eval = bsdf_ashikhmin_shirley_eval(sc, sd->N, sd->I, omega_in, pdf);
   break;
 case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID:
   eval = bsdf_ashikhmin_velvet_eval(sc, sd->I, omega_in, pdf);
diff --git a/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h 
b/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h
index 14a4094d485..db02dad3909 100644
--- a/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h
+++ b/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h
@@ -40,11 +40,13 @@ ccl_device_inline float 
bsdf_ashikhmin_shirley_roughness_to_exponent(float rough
 }
 
 ccl_device_forceinline Spectrum bsdf_ashikhmin_shirley_eval(ccl_private const 
ShaderClosure *sc,
+const float3 Ng,
 const float3 I,
 const float3 
omega_in,
 ccl_private float 
*pdf)
 {
   ccl_private const MicrofacetBsdf *bsdf = (ccl_private const MicrofacetBsdf 
*)sc;
+  const float cosNgI = dot(Ng, omega_in);
   float3 N = bsdf->N;
 
   float NdotI = dot(N, I);/* in Cycles/OSL convention I is omega_out */
@@ -52,7 +54,8 @@ ccl_device_forceinline Spectrum 
bsdf_ashikhmin_shirley_eval(ccl_private const Sh
 
   float out = 0.0f;
 
-  if (fmaxf(bsdf->alpha_x, bsdf->alpha_y) <= 1e-4f || !(NdotI > 0.0f && NdotO 
> 0.0f)) {
+  if ((cosNgI < 0.0f) || fmaxf(bsdf->alpha_x, bsdf->alpha_y) <= 1e-4f ||
+  !(NdotI > 0.0f && NdotO > 0.0f)) {
 *pdf = 0.0f;
 return zero_spectrum();
   }
@@ -210,7 +213,7 @@ ccl_device int bsdf_ashikhmin_shirley_sample(ccl_private 
const ShaderClosure *sc
   }
   else {
 /* leave the rest to eval */
-*eval = bsdf_ashikhmin_shirley_eval(sc, I, *omega_in, pdf);
+*eval = bsdf_ashikhmin_shirley_eval(sc, N, I, *omega_in, pdf);
   }
 
   return label;
diff --git a/intern/cycles/kernel/closure/bsdf_microfacet.h 
b/intern/cycles/kernel/closure/bsdf_microfacet.h
index 4eb7cd5df22..c4a49182c35 100644
--- a/intern/cycles/kernel/closure/bsdf_microfacet.h
+++ b/intern/cycles/kernel/closure/bsdf_microfacet.h
@@ -517,27 +517,30 @@ ccl_device Spectrum 
bsdf_microfacet_ggx_eval_transmit(ccl_private const Microfac
 }
 
 ccl_device Spectrum bsdf_microfacet_ggx_eval(ccl_private const ShaderClosure 
*sc,
+ const float3 Ng,
  const float3 I,
  const float3 omega_in,
  ccl_private float *pdf)
 {
   ccl_private const Microf

[Bf-blender-cvs] [3d29bbcc387] master: Fix T103049: Cycles specular light leak regression

2022-12-15 Thread Brecht Van Lommel
Commit: 3d29bbcc387feea063b48ce747668d1143f312f7
Author: Brecht Van Lommel
Date:   Thu Dec 15 21:29:56 2022 +0100
Branches: master
https://developer.blender.org/rB3d29bbcc387feea063b48ce747668d1143f312f7

Fix T103049: Cycles specular light leak regression

The logic here is not ideal but was unintentionally changed in refactoring
for path guiding, now restore it back to 3.3 behavior again.

===

M   intern/cycles/kernel/closure/bsdf.h
M   intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h
M   intern/cycles/kernel/closure/bsdf_microfacet.h
M   intern/cycles/kernel/closure/bsdf_microfacet_multi.h

===

diff --git a/intern/cycles/kernel/closure/bsdf.h 
b/intern/cycles/kernel/closure/bsdf.h
index 2f5c5d7bd0c..6de645cd1fe 100644
--- a/intern/cycles/kernel/closure/bsdf.h
+++ b/intern/cycles/kernel/closure/bsdf.h
@@ -580,11 +580,11 @@ ccl_device_inline
 case CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID:
 case CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID:
 case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID:
-  eval = bsdf_microfacet_ggx_eval(sc, sd->I, omega_in, pdf);
+  eval = bsdf_microfacet_ggx_eval(sc, sd->N, sd->I, omega_in, pdf);
   break;
 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID:
 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID:
-  eval = bsdf_microfacet_multi_ggx_eval(sc, sd->I, omega_in, pdf, 
>lcg_state);
+  eval = bsdf_microfacet_multi_ggx_eval(sc, sd->N, sd->I, omega_in, pdf, 
>lcg_state);
   break;
 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID:
 case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID:
@@ -592,10 +592,10 @@ ccl_device_inline
   break;
 case CLOSURE_BSDF_MICROFACET_BECKMANN_ID:
 case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID:
-  eval = bsdf_microfacet_beckmann_eval(sc, sd->I, omega_in, pdf);
+  eval = bsdf_microfacet_beckmann_eval(sc, sd->N, sd->I, omega_in, pdf);
   break;
 case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID:
-  eval = bsdf_ashikhmin_shirley_eval(sc, sd->I, omega_in, pdf);
+  eval = bsdf_ashikhmin_shirley_eval(sc, sd->N, sd->I, omega_in, pdf);
   break;
 case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID:
   eval = bsdf_ashikhmin_velvet_eval(sc, sd->I, omega_in, pdf);
diff --git a/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h 
b/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h
index 14a4094d485..db02dad3909 100644
--- a/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h
+++ b/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h
@@ -40,11 +40,13 @@ ccl_device_inline float 
bsdf_ashikhmin_shirley_roughness_to_exponent(float rough
 }
 
 ccl_device_forceinline Spectrum bsdf_ashikhmin_shirley_eval(ccl_private const 
ShaderClosure *sc,
+const float3 Ng,
 const float3 I,
 const float3 
omega_in,
 ccl_private float 
*pdf)
 {
   ccl_private const MicrofacetBsdf *bsdf = (ccl_private const MicrofacetBsdf 
*)sc;
+  const float cosNgI = dot(Ng, omega_in);
   float3 N = bsdf->N;
 
   float NdotI = dot(N, I);/* in Cycles/OSL convention I is omega_out */
@@ -52,7 +54,8 @@ ccl_device_forceinline Spectrum 
bsdf_ashikhmin_shirley_eval(ccl_private const Sh
 
   float out = 0.0f;
 
-  if (fmaxf(bsdf->alpha_x, bsdf->alpha_y) <= 1e-4f || !(NdotI > 0.0f && NdotO 
> 0.0f)) {
+  if ((cosNgI < 0.0f) || fmaxf(bsdf->alpha_x, bsdf->alpha_y) <= 1e-4f ||
+  !(NdotI > 0.0f && NdotO > 0.0f)) {
 *pdf = 0.0f;
 return zero_spectrum();
   }
@@ -210,7 +213,7 @@ ccl_device int bsdf_ashikhmin_shirley_sample(ccl_private 
const ShaderClosure *sc
   }
   else {
 /* leave the rest to eval */
-*eval = bsdf_ashikhmin_shirley_eval(sc, I, *omega_in, pdf);
+*eval = bsdf_ashikhmin_shirley_eval(sc, N, I, *omega_in, pdf);
   }
 
   return label;
diff --git a/intern/cycles/kernel/closure/bsdf_microfacet.h 
b/intern/cycles/kernel/closure/bsdf_microfacet.h
index 39d0fb8f5f5..dcd55dc9bd7 100644
--- a/intern/cycles/kernel/closure/bsdf_microfacet.h
+++ b/intern/cycles/kernel/closure/bsdf_microfacet.h
@@ -517,27 +517,30 @@ ccl_device Spectrum 
bsdf_microfacet_ggx_eval_transmit(ccl_private const Microfac
 }
 
 ccl_device Spectrum bsdf_microfacet_ggx_eval(ccl_private const ShaderClosure 
*sc,
+ const float3 Ng,
  const float3 I,
  const float3 omega_in,
  ccl_private float *pdf)
 {
   ccl_private const MicrofacetBsdf *bsdf = (ccl_private const Microfacet

[Bf-blender-cvs] [ef35247ee1e] master: Fix make deps harvest error on Linux, due to macOS specific folder in Vulkan

2022-12-15 Thread Brecht Van Lommel
Commit: ef35247ee1e16bab802cc5ee2a06ae1ea2b159a1
Author: Brecht Van Lommel
Date:   Thu Dec 15 19:17:36 2022 +0100
Branches: master
https://developer.blender.org/rBef35247ee1e16bab802cc5ee2a06ae1ea2b159a1

Fix make deps harvest error on Linux, due to macOS specific folder in Vulkan

===

M   build_files/build_environment/cmake/harvest.cmake

===

diff --git a/build_files/build_environment/cmake/harvest.cmake 
b/build_files/build_environment/cmake/harvest.cmake
index 60d633c0ca9..252e52361c5 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -271,7 +271,9 @@ harvest(zstd/lib zstd/lib "*.a")
 harvest(shaderc shaderc "*")
 harvest(vulkan_headers vulkan "*")
 harvest_rpath_lib(vulkan_loader/lib vulkan/lib "*${SHAREDLIBEXT}*")
-harvest(vulkan_loader/loader vulkan/loader "*")
+if(APPLE)
+  harvest(vulkan_loader/loader vulkan/loader "*")
+endif()
 
 if(UNIX AND NOT APPLE)
   harvest(libglu/lib mesa/lib "*${SHAREDLIBEXT}*")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [62f8d0d8c84] master: Fix T103170: missing Cycles viewport light threshold update after exposure edit

2022-12-15 Thread Brecht Van Lommel
Commit: 62f8d0d8c84e96e94fc580b7482e46298bfef822
Author: Brecht Van Lommel
Date:   Thu Dec 15 19:13:55 2022 +0100
Branches: master
https://developer.blender.org/rB62f8d0d8c84e96e94fc580b7482e46298bfef822

Fix T103170: missing Cycles viewport light threshold update after exposure edit

===

M   intern/cycles/scene/scene.cpp

===

diff --git a/intern/cycles/scene/scene.cpp b/intern/cycles/scene/scene.cpp
index db96af19530..e4552713a9d 100644
--- a/intern/cycles/scene/scene.cpp
+++ b/intern/cycles/scene/scene.cpp
@@ -257,6 +257,9 @@ void Scene::device_update(Device *device_, Progress 
)
 light_manager->tag_update(this, ccl::LightManager::LIGHT_MODIFIED);
 object_manager->tag_update(this, ccl::ObjectManager::OBJECT_MODIFIED);
   }
+  if (film->exposure_is_modified()) {
+integrator->tag_modified();
+  }
 
   progress.set_status("Updating Shaders");
   shader_manager->device_update(device, , this, progress);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c6ff8eb837a] master: Fix build issue with NanoVDB and HIP on Linux

2022-12-15 Thread Brecht Van Lommel
Commit: c6ff8eb837ae91d3fc0b9f9fc3646d6601f096fb
Author: Brecht Van Lommel
Date:   Thu Dec 15 15:10:09 2022 +0100
Branches: master
https://developer.blender.org/rBc6ff8eb837ae91d3fc0b9f9fc3646d6601f096fb

Fix build issue with NanoVDB and HIP on Linux

This patch was already accepted upstream, so this is temporary until we update
to a new OpenVDB release that includes it.

===

M   build_files/build_environment/patches/openvdb.diff

===

diff --git a/build_files/build_environment/patches/openvdb.diff 
b/build_files/build_environment/patches/openvdb.diff
index 9896460c26c..d3f19985815 100644
--- a/build_files/build_environment/patches/openvdb.diff
+++ b/build_files/build_environment/patches/openvdb.diff
@@ -90,3 +90,25 @@ diff -Naur orig/openvdb/openvdb/tree/ValueAccessor.h 
openvdb/openvdb/openvdb/tre
  
  CacheItem(TreeCacheT& parent)
  : mParent()
+diff --git a/nanovdb/nanovdb/NanoVDB.h b/nanovdb/nanovdb/NanoVDB.h
+index f7fc304..fde5c47 100644
+--- a/nanovdb/nanovdb/NanoVDB.h
 b/nanovdb/nanovdb/NanoVDB.h
+@@ -1877,7 +1877,7 @@ __hostdev__ static inline uint32_t FindLowestOn(uint64_t 
v)
+ {
+ NANOVDB_ASSERT(v);
+ #if (defined(__CUDA_ARCH__) || defined(__HIP__)) && 
defined(NANOVDB_USE_INTRINSICS)
+-return __ffsll(v);
++return __ffsll(static_cast(v));
+ #elif defined(_MSC_VER) && defined(NANOVDB_USE_INTRINSICS)
+ unsigned long index;
+ _BitScanForward64(, v);
+@@ -2592,7 +2592,7 @@ public:
+ ///
+ /// @note This method is only defined for IndexGrid = NanoGrid
+ template 
+-__hostdev__ typename enable_if::value, 
uint64_t>::type valueCount() const {return DataType::mData1;}
++__hostdev__ typename enable_if::value, const 
uint64_t&>::type valueCount() const {return DataType::mData1;}
+ 
+ /// @brief Return a const reference to the tree
+ __hostdev__ const TreeT& tree() const { return *reinterpret_cast(this->treePtr()); }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [19381673a80] temp-linux-35x-libs: More changes for new Linux libs * Remove unnecessary check for Blosc, this is part of OpenVDB lib now * Remove WITH_CXX11_ABI, always use new C++11

2022-12-15 Thread Brecht Van Lommel
Commit: 19381673a80ccf071de2615bca1ad331aafc9820
Author: Brecht Van Lommel
Date:   Thu Dec 15 13:18:27 2022 +0100
Branches: temp-linux-35x-libs
https://developer.blender.org/rB19381673a80ccf071de2615bca1ad331aafc9820

More changes for new Linux libs
* Remove unnecessary check for Blosc, this is part of OpenVDB lib now
* Remove WITH_CXX11_ABI, always use new C++11 ABI now
* Replace centos7 by glibc_228 everywhere

===

M   CMakeLists.txt
M   GNUmakefile
M   build_files/buildbot/config/blender_linux.cmake
M   build_files/cmake/platform/platform_unix.cmake
M   build_files/utils/make_update.py

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4de2454cfd8..74bfb23a3a4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -749,11 +749,6 @@ if("${CMAKE_GENERATOR}" MATCHES "Ninja")
   mark_as_advanced(WITH_NINJA_POOL_JOBS)
 endif()
 
-if(UNIX AND NOT APPLE)
-  option(WITH_CXX11_ABI "Use native C++11 ABI of compiler" ON)
-  mark_as_advanced(WITH_CXX11_ABI)
-endif()
-
 # Installation process.
 set(POSTINSTALL_SCRIPT "" CACHE FILEPATH "Run given CMake script after 
installation process")
 mark_as_advanced(POSTINSTALL_SCRIPT)
@@ -1721,12 +1716,6 @@ if(
   string(APPEND CMAKE_C_FLAGS " -std=gnu11")
 endif()
 
-if(UNIX AND NOT APPLE)
-  if(NOT WITH_CXX11_ABI)
-string(APPEND PLATFORM_CFLAGS " -D_GLIBCXX_USE_CXX11_ABI=0")
-  endif()
-endif()
-
 if(WITH_COMPILER_SHORT_FILE_MACRO)
   # Use '-fmacro-prefix-map' for Clang and GCC (MSVC doesn't support this).
   add_check_c_compiler_flag(C_PREFIX_MAP_FLAGS C_MACRO_PREFIX_MAP 
-fmacro-prefix-map=foo=bar)
diff --git a/GNUmakefile b/GNUmakefile
index 439b435f5f4..ba9ee978817 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -211,7 +211,7 @@ endif
 # Set the LIBDIR, an empty string when not found.
 LIBDIR:=$(wildcard ../lib/${OS_NCASE}_${CPU})
 ifeq (, $(LIBDIR))
-   LIBDIR:=$(wildcard ../lib/${OS_NCASE}_centos7_${CPU})
+   LIBDIR:=$(wildcard ../lib/${OS_NCASE}_${CPU}_glibc_228)
 endif
 ifeq (, $(LIBDIR))
LIBDIR:=$(wildcard ../lib/${OS_NCASE})
diff --git a/build_files/buildbot/config/blender_linux.cmake 
b/build_files/buildbot/config/blender_linux.cmake
index 078ad425124..ae7849002f7 100644
--- a/build_files/buildbot/config/blender_linux.cmake
+++ b/build_files/buildbot/config/blender_linux.cmake
@@ -7,7 +7,6 @@ 
include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/config/blender_release.cmake")
 message(STATUS "Building in Rocky 8 Linux 64bit environment")
 
 set(LIBDIR_NAME "linux_x86_64_glibc_228")
-set(WITH_CXX11_ABI   OFF CACHE BOOL "" FORCE)
 
 #  Linux-specific build options 
 # Options which are specific to Linux-only platforms
diff --git a/build_files/cmake/platform/platform_unix.cmake 
b/build_files/cmake/platform/platform_unix.cmake
index bcc90cef7c2..00869414391 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -10,16 +10,15 @@ if(NOT DEFINED LIBDIR)
   string(TOLOWER ${LIBDIR_NAME} LIBDIR_NAME)
   set(LIBDIR_NATIVE_ABI ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_NAME})
 
-  # Path to precompiled libraries with known CentOS 7 ABI.
-  set(LIBDIR_CENTOS7_ABI ${CMAKE_SOURCE_DIR}/../lib/linux_centos7_x86_64)
+  # Path to precompiled libraries with known glibc 2.28 ABI.
+  set(LIBDIR_GLIBC228_ABI ${CMAKE_SOURCE_DIR}/../lib/linux_x86_64_glibc_228)
 
   # Choose the best suitable libraries.
   if(EXISTS ${LIBDIR_NATIVE_ABI})
 set(LIBDIR ${LIBDIR_NATIVE_ABI})
 set(WITH_LIBC_MALLOC_HOOK_WORKAROUND True)
-  elseif(EXISTS ${LIBDIR_CENTOS7_ABI})
-set(LIBDIR ${LIBDIR_CENTOS7_ABI})
-set(WITH_CXX11_ABI OFF)
+  elseif(EXISTS ${LIBDIR_GLIBC228_ABI})
+set(LIBDIR ${LIBDIR_GLIBC228_ABI})
 if(WITH_MEM_JEMALLOC)
   # jemalloc provides malloc hooks.
   set(WITH_LIBC_MALLOC_HOOK_WORKAROUND False)
@@ -30,7 +29,7 @@ if(NOT DEFINED LIBDIR)
 
   # Avoid namespace pollustion.
   unset(LIBDIR_NATIVE_ABI)
-  unset(LIBDIR_CENTOS7_ABI)
+  unset(LIBDIR_GLIBC228_ABI)
 endif()
 
 # Support restoring this value once pre-compiled libraries have been handled.
@@ -330,10 +329,8 @@ if(WITH_OPENVDB)
   find_package(OpenVDB)
   set_and_warn_library_found("OpenVDB" OPENVDB_FOUND WITH_OPENVDB)
 
-  if(OPENVDB_FOUND)
-  add_bundled_libraries(openvdb/lib)
-  find_package_wrapper(Blosc)
-set_and_warn_library_found("Blosc" BLOSC_FOUND WITH_OPENVDB_BLOSC)
+  if(WITH_OPENVDB)
+add_bundled_libraries(openvdb/lib)
   endif()
 endif()
 
diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py
index 93820ee994a..fbadeecd597 100755
--- a/build_files/utils/make_update.py
+++ b/build_files/utils/make_update.py
@@ -41,7 +41,7 @@ def parse_arguments() -> argparse.Namespace:
 parser.add_ar

[Bf-blender-cvs] [6325174a753] blender-v3.4-release: Fix T103101: random Cycles animation rendering freezing up the application

2022-12-14 Thread Brecht Van Lommel
Commit: 6325174a753fc19effb1039f1872287383fbd787
Author: Brecht Van Lommel
Date:   Wed Dec 14 19:47:21 2022 +0100
Branches: blender-v3.4-release
https://developer.blender.org/rB6325174a753fc19effb1039f1872287383fbd787

Fix T103101: random Cycles animation rendering freezing up the application

===

M   source/blender/render/intern/engine.cc

===

diff --git a/source/blender/render/intern/engine.cc 
b/source/blender/render/intern/engine.cc
index acca657f7dc..f8fa20387fe 100644
--- a/source/blender/render/intern/engine.cc
+++ b/source/blender/render/intern/engine.cc
@@ -1044,14 +1044,19 @@ bool RE_engine_render(Render *re, bool do_all)
 re->engine = engine;
   }
 
-  /* create render result */
+  /* Create render result. Do this before acquiring lock, to avoid lock
+   * inversion as this calls python to get the render passes, while python UI
+   * code can also hold a lock on the render result. */
+  const bool create_new_result = (re->result == nullptr || !(re->r.scemode & 
R_BUTS_PREVIEW));
+  RenderResult *new_result = engine_render_create_result(re);
+
   BLI_rw_mutex_lock(>resultmutex, THREAD_LOCK_WRITE);
-  if (re->result == nullptr || !(re->r.scemode & R_BUTS_PREVIEW)) {
+  if (create_new_result) {
 if (re->result) {
   render_result_free(re->result);
 }
 
-re->result = engine_render_create_result(re);
+re->result = new_result;
   }
   BLI_rw_mutex_unlock(>resultmutex);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0b706237b09] blender-v3.4-release: Fix T103066: Cycles missing full constant foler for mix float and mix vector

2022-12-14 Thread Brecht Van Lommel
Commit: 0b706237b09006f59a1a3b619d69d49d3c80b482
Author: Brecht Van Lommel
Date:   Mon Dec 12 17:28:59 2022 +0100
Branches: blender-v3.4-release
https://developer.blender.org/rB0b706237b09006f59a1a3b619d69d49d3c80b482

Fix T103066: Cycles missing full constant foler for mix float and mix vector

===

M   intern/cycles/scene/constant_fold.cpp
M   intern/cycles/scene/constant_fold.h
M   intern/cycles/scene/shader_nodes.cpp

===

diff --git a/intern/cycles/scene/constant_fold.cpp 
b/intern/cycles/scene/constant_fold.cpp
index 1aa4515a087..224c8774cc6 100644
--- a/intern/cycles/scene/constant_fold.cpp
+++ b/intern/cycles/scene/constant_fold.cpp
@@ -386,6 +386,46 @@ void ConstantFolder::fold_mix_color(NodeMix type, bool 
clamp_factor, bool clamp)
   }
 }
 
+void ConstantFolder::fold_mix_float(bool clamp_factor, bool clamp) const
+{
+  ShaderInput *fac_in = node->input("Factor");
+  ShaderInput *float1_in = node->input("A");
+  ShaderInput *float2_in = node->input("B");
+
+  float fac = clamp_factor ? saturatef(node->get_float(fac_in->socket_type)) :
+ node->get_float(fac_in->socket_type);
+  bool fac_is_zero = !fac_in->link && fac == 0.0f;
+  bool fac_is_one = !fac_in->link && fac == 1.0f;
+
+  /* remove no-op node when factor is 0.0 */
+  if (fac_is_zero) {
+if (try_bypass_or_make_constant(float1_in, clamp)) {
+  return;
+}
+  }
+
+  /* remove useless mix floats nodes */
+  if (float1_in->link && float2_in->link) {
+if (float1_in->link == float2_in->link) {
+  try_bypass_or_make_constant(float1_in, clamp);
+  return;
+}
+  }
+  else if (!float1_in->link && !float2_in->link) {
+float value1 = node->get_float(float1_in->socket_type);
+float value2 = node->get_float(float2_in->socket_type);
+if (value1 == value2) {
+  try_bypass_or_make_constant(float1_in, clamp);
+  return;
+}
+  }
+  /* remove no-op mix float node when factor is 1.0 */
+  if (fac_is_one) {
+try_bypass_or_make_constant(float2_in, clamp);
+return;
+  }
+}
+
 void ConstantFolder::fold_math(NodeMathType type) const
 {
   ShaderInput *value1_in = node->input("Value1");
diff --git a/intern/cycles/scene/constant_fold.h 
b/intern/cycles/scene/constant_fold.h
index 246ff2d31ee..14097e1a0e4 100644
--- a/intern/cycles/scene/constant_fold.h
+++ b/intern/cycles/scene/constant_fold.h
@@ -52,6 +52,7 @@ class ConstantFolder {
   /* Specific nodes. */
   void fold_mix(NodeMix type, bool clamp) const;
   void fold_mix_color(NodeMix type, bool clamp_factor, bool clamp) const;
+  void fold_mix_float(bool clamp_factor, bool clamp) const;
   void fold_math(NodeMathType type) const;
   void fold_vector_math(NodeVectorMathType type) const;
   void fold_mapping(NodeMappingType type) const;
diff --git a/intern/cycles/scene/shader_nodes.cpp 
b/intern/cycles/scene/shader_nodes.cpp
index c1189e3795c..7d0a1117806 100644
--- a/intern/cycles/scene/shader_nodes.cpp
+++ b/intern/cycles/scene/shader_nodes.cpp
@@ -5132,6 +5132,9 @@ void MixFloatNode::constant_fold(const ConstantFolder 
)
 }
 folder.make_constant(a * (1 - fac) + b * fac);
   }
+  else {
+folder.fold_mix_float(use_clamp, false);
+  }
 }
 
 /* Mix Vector */
@@ -5185,6 +5188,9 @@ void MixVectorNode::constant_fold(const ConstantFolder 
)
 }
 folder.make_constant(a * (one_float3() - fac) + b * fac);
   }
+  else {
+folder.fold_mix_color(NODE_MIX_BLEND, use_clamp, false);
+  }
 }
 
 /* Mix Vector Non Uniform */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [56237f33a16] master: Fix T103101: random Cycles animation rendering freezing up the application

2022-12-14 Thread Brecht Van Lommel
Commit: 56237f33a16b9ec4c6f271b09b66eeabc5306e44
Author: Brecht Van Lommel
Date:   Wed Dec 14 19:47:21 2022 +0100
Branches: master
https://developer.blender.org/rB56237f33a16b9ec4c6f271b09b66eeabc5306e44

Fix T103101: random Cycles animation rendering freezing up the application

===

M   source/blender/render/intern/engine.cc

===

diff --git a/source/blender/render/intern/engine.cc 
b/source/blender/render/intern/engine.cc
index b9672246c5f..7d78f957e31 100644
--- a/source/blender/render/intern/engine.cc
+++ b/source/blender/render/intern/engine.cc
@@ -1046,14 +1046,19 @@ bool RE_engine_render(Render *re, bool do_all)
 re->engine = engine;
   }
 
-  /* create render result */
+  /* Create render result. Do this before acquiring lock, to avoid lock
+   * inversion as this calls python to get the render passes, while python UI
+   * code can also hold a lock on the render result. */
+  const bool create_new_result = (re->result == nullptr || !(re->r.scemode & 
R_BUTS_PREVIEW));
+  RenderResult *new_result = engine_render_create_result(re);
+
   BLI_rw_mutex_lock(>resultmutex, THREAD_LOCK_WRITE);
-  if (re->result == nullptr || !(re->r.scemode & R_BUTS_PREVIEW)) {
+  if (create_new_result) {
 if (re->result) {
   render_result_free(re->result);
 }
 
-re->result = engine_render_create_result(re);
+re->result = new_result;
   }
   BLI_rw_mutex_unlock(>resultmutex);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8c14992db23] master: Fix syntax errors in Cycles float8 test

2022-12-14 Thread Brecht Van Lommel
Commit: 8c14992db235964b04074fcdb94518d19debf124
Author: Brecht Van Lommel
Date:   Wed Dec 14 19:01:42 2022 +0100
Branches: master
https://developer.blender.org/rB8c14992db235964b04074fcdb94518d19debf124

Fix syntax errors in Cycles float8 test

===

M   intern/cycles/test/util_float8_test.h

===

diff --git a/intern/cycles/test/util_float8_test.h 
b/intern/cycles/test/util_float8_test.h
index bcceeada12c..4da96dfb7b0 100644
--- a/intern/cycles/test/util_float8_test.h
+++ b/intern/cycles/test/util_float8_test.h
@@ -26,7 +26,7 @@ static bool validate_cpu_capabilities()
  * constructor until we know the instructions are supported. */
 static vfloat8 float8_a()
 {
-  return make_vfloat8(0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f)
+  return make_vfloat8(0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f);
 }
 
 static vfloat8 float8_b()
@@ -80,7 +80,7 @@ TEST(TEST_CATEGORY_NAME, float8_add_vv){
 basic_test_vf(float8_a(), float_b, *)} TEST(TEST_CATEGORY_NAME, 
float8_div_vf){
 basic_test_vf(float8_a(), float_b, /)}
 
-TEST(TEST_CATEGORY_NAME, float8_c() tor)
+TEST(TEST_CATEGORY_NAME, float8_ctor)
 {
   INIT_FLOAT8_TEST
   compare_vector_scalar(make_vfloat8(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 
7.0f),

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [77a4ab3ccf2] master: Fix wrong syntax in Cycles float8 test fix

2022-12-14 Thread Brecht Van Lommel
Commit: 77a4ab3ccf2df23f540ebb0a1fc5e5266990281d
Author: Brecht Van Lommel
Date:   Wed Dec 14 18:35:34 2022 +0100
Branches: master
https://developer.blender.org/rB77a4ab3ccf2df23f540ebb0a1fc5e5266990281d

Fix wrong syntax in Cycles float8 test fix

===

M   intern/cycles/test/util_float8_test.h

===

diff --git a/intern/cycles/test/util_float8_test.h 
b/intern/cycles/test/util_float8_test.h
index 8ae95d75f47..bcceeada12c 100644
--- a/intern/cycles/test/util_float8_test.h
+++ b/intern/cycles/test/util_float8_test.h
@@ -24,17 +24,17 @@ static bool validate_cpu_capabilities()
 
 /* These are not just static variables because we don't want to run the
  * constructor until we know the instructions are supported. */
-static vfloat8 float8_a()()
+static vfloat8 float8_a()
 {
   return make_vfloat8(0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f)
 }
 
-static vfloat8 float8_b()()
+static vfloat8 float8_b()
 {
   return make_vfloat8(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f);
 }
 
-static vfloat8 float8_c()()
+static vfloat8 float8_c()
 {
   return make_vfloat8(1.1f, 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f);
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ecfcf1b97b7] master: Cycles: disable light tree for existing scenes, enable on new scenes

2022-12-14 Thread Brecht Van Lommel
Commit: ecfcf1b97b707faa7a3076bf4d917cd333c331d8
Author: Brecht Van Lommel
Date:   Tue Dec 13 20:10:39 2022 +0100
Branches: master
https://developer.blender.org/rBecfcf1b97b707faa7a3076bf4d917cd333c331d8

Cycles: disable light tree for existing scenes, enable on new scenes

While it helps on many scenes, it can be disruptive for existing scenes and
for benchmarks the differences in timing can be confusing. So be a bit more
conservative and only it enable it for new scenes.

===

M   intern/cycles/blender/addon/version_update.py

===

diff --git a/intern/cycles/blender/addon/version_update.py 
b/intern/cycles/blender/addon/version_update.py
index 8ebb17e614a..7f81ac96309 100644
--- a/intern/cycles/blender/addon/version_update.py
+++ b/intern/cycles/blender/addon/version_update.py
@@ -241,6 +241,12 @@ def do_versions(self):
 layer.samples *= layer.samples
 cscene["use_square_samples"] = False
 
+# Disable light tree for existing scenes.
+if version <= (3, 5, 3):
+cscene = scene.cycles
+if not cscene.is_property_set("use_light_tree"):
+cscene.use_light_tree = False
+
 # Lamps
 for light in bpy.data.lights:
 if light.library not in libraries:

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d88ebd31d67] master: Cleanup: add comments explaining need for requests dependencies

2022-12-14 Thread Brecht Van Lommel
Commit: d88ebd31d6736b9b184da1c1c11ddb5183ecacbc
Author: Brecht Van Lommel
Date:   Wed Dec 14 16:10:43 2022 +0100
Branches: master
https://developer.blender.org/rBd88ebd31d6736b9b184da1c1c11ddb5183ecacbc

Cleanup: add comments explaining need for requests dependencies

===

M   build_files/build_environment/cmake/versions.cmake

===

diff --git a/build_files/build_environment/cmake/versions.cmake 
b/build_files/build_environment/cmake/versions.cmake
index b27dcb4fa4e..6b56df4ee99 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -235,11 +235,11 @@ set(OPENVDB_FILE openvdb-${OPENVDB_VERSION}.tar.gz)
 # 
--
 # Python Modules
 
-# Needed by: TODO.
+# Needed by: `requests` module (so the version doesn't change on rebuild).
 set(IDNA_VERSION 3.3)
-# Needed by: TODO.
+# Needed by: `requests` module (so the version doesn't change on rebuild).
 set(CHARSET_NORMALIZER_VERSION 2.0.10)
-# Needed by: TODO.
+# Needed by: `requests` module (so the version doesn't change on rebuild).
 set(URLLIB3_VERSION 1.26.8)
 set(URLLIB3_CPE "cpe:2.3:a:urllib3:urllib3:${URLLIB3_VERSION}:*:*:*:*:*:*:*")
 # Needed by: Python's `requests` module (so add-ons can authenticate against 
trusted certificates).

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [2221cfc0442] master: Cleanup: GCC compiler warnings in Cycles float8 test

2022-12-14 Thread Brecht Van Lommel
Commit: 2221cfc044223d3e87013fe43ed5c5a1b28781a3
Author: Brecht Van Lommel
Date:   Wed Dec 14 17:38:25 2022 +0100
Branches: master
https://developer.blender.org/rB2221cfc044223d3e87013fe43ed5c5a1b28781a3

Cleanup: GCC compiler warnings in Cycles float8 test

===

M   intern/cycles/test/util_float8_test.h

===

diff --git a/intern/cycles/test/util_float8_test.h 
b/intern/cycles/test/util_float8_test.h
index 54701afaf8b..8ae95d75f47 100644
--- a/intern/cycles/test/util_float8_test.h
+++ b/intern/cycles/test/util_float8_test.h
@@ -22,13 +22,26 @@ static bool validate_cpu_capabilities()
 #endif
 }
 
+/* These are not just static variables because we don't want to run the
+ * constructor until we know the instructions are supported. */
+static vfloat8 float8_a()()
+{
+  return make_vfloat8(0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f)
+}
+
+static vfloat8 float8_b()()
+{
+  return make_vfloat8(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f);
+}
+
+static vfloat8 float8_c()()
+{
+  return make_vfloat8(1.1f, 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f);
+}
+
 #define INIT_FLOAT8_TEST \
   if (!validate_cpu_capabilities()) \
-return; \
-\
-  const vfloat8 float8_a = make_vfloat8(0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 
0.7f, 0.8f); \
-  const vfloat8 float8_b = make_vfloat8(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 
7.0f, 8.0f); \
-  const vfloat8 float8_c = make_vfloat8(1.1f, 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 
7.7f, 8.8f);
+return;
 
 #define compare_vector_scalar(a, b) \
   for (size_t index = 0; index < 8; index++) \
@@ -57,17 +70,17 @@ static bool validate_cpu_capabilities()
 
 static const float float_b = 1.5f;
 
-TEST(TEST_CATEGORY_NAME,
- float8_add_vv){basic_test_vv(float8_a, float8_b, +)} 
TEST(TEST_CATEGORY_NAME, float8_sub_vv){
-basic_test_vv(float8_a, float8_b, -)} TEST(TEST_CATEGORY_NAME, 
float8_mul_vv){
-basic_test_vv(float8_a, float8_b, *)} TEST(TEST_CATEGORY_NAME, 
float8_div_vv){
-basic_test_vv(float8_a, float8_b, /)} TEST(TEST_CATEGORY_NAME, 
float8_add_vf){
-basic_test_vf(float8_a, float_b, +)} TEST(TEST_CATEGORY_NAME, 
float8_sub_vf){
-basic_test_vf(float8_a, float_b, -)} TEST(TEST_CATEGORY_NAME, 
float8_mul_vf){
-basic_test_vf(float8_a, float_b, *)} TEST(TEST_CATEGORY_NAME,
-  
float8_div_vf){basic_test_vf(float8_a, float_b, /)}
-
-TEST(TEST_CATEGORY_NAME, float8_ctor)
+TEST(TEST_CATEGORY_NAME, float8_add_vv){
+basic_test_vv(float8_a(), float8_b(), +)} TEST(TEST_CATEGORY_NAME, 
float8_sub_vv){
+basic_test_vv(float8_a(), float8_b(), -)} TEST(TEST_CATEGORY_NAME, 
float8_mul_vv){
+basic_test_vv(float8_a(), float8_b(), *)} TEST(TEST_CATEGORY_NAME, 
float8_div_vv){
+basic_test_vv(float8_a(), float8_b(), /)} TEST(TEST_CATEGORY_NAME, 
float8_add_vf){
+basic_test_vf(float8_a(), float_b, +)} TEST(TEST_CATEGORY_NAME, 
float8_sub_vf){
+basic_test_vf(float8_a(), float_b, -)} TEST(TEST_CATEGORY_NAME, 
float8_mul_vf){
+basic_test_vf(float8_a(), float_b, *)} TEST(TEST_CATEGORY_NAME, 
float8_div_vf){
+basic_test_vf(float8_a(), float_b, /)}
+
+TEST(TEST_CATEGORY_NAME, float8_c() tor)
 {
   INIT_FLOAT8_TEST
   compare_vector_scalar(make_vfloat8(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 
7.0f),
@@ -85,18 +98,18 @@ TEST(TEST_CATEGORY_NAME, float8_sqrt)
 TEST(TEST_CATEGORY_NAME, float8_min_max)
 {
   INIT_FLOAT8_TEST
-  compare_vector_vector(min(float8_a, float8_b), float8_a);
-  compare_vector_vector(max(float8_a, float8_b), float8_b);
+  compare_vector_vector(min(float8_a(), float8_b()), float8_a());
+  compare_vector_vector(max(float8_a(), float8_b()), float8_b());
 }
 
 TEST(TEST_CATEGORY_NAME, float8_shuffle)
 {
   INIT_FLOAT8_TEST
-  vfloat8 res0 = shuffle<0, 1, 2, 3, 1, 3, 2, 0>(float8_a);
+  vfloat8 res0 = shuffle<0, 1, 2, 3, 1, 3, 2, 0>(float8_a());
   compare_vector_vector(res0, make_vfloat8(0.1f, 0.2f, 0.3f, 0.4f, 0.6f, 0.8f, 
0.7f, 0.5f));
-  vfloat8 res1 = shuffle<3>(float8_a);
+  vfloat8 res1 = shuffle<3>(float8_a());
   compare_vector_vector(res1, make_vfloat8(0.4f, 0.4f, 0.4f, 0.4f, 0.8f, 0.8f, 
0.8f, 0.8f));
-  vfloat8 res2 = shuffle<3, 2, 1, 0>(float8_a, float8_b);
+  vfloat8 res2 = shuffle<3, 2, 1, 0>(float8_a(), float8_b());
   compare_vector_vector(res2, make_vfloat8(0.4f, 0.3f, 2.0f, 1.0f, 0.8f, 0.7f, 
6.0f, 5.0f));
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [31ba4dd82e2] master: Build: bump OSL version to hash in 1.13 which is under development

2022-12-13 Thread Brecht Van Lommel
Commit: 31ba4dd82e2fff2a79c398b1ec1bfa523d107def
Author: Brecht Van Lommel
Date:   Tue Dec 13 18:53:12 2022 +0100
Branches: master
https://developer.blender.org/rB31ba4dd82e2fff2a79c398b1ec1bfa523d107def

Build: bump OSL version to hash in 1.13 which is under development

This includes string table changes to make the Cycles OptiX support work.

===

M   build_files/build_environment/cmake/versions.cmake

===

diff --git a/build_files/build_environment/cmake/versions.cmake 
b/build_files/build_environment/cmake/versions.cmake
index 097f632b356..870f2da9abe 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -195,9 +195,12 @@ set(TIFF_HASH_TYPE MD5)
 set(TIFF_FILE tiff-${TIFF_VERSION}.tar.gz)
 set(TIFF_CPE "cpe:2.3:a:libtiff:libtiff:${TIFF_VERSION}:*:*:*:*:*:*:*")
 
-set(OSL_VERSION 1.12.7.1)
-set(OSL_URI 
https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/archive/v${OSL_VERSION}.tar.gz)
-set(OSL_HASH 53211da86c34ba6e0344998c1a6d219c)
+# Recent commit from 1.13.0.2 under development, which includes string table
+# changes that make the Cycles OptiX implementation work. Official 1.12 OSL
+# releases should also build but without OptiX support.
+set(OSL_VERSION 1a7670600c8b08c2443a78d03c8c27e9a1149140)
+set(OSL_URI 
https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/archive/${OSL_VERSION}.tar.gz)
+set(OSL_HASH 7b6d6716b05d1addb92a8f47280bf77f)
 set(OSL_HASH_TYPE MD5)
 set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [e4f9c50928d] master: Fix T102990: OpenVDB files load very slow from network drives

2022-12-12 Thread Brecht Van Lommel
Commit: e4f9c50928d36b5eb61b36f2393439bd2d72e004
Author: Brecht Van Lommel
Date:   Mon Dec 12 18:21:34 2022 +0100
Branches: master
https://developer.blender.org/rBe4f9c50928d36b5eb61b36f2393439bd2d72e004

Fix T102990: OpenVDB files load very slow from network drives

The OpenVDB delay loading of voxel leaf data using mmap works poorly on network
drives. It has a mechanism to make a temporary local file copy to avoid this,
but we disabled that as it leads to other problems.

Now disable delay loading entirely. It's not clear that this has much benefit
in Blender. For rendering we need to load the entire grid to convert to NanoVDB,
and for geometry nodes there also are no cases where we only need part of grids.

===

M   intern/cycles/hydra/field.cpp
M   source/blender/blenkernel/intern/volume.cc

===

diff --git a/intern/cycles/hydra/field.cpp b/intern/cycles/hydra/field.cpp
index 67945be9d52..7cdb4c80d79 100644
--- a/intern/cycles/hydra/field.cpp
+++ b/intern/cycles/hydra/field.cpp
@@ -26,9 +26,12 @@ class HdCyclesVolumeLoader : public VDBImageLoader {
   HdCyclesVolumeLoader(const std::string , const std::string 
)
   : VDBImageLoader(gridName)
   {
+/* Disably delay loading and file copying, this has poor performance
+ * on network drivers. */
+const bool delay_load = false;
 openvdb::io::File file(filePath);
 file.setCopyMaxBytes(0);
-if (file.open()) {
+if (file.open(delay_load)) {
   grid = file.readGrid(gridName);
 }
   }
diff --git a/source/blender/blenkernel/intern/volume.cc 
b/source/blender/blenkernel/intern/volume.cc
index e81657f9ef0..ae921764de4 100644
--- a/source/blender/blenkernel/intern/volume.cc
+++ b/source/blender/blenkernel/intern/volume.cc
@@ -324,8 +324,11 @@ struct VolumeGrid {
  * holding a mutex lock. */
 blender::threading::isolate_task([&] {
   try {
+/* Disably delay loading and file copying, this has poor performance
+ * on network drivers. */
+const bool delay_load = false;
 file.setCopyMaxBytes(0);
-file.open();
+file.open(delay_load);
 openvdb::GridBase::Ptr vdb_grid = file.readGrid(name());
 entry->grid->setTree(vdb_grid->baseTreePtr());
   }
@@ -883,8 +886,11 @@ bool BKE_volume_load(const Volume *volume, const Main 
*bmain)
   openvdb::GridPtrVec vdb_grids;
 
   try {
+/* Disably delay loading and file copying, this has poor performance
+ * on network drivers. */
+const bool delay_load = false;
 file.setCopyMaxBytes(0);
-file.open();
+file.open(delay_load);
 vdb_grids = *(file.readAllGridMetadata());
 grids.metadata = file.getMetadata();
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [95a792a6338] master: Fix wrong Cycles standalone exposure default value, should be 1

2022-12-12 Thread Brecht Van Lommel
Commit: 95a792a6338b8c72cd186e029cdb6056303dc0bd
Author: Brecht Van Lommel
Date:   Mon Dec 12 17:52:51 2022 +0100
Branches: master
https://developer.blender.org/rB95a792a6338b8c72cd186e029cdb6056303dc0bd

Fix wrong Cycles standalone exposure default value, should be 1

===

M   intern/cycles/scene/film.cpp

===

diff --git a/intern/cycles/scene/film.cpp b/intern/cycles/scene/film.cpp
index cffa6acad59..67439b25868 100644
--- a/intern/cycles/scene/film.cpp
+++ b/intern/cycles/scene/film.cpp
@@ -88,7 +88,7 @@ NODE_DEFINE(Film)
 {
   NodeType *type = NodeType::add("film", create);
 
-  SOCKET_FLOAT(exposure, "Exposure", 0.8f);
+  SOCKET_FLOAT(exposure, "Exposure", 1.0f);
   SOCKET_FLOAT(pass_alpha_threshold, "Pass Alpha Threshold", 0.0f);
 
   static NodeEnum filter_enum;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [312e42708f8] master: Fix T103066: Cycles missing full constant foler for mix float and mix vector

2022-12-12 Thread Brecht Van Lommel
Commit: 312e42708f8073ef0882d11376c30dee5ac1aef8
Author: Brecht Van Lommel
Date:   Mon Dec 12 17:28:59 2022 +0100
Branches: master
https://developer.blender.org/rB312e42708f8073ef0882d11376c30dee5ac1aef8

Fix T103066: Cycles missing full constant foler for mix float and mix vector

===

M   intern/cycles/scene/constant_fold.cpp
M   intern/cycles/scene/constant_fold.h
M   intern/cycles/scene/shader_nodes.cpp

===

diff --git a/intern/cycles/scene/constant_fold.cpp 
b/intern/cycles/scene/constant_fold.cpp
index 1aa4515a087..224c8774cc6 100644
--- a/intern/cycles/scene/constant_fold.cpp
+++ b/intern/cycles/scene/constant_fold.cpp
@@ -386,6 +386,46 @@ void ConstantFolder::fold_mix_color(NodeMix type, bool 
clamp_factor, bool clamp)
   }
 }
 
+void ConstantFolder::fold_mix_float(bool clamp_factor, bool clamp) const
+{
+  ShaderInput *fac_in = node->input("Factor");
+  ShaderInput *float1_in = node->input("A");
+  ShaderInput *float2_in = node->input("B");
+
+  float fac = clamp_factor ? saturatef(node->get_float(fac_in->socket_type)) :
+ node->get_float(fac_in->socket_type);
+  bool fac_is_zero = !fac_in->link && fac == 0.0f;
+  bool fac_is_one = !fac_in->link && fac == 1.0f;
+
+  /* remove no-op node when factor is 0.0 */
+  if (fac_is_zero) {
+if (try_bypass_or_make_constant(float1_in, clamp)) {
+  return;
+}
+  }
+
+  /* remove useless mix floats nodes */
+  if (float1_in->link && float2_in->link) {
+if (float1_in->link == float2_in->link) {
+  try_bypass_or_make_constant(float1_in, clamp);
+  return;
+}
+  }
+  else if (!float1_in->link && !float2_in->link) {
+float value1 = node->get_float(float1_in->socket_type);
+float value2 = node->get_float(float2_in->socket_type);
+if (value1 == value2) {
+  try_bypass_or_make_constant(float1_in, clamp);
+  return;
+}
+  }
+  /* remove no-op mix float node when factor is 1.0 */
+  if (fac_is_one) {
+try_bypass_or_make_constant(float2_in, clamp);
+return;
+  }
+}
+
 void ConstantFolder::fold_math(NodeMathType type) const
 {
   ShaderInput *value1_in = node->input("Value1");
diff --git a/intern/cycles/scene/constant_fold.h 
b/intern/cycles/scene/constant_fold.h
index 246ff2d31ee..14097e1a0e4 100644
--- a/intern/cycles/scene/constant_fold.h
+++ b/intern/cycles/scene/constant_fold.h
@@ -52,6 +52,7 @@ class ConstantFolder {
   /* Specific nodes. */
   void fold_mix(NodeMix type, bool clamp) const;
   void fold_mix_color(NodeMix type, bool clamp_factor, bool clamp) const;
+  void fold_mix_float(bool clamp_factor, bool clamp) const;
   void fold_math(NodeMathType type) const;
   void fold_vector_math(NodeVectorMathType type) const;
   void fold_mapping(NodeMappingType type) const;
diff --git a/intern/cycles/scene/shader_nodes.cpp 
b/intern/cycles/scene/shader_nodes.cpp
index f032c52c1af..a64953c03ec 100644
--- a/intern/cycles/scene/shader_nodes.cpp
+++ b/intern/cycles/scene/shader_nodes.cpp
@@ -5132,6 +5132,9 @@ void MixFloatNode::constant_fold(const ConstantFolder 
)
 }
 folder.make_constant(a * (1 - fac) + b * fac);
   }
+  else {
+folder.fold_mix_float(use_clamp, false);
+  }
 }
 
 /* Mix Vector */
@@ -5185,6 +5188,9 @@ void MixVectorNode::constant_fold(const ConstantFolder 
)
 }
 folder.make_constant(a * (one_float3() - fac) + b * fac);
   }
+  else {
+folder.fold_mix_color(NODE_MIX_BLEND, use_clamp, false);
+  }
 }
 
 /* Mix Vector Non Uniform */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [f53bd178366] master: Cycles: take into account film exposure for light sampling threshold

2022-12-12 Thread Brecht Van Lommel
Commit: f53bd178366a95c3cef8c4b1b99b4d7a0cdcf4eb
Author: Brecht Van Lommel
Date:   Mon Dec 12 17:51:21 2022 +0100
Branches: master
https://developer.blender.org/rBf53bd178366a95c3cef8c4b1b99b4d7a0cdcf4eb

Cycles: take into account film exposure for light sampling threshold

To avoid issues with lights being either skipped or sampled unnecessarily
when the exposure is set low or high.

Contributed by Alaska.

Differential Revision: https://developer.blender.org/D16703

===

M   intern/cycles/scene/integrator.cpp

===

diff --git a/intern/cycles/scene/integrator.cpp 
b/intern/cycles/scene/integrator.cpp
index 64af0dadaa6..1aaac121c31 100644
--- a/intern/cycles/scene/integrator.cpp
+++ b/intern/cycles/scene/integrator.cpp
@@ -253,7 +253,7 @@ void Integrator::device_update(Device *device, DeviceScene 
*dscene, Scene *scene
 
   kintegrator->use_light_tree = scene->integrator->use_light_tree;
   if (light_sampling_threshold > 0.0f) {
-kintegrator->light_inv_rr_threshold = 1.0f / light_sampling_threshold;
+kintegrator->light_inv_rr_threshold = scene->film->get_exposure() / 
light_sampling_threshold;
   }
   else {
 kintegrator->light_inv_rr_threshold = 0.0f;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [18abc2feaad] master: Fix Cycles light tree not working with negative light strength

2022-12-12 Thread Brecht Van Lommel
Commit: 18abc2feaad6ccf162ee4a254405f854f705d101
Author: Brecht Van Lommel
Date:   Mon Dec 12 17:22:04 2022 +0100
Branches: master
https://developer.blender.org/rB18abc2feaad6ccf162ee4a254405f854f705d101

Fix Cycles light tree not working with negative light strength

Use absolute value of emission as estimate to make this work.

Contributed by Alaska.

Differential Revision: https://developer.blender.org/D16718

===

M   intern/cycles/scene/light_tree.cpp
M   intern/cycles/scene/shader.cpp

===

diff --git a/intern/cycles/scene/light_tree.cpp 
b/intern/cycles/scene/light_tree.cpp
index 9bf4bdca097..f9bd479cf1c 100644
--- a/intern/cycles/scene/light_tree.cpp
+++ b/intern/cycles/scene/light_tree.cpp
@@ -181,7 +181,9 @@ LightTreePrimitive::LightTreePrimitive(Scene *scene, int 
prim_id, int object_id)
   strength *= lamp->get_shader()->emission_estimate;
 }
 
-energy = average(strength);
+/* Use absolute value of energy so lights with negative strength are 
properly
+ * supported in the light tree. */
+energy = fabsf(average(strength));
   }
 }
 
diff --git a/intern/cycles/scene/shader.cpp b/intern/cycles/scene/shader.cpp
index ca15d0e1c44..09255d7cee4 100644
--- a/intern/cycles/scene/shader.cpp
+++ b/intern/cycles/scene/shader.cpp
@@ -349,7 +349,7 @@ void Shader::estimate_emission()
   }
 
   ShaderInput *surf = graph->output()->input("Surface");
-  emission_estimate = output_estimate_emission(surf->link, 
emission_is_constant);
+  emission_estimate = fabs(output_estimate_emission(surf->link, 
emission_is_constant));
 
   if (is_zero(emission_estimate)) {
 emission_sampling = EMISSION_SAMPLING_NONE;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [db68e2d4d3c] master: Build: install shaderc and vulkan libraries for Linux and macOS

2022-12-12 Thread Brecht Van Lommel
Commit: db68e2d4d3cc466198ec2f03fa0d03a6016d45f4
Author: Brecht Van Lommel
Date:   Mon Dec 12 16:52:45 2022 +0100
Branches: master
https://developer.blender.org/rBdb68e2d4d3cc466198ec2f03fa0d03a6016d45f4

Build: install shaderc and vulkan libraries for Linux and macOS

===

M   build_files/build_environment/cmake/harvest.cmake

===

diff --git a/build_files/build_environment/cmake/harvest.cmake 
b/build_files/build_environment/cmake/harvest.cmake
index 10d0c414303..2660d55d899 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -268,6 +268,10 @@ harvest(haru/include haru/include "*.h")
 harvest(haru/lib haru/lib "*.a")
 harvest(zstd/include zstd/include "*.h")
 harvest(zstd/lib zstd/lib "*.a")
+harvest(shaderc shaderc "*")
+harvest(vulkan_headers vulkan "*")
+harvest_rpath_lib(vulkan_loader/lib vulkan/lib "*${SHAREDLIBEXT}*")
+harvest(vulkan_loader/loader vulkan/loader "*")
 
 if(UNIX AND NOT APPLE)
   harvest(libglu/lib mesa/lib "*${SHAREDLIBEXT}*")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b2bee8416b0] master: Fix oslc precompiled binary not working on macOS due to wrong rpath

2022-12-11 Thread Brecht Van Lommel
Commit: b2bee8416b0fbf5fbc70a57494c5827a3d8265ef
Author: Brecht Van Lommel
Date:   Sun Dec 11 15:07:27 2022 +0100
Branches: master
https://developer.blender.org/rBb2bee8416b0fbf5fbc70a57494c5827a3d8265ef

Fix oslc precompiled binary not working on macOS due to wrong rpath

===

M   build_files/build_environment/cmake/harvest.cmake

===

diff --git a/build_files/build_environment/cmake/harvest.cmake 
b/build_files/build_environment/cmake/harvest.cmake
index 8c9cf1fb878..10d0c414303 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -218,7 +218,7 @@ harvest_rpath_lib(openvdb/lib openvdb/lib 
"*${SHAREDLIBEXT}*")
 harvest_rpath_python(openvdb/lib/python${PYTHON_SHORT_VERSION} 
python/lib/python${PYTHON_SHORT_VERSION} "*pyopenvdb*")
 harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h")
 harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a")
-harvest(osl/bin osl/bin "oslc")
+harvest_rpath_bin(osl/bin osl/bin "oslc")
 harvest(osl/include osl/include "*.h")
 harvest(osl/lib osl/lib "*.a")
 harvest(osl/share/OSL/shaders osl/share/OSL/shaders "*.h")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [07b67894e8d] master: Fix macOS precompiled libraries built on Xcode 14 not working in Xcode 13

2022-12-09 Thread Brecht Van Lommel
Commit: 07b67894e8db446edbaaf4eb2a49019ac61080c5
Author: Brecht Van Lommel
Date:   Fri Dec 9 21:27:36 2022 +0100
Branches: master
https://developer.blender.org/rB07b67894e8db446edbaaf4eb2a49019ac61080c5

Fix macOS precompiled libraries built on Xcode 14 not working in Xcode 13

Disable some symbols amd linking features not available in Xcode 13.

===

M   build_files/build_environment/patches/python_unix.diff
M   build_files/build_environment/patches/sdl.diff

===

diff --git a/build_files/build_environment/patches/python_unix.diff 
b/build_files/build_environment/patches/python_unix.diff
index a9baae8ce32..3969c706758 100644
--- a/build_files/build_environment/patches/python_unix.diff
+++ b/build_files/build_environment/patches/python_unix.diff
@@ -36,3 +36,39 @@ index a97a755..07ce853 100644
  if (self.compiler.find_library_file(self.lib_dirs, lib_name)):
  ffi_lib = lib_name
  break
+--- a/Modules/posixmodule.c2022-12-09 21:44:03
 b/Modules/posixmodule.c2022-12-09 21:39:46
+@@ -10564,10 +10564,15 @@
+ Py_BEGIN_ALLOW_THREADS
+ #ifdef HAVE_MKFIFOAT
+ if (dir_fd != DEFAULT_DIR_FD) {
++// BLENDER: disable also at compile time for compatibility when linking with 
older Xcode.
++// https://github.com/python/cpython/issues/97897
++#ifndef __APPLE__
+ if (HAVE_MKFIFOAT_RUNTIME) {
+ result = mkfifoat(dir_fd, path->narrow, mode);
+ 
++} else
++#endif
++{
+-} else {
+ mkfifoat_unavailable = 1;
+ result = 0;
+ }
+@@ -10638,10 +10633,15 @@
+ Py_BEGIN_ALLOW_THREADS
+ #ifdef HAVE_MKNODAT
+ if (dir_fd != DEFAULT_DIR_FD) {
++// BLENDER: disable also at compile time for compatibility when linking with 
older Xcode.
++// https://github.com/python/cpython/issues/97897
++#ifndef __APPLE__
+ if (HAVE_MKNODAT_RUNTIME) {
+ result = mknodat(dir_fd, path->narrow, mode, device);
+ 
++} else
++#endif
++{
+-} else {
+ mknodat_unavailable = 1;
+ result = 0;
+ }
diff --git a/build_files/build_environment/patches/sdl.diff 
b/build_files/build_environment/patches/sdl.diff
index 742183ecb4c..6caa98f9d68 100644
--- a/build_files/build_environment/patches/sdl.diff
+++ b/build_files/build_environment/patches/sdl.diff
@@ -30,3 +30,19 @@ diff -ru ./src/video/SDL_video.c ./src/video/SDL_video.c
  if (SDL_strcmp(_this->name, "cocoa") == 0) {  /* don't do this for X11, 
etc */
  if (Cocoa_IsWindowInFullscreenSpace(window)) {
  return SDL_FALSE;
+--- CMakeLists.txt 2022-12-09 20:40:00
 CMakeLists.txt 2022-12-09 20:40:00
+@@ -526,6 +526,13 @@
+ list(APPEND EXTRA_CFLAGS "-fno-strict-aliasing")
+   endif()
+ 
++  # BLENDER: make libs compatible with older Xcode.
++  # https://github.com/KhronosGroup/MoltenVK/issues/1756
++  check_c_compiler_flag(-fno-objc-msgsend-selector-stubs 
HAVE_GCC_NO_OBJC_MSGSEND_SELECTOR_STUBS)
++  if(HAVE_GCC_NO_OBJC_MSGSEND_SELECTOR_STUBS)
++list(APPEND EXTRA_CFLAGS "-fno-objc-msgsend-selector-stubs")
++  endif()
++
+   check_c_compiler_flag(-Wdeclaration-after-statement 
HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
+   if(HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
+ check_c_compiler_flag(-Werror=declaration-after-statement 
HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [3552f5d83c6] master: Build: don't bundle versioned dylib symbolic links on macOS

2022-12-09 Thread Brecht Van Lommel
Commit: 3552f5d83c692228dd13321cdcbf17084e065b60
Author: Brecht Van Lommel
Date:   Fri Dec 9 15:35:58 2022 +0100
Branches: master
https://developer.blender.org/rB3552f5d83c692228dd13321cdcbf17084e065b60

Build: don't bundle versioned dylib symbolic links on macOS

Apple notarization rejects packages containing them.

Similar to rpaths we handle generically this as part of the harvest step rather
than patches individual library builds systems.

Ref T99618

===

M   build_files/build_environment/cmake/harvest.cmake
M   build_files/build_environment/darwin/set_rpath.py

===

diff --git a/build_files/build_environment/cmake/harvest.cmake 
b/build_files/build_environment/cmake/harvest.cmake
index 893042afa00..8c9cf1fb878 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -63,6 +63,8 @@ endfunction()
 # Ideally this would be done as part of the Blender build since it makes 
assumptions
 # about where the files will be installed. However it would add patchelf as a 
new
 # dependency for building.
+#
+# Also removes versioned symlinks, which give errors with macOS notarization.
 if(APPLE)
   set(set_rpath_cmd python3 ${CMAKE_CURRENT_SOURCE_DIR}/darwin/set_rpath.py 
@loader_path)
 else()
@@ -76,7 +78,11 @@ function(harvest_rpath_lib from to pattern)
 cmake_policy(SET CMP0009 NEW)\n
 file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}) \n
 foreach(f \${shared_libs}) \n
-  if(NOT IS_SYMLINK \${f})\n
+  if(IS_SYMLINK \${f})\n
+if(APPLE)\n
+  file(REMOVE_RECURSE \${f})
+endif()\n
+  else()\n
 execute_process(COMMAND ${set_rpath_cmd} \${f}) \n
   endif()\n
 endforeach()")
@@ -101,15 +107,21 @@ function(harvest_rpath_python from to pattern)
   install(CODE "\
 file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}\.so*) \n
 foreach(f \${shared_libs}) \n
-  get_filename_component(f_dir \${f} DIRECTORY) \n
-  file(RELATIVE_PATH relative_dir \${f_dir} ${HARVEST_TARGET}) \n
-  execute_process(COMMAND ${set_rpath_cmd}/\${relative_dir}../lib \${f}) \n
+  if(IS_SYMLINK \${f})\n
+if(APPLE)\n
+  file(REMOVE_RECURSE \${f})
+endif()\n
+  else()\n
+get_filename_component(f_dir \${f} DIRECTORY) \n
+file(RELATIVE_PATH relative_dir \${f_dir} ${HARVEST_TARGET}) \n
+execute_process(COMMAND ${set_rpath_cmd}/\${relative_dir}../lib \${f}) 
\n
+  endif()\n
 endforeach()")
 endfunction()
 
 harvest(alembic/include alembic/include "*.h")
 harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
-harvest(alembic/bin alembic/bin "*")
+harvest_rpath_bin(alembic/bin alembic/bin "*")
 harvest(brotli/include brotli/include "*.h")
 harvest(brotli/lib brotli/lib "*.a")
 harvest(boost/include boost/include "*")
@@ -151,7 +163,7 @@ harvest(llvm/lib llvm/lib "libLLVM*.a")
 harvest(llvm/lib llvm/lib "libclang*.a")
 harvest(llvm/lib/clang llvm/lib/clang "*.h")
 if(APPLE)
-  harvest(openmp/lib openmp/lib "*")
+  harvest(openmp/lib openmp/lib "libomp.dylib")
   harvest(openmp/include openmp/include "*.h")
 endif()
 if(BLENDER_PLATFORM_ARM)
@@ -242,9 +254,8 @@ harvest(usd/lib/usd usd/lib/usd "*")
 harvest_rpath_python(usd/lib/python/pxr 
python/lib/python${PYTHON_SHORT_VERSION}/site-packages/pxr "*")
 harvest(usd/plugin usd/plugin "*")
 harvest(materialx/include materialx/include "*.h")
-harvest(materialx/lib materialx/lib "*")
+harvest_rpath_lib(materialx/lib materialx/lib "*${SHAREDLIBEXT}*")
 harvest(materialx/libraries materialx/libraries "*")
-harvest(materialx/python materialx/python "*")
 harvest(materialx/lib/cmake/MaterialX materialx/lib/cmake/MaterialX "*.cmake")
 harvest_rpath_python(materialx/python/MaterialX 
python/lib/python${PYTHON_SHORT_VERSION}/site-packages/MaterialX "*")
 # We do not need anything from the resources folder, but the MaterialX config
diff --git a/build_files/build_environment/darwin/set_rpath.py 
b/build_files/build_environment/darwin/set_rpath.py
index 190e619a5ba..6ca58875ac1 100644
--- a/build_files/build_environment/darwin/set_rpath.py
+++ b/build_files/build_environment/darwin/set_rpath.py
@@ -1,9 +1,19 @@
 #!/usr/bin/env python3
 # macOS utility to remove all rpaths and add a new one.
 
+import os
+import re
 import subprocess
 import sys
 
+# Strip version numbers from dependenciesm macOS notarizatiom fails
+# with version symlinks.
+def strip_lib_version(name):
+name = re.sub(r'(\.[0-9]+)+.dylib', '.dylib', name)
+name = re.sub(r'(\.[0-9]+)+.so', '.so', name)
+name = re.sub(r'(\.[0-9]+)+.cpython

[Bf-blender-cvs] [019b930d6b9] master: Fix build error with new USD libraries in debug mode

2022-12-09 Thread Brecht Van Lommel
Commit: 019b930d6b9ca87938032bef1eacadf70668c1aa
Author: Brecht Van Lommel
Date:   Fri Dec 9 17:08:35 2022 +0100
Branches: master
https://developer.blender.org/rB019b930d6b9ca87938032bef1eacadf70668c1aa

Fix build error with new USD libraries in debug mode

Solve conflict between TBB and Boost Python.

===

M   build_files/build_environment/cmake/boost.cmake
A   build_files/build_environment/patches/boost.diff

===

diff --git a/build_files/build_environment/cmake/boost.cmake 
b/build_files/build_environment/cmake/boost.cmake
index 495b419e69c..0daf38f0bf9 100644
--- a/build_files/build_environment/cmake/boost.cmake
+++ b/build_files/build_environment/cmake/boost.cmake
@@ -23,13 +23,11 @@ elseif(APPLE)
   set(BOOST_BUILD_COMMAND ./b2)
   set(BOOST_BUILD_OPTIONS toolset=clang-darwin cxxflags=${PLATFORM_CXXFLAGS} 
linkflags=${PLATFORM_LDFLAGS} visibility=global --disable-icu 
boost.locale.icu=off)
   set(BOOST_HARVEST_CMD echo .)
-  set(BOOST_PATCH_COMMAND echo .)
 else()
   set(BOOST_HARVEST_CMD echo .)
   set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh)
   set(BOOST_BUILD_COMMAND ./b2)
   set(BOOST_BUILD_OPTIONS cxxflags=${PLATFORM_CXXFLAGS} --disable-icu 
boost.locale.icu=off)
-  set(BOOST_PATCH_COMMAND echo .)
 endif()
 
 set(JAM_FILE ${BUILD_DIR}/boost.user-config.jam)
@@ -72,7 +70,7 @@ ExternalProject_Add(external_boost
   URL_HASH ${BOOST_HASH_TYPE}=${BOOST_HASH}
   PREFIX ${BUILD_DIR}/boost
   UPDATE_COMMAND  ""
-  PATCH_COMMAND ${BOOST_PATCH_COMMAND}
+  PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/boost/src/external_boost < 
${PATCH_DIR}/boost.diff
   CONFIGURE_COMMAND ${BOOST_CONFIGURE_COMMAND}
   BUILD_COMMAND ${BOOST_BUILD_COMMAND} ${BOOST_BUILD_OPTIONS} 
-j${MAKE_THREADS} architecture=${BOOST_ARCHITECTURE} 
address-model=${BOOST_ADDRESS_MODEL} link=shared threading=multi 
${BOOST_OPTIONS}--prefix=${LIBDIR}/boost install
   BUILD_IN_SOURCE 1
diff --git a/build_files/build_environment/patches/boost.diff 
b/build_files/build_environment/patches/boost.diff
new file mode 100644
index 000..e2bc06dc747
--- /dev/null
+++ b/build_files/build_environment/patches/boost.diff
@@ -0,0 +1,12 @@
+--- a/boost/python//detail/wrap_python.hpp 2022-12-09 19:16:17
 b/boost/python//detail/wrap_python.hpp 2022-12-09 19:18:08
+@@ -206,7 +206,8 @@
+ 
+ #ifdef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
+ # undef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
+-# define _DEBUG
++// BLENDER: TBB excepts this to have a value.
++# define _DEBUG 1
+ # ifdef _CRT_NOFORCE_MANIFEST_DEFINED_FROM_WRAP_PYTHON_H
+ #  undef _CRT_NOFORCE_MANIFEST_DEFINED_FROM_WRAP_PYTHON_H
+ #  undef _CRT_NOFORCE_MANIFEST

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [3494ba3815e] master: Python: update to version 3.10.9

2022-12-07 Thread Brecht Van Lommel
Commit: 3494ba3815e0703f3e96800a7517c25bc597b9f7
Author: Brecht Van Lommel
Date:   Wed Dec 7 21:09:25 2022 +0100
Branches: master
https://developer.blender.org/rB3494ba3815e0703f3e96800a7517c25bc597b9f7

Python: update to version 3.10.9

Among other bugs, this fixes an issue with Python libs built on macOS 13 not
working on older macOS versions (bug gh-97897 in Python).

Ref T99618

===

M   build_files/build_environment/cmake/versions.cmake

===

diff --git a/build_files/build_environment/cmake/versions.cmake 
b/build_files/build_environment/cmake/versions.cmake
index 507fab2dc09..b4c51da9093 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -201,11 +201,11 @@ set(OSL_HASH 53211da86c34ba6e0344998c1a6d219c)
 set(OSL_HASH_TYPE MD5)
 set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz)
 
-set(PYTHON_VERSION 3.10.8)
+set(PYTHON_VERSION 3.10.9)
 set(PYTHON_SHORT_VERSION 3.10)
 set(PYTHON_SHORT_VERSION_NO_DOTS 310)
 set(PYTHON_URI 
https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz)
-set(PYTHON_HASH e92356b012ed4d0e09675131d39b1bde)
+set(PYTHON_HASH dc8c0f274b28ee9e95923d20cfc364c9)
 set(PYTHON_HASH_TYPE MD5)
 set(PYTHON_FILE Python-${PYTHON_VERSION}.tar.xz)
 set(PYTHON_CPE "cpe:2.3:a:python:python:${PYTHON_VERSION}:-:*:*:*:*:*:*")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [fedef4c13aa] master: Fix cycles_test link error on macOS due to boost python in new 3.5 libraries

2022-12-07 Thread Brecht Van Lommel
Commit: fedef4c13aa10bead6a6106d8d9d0b8e5b1562f8
Author: Brecht Van Lommel
Date:   Wed Dec 7 20:38:28 2022 +0100
Branches: master
https://developer.blender.org/rBfedef4c13aa10bead6a6106d8d9d0b8e5b1562f8

Fix cycles_test link error on macOS due to boost python in new 3.5 libraries

The executable would get boost python linking in when not needed, and even when
linking to Python libraries there were still unresolved symbols. Instead split
off boost python libraries and link them only where needed.

===

M   build_files/cmake/platform/platform_apple.cmake
M   build_files/cmake/platform/platform_unix.cmake
M   build_files/cmake/platform/platform_win32.cmake
M   source/blender/io/usd/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 81545612176..7a39e6ffda3 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -260,7 +260,12 @@ if(WITH_BOOST)
   endif()
   find_package(Boost COMPONENTS ${_boost_FIND_COMPONENTS})
 
+  # Boost Python is separate to avoid linking Python into tests that don't 
need it.
   set(BOOST_LIBRARIES ${Boost_LIBRARIES})
+  if(WITH_USD AND USD_PYTHON_SUPPORT)
+set(BOOST_PYTHON_LIBRARIES 
${Boost_PYTHON${PYTHON_VERSION_NO_DOTS}_LIBRARY})
+list(REMOVE_ITEM BOOST_LIBRARIES ${BOOST_PYTHON_LIBRARIES})
+  endif()
   set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
   set(BOOST_DEFINITIONS)
 
diff --git a/build_files/cmake/platform/platform_unix.cmake 
b/build_files/cmake/platform/platform_unix.cmake
index 260fa2e58b2..bcc90cef7c2 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -407,8 +407,13 @@ if(WITH_BOOST)
 mark_as_advanced(Boost_INCLUDE_DIR)  # why doesn't boost do this?
   endif()
 
-  set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
+  # Boost Python is separate to avoid linking Python into tests that don't 
need it.
   set(BOOST_LIBRARIES ${Boost_LIBRARIES})
+  if(WITH_USD AND USD_PYTHON_SUPPORT)
+set(BOOST_PYTHON_LIBRARIES 
${Boost_PYTHON${PYTHON_VERSION_NO_DOTS}_LIBRARY})
+list(REMOVE_ITEM BOOST_LIBRARIES ${BOOST_PYTHON_LIBRARIES})
+  endif()
+  set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
   set(BOOST_LIBPATH ${Boost_LIBRARY_DIRS})
   set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
 
diff --git a/build_files/cmake/platform/platform_win32.cmake 
b/build_files/cmake/platform/platform_win32.cmake
index 7d2cb08f67b..f58b9bd4676 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -575,7 +575,7 @@ if(WITH_BOOST)
 )
 if (EXISTS ${BOOST_34_TRIGGER_FILE})
   if(WITH_USD)
-set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
+set(BOOST_PYTHON_LIBRARIES
   debug 
${BOOST_LIBPATH}/${BOOST_PREFIX}boost_python310-${BOOST_DEBUG_POSTFIX}.lib
   optimized 
${BOOST_LIBPATH}/${BOOST_PREFIX}boost_python310-${BOOST_POSTFIX}.lib
 )
diff --git a/source/blender/io/usd/CMakeLists.txt 
b/source/blender/io/usd/CMakeLists.txt
index 745a1c69dce..ebd292782c0 100644
--- a/source/blender/io/usd/CMakeLists.txt
+++ b/source/blender/io/usd/CMakeLists.txt
@@ -123,6 +123,7 @@ set(LIB
 
 list(APPEND LIB
   ${BOOST_LIBRARIES}
+  ${BOOST_PYTHON_LIBRARIES}
   ${PYTHON_LIBRARIES}
 )

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c2dc65dfa4a] master: Fix Cycles HIP compiler error for some architectures even with light tree off

2022-12-07 Thread Brecht Van Lommel
Commit: c2dc65dfa4ae60fa5d2c3b0cfe86f99dcb5bf16f
Author: Brecht Van Lommel
Date:   Wed Dec 7 17:45:33 2022 +0100
Branches: master
https://developer.blender.org/rBc2dc65dfa4ae60fa5d2c3b0cfe86f99dcb5bf16f

Fix Cycles HIP compiler error for some architectures even with light tree off

Revert some refactoring that is not strictly necessary and causes issues for
unknown reasons.

===

M   intern/cycles/kernel/light/distribution.h
M   intern/cycles/kernel/light/sample.h
M   intern/cycles/kernel/light/tree.h

===

diff --git a/intern/cycles/kernel/light/distribution.h 
b/intern/cycles/kernel/light/distribution.h
index 8afc15757db..45d6811d521 100644
--- a/intern/cycles/kernel/light/distribution.h
+++ b/intern/cycles/kernel/light/distribution.h
@@ -11,7 +11,7 @@ CCL_NAMESPACE_BEGIN
 /* Simple CDF based sampling over all lights in the scene, without taking into
  * account shading position or normal. */
 
-ccl_device int light_distribution_sample(KernelGlobals kg, ccl_private float 
)
+ccl_device int light_distribution_sample(KernelGlobals kg, ccl_private float 
*randu)
 {
   /* This is basically std::upper_bound as used by PBRT, to find a point light 
or
* triangle to emit from, proportional to area. a good improvement would be 
to
@@ -19,7 +19,7 @@ ccl_device int light_distribution_sample(KernelGlobals kg, 
ccl_private float 
* arbitrary shaders. */
   int first = 0;
   int len = kernel_data.integrator.num_distribution + 1;
-  float r = randu;
+  float r = *randu;
 
   do {
 int half_len = len >> 1;
@@ -42,32 +42,55 @@ ccl_device int light_distribution_sample(KernelGlobals kg, 
ccl_private float 
* each area light be stratified as well. */
   float distr_min = kernel_data_fetch(light_distribution, index).totarea;
   float distr_max = kernel_data_fetch(light_distribution, index + 1).totarea;
-  randu = (r - distr_min) / (distr_max - distr_min);
+  *randu = (r - distr_min) / (distr_max - distr_min);
 
   return index;
 }
 
+template
 ccl_device_noinline bool light_distribution_sample(KernelGlobals kg,
-   ccl_private float ,
+   float randu,
const float randv,
const float time,
const float3 P,
const int bounce,
const uint32_t path_flag,
-   ccl_private int 
_object,
-   ccl_private int 
_prim,
-   ccl_private int 
_shader_flag,
-   ccl_private float 
_pdf_selection)
+   ccl_private LightSample *ls)
 {
   /* Sample light index from distribution. */
-  const int index = light_distribution_sample(kg, randu);
+  const int index = light_distribution_sample(kg, );
   ccl_global const KernelLightDistribution *kdistribution = 
_data_fetch(light_distribution,

index);
+  const int prim = kdistribution->prim;
 
-  emitter_object = kdistribution->mesh_light.object_id;
-  emitter_prim = kdistribution->prim;
-  emitter_shader_flag = kdistribution->mesh_light.shader_flag;
-  emitter_pdf_selection = kernel_data.integrator.distribution_pdf_lights;
+  if (prim >= 0) {
+/* Mesh light. */
+const int object = kdistribution->mesh_light.object_id;
+
+/* Exclude synthetic meshes from shadow catcher pass. */
+if ((path_flag & PATH_RAY_SHADOW_CATCHER_PASS) &&
+!(kernel_data_fetch(object_flag, object) & SD_OBJECT_SHADOW_CATCHER)) {
+  return false;
+}
+
+const int shader_flag = kdistribution->mesh_light.shader_flag;
+triangle_light_sample(kg, prim, object, randu, randv, 
time, ls, P);
+ls->shader |= shader_flag;
+return (ls->pdf > 0.0f);
+  }
+
+  const int lamp = -prim - 1;
+
+  if (UNLIKELY(light_select_reached_max_bounces(kg, lamp, bounce))) {
+return false;
+  }
+
+  if (!light_sample(kg, lamp, randu, randv, P, path_flag, 
ls)) {
+return false;
+  }
+
+  ls->pdf_selection = kernel_data.integrator.distribution_pdf_lights;
+  ls->pdf *= ls->pdf_selection;
 
   return true;
 }
diff --git a/intern/cycles/kernel/light/sample.h 
b/intern/cycles/kernel/light/sample.h
index 6a5219c3ae9..8dfaf329e43 100644
--- a/intern/cycles/kernel/light/sample.h
+++ b/intern/cycles/kernel/light/sample.h
@@ -325,7 +325,7 @@ ccl_device_inline float 
light_sample_mis_weight_nee(KernelGlobals kg,
 
 ccl_device_

[Bf-blender-cvs] [bbfb074155e] master: Fix macOS tests failures with new libraries on buildbot

2022-12-07 Thread Brecht Van Lommel
Commit: bbfb074155e5e366729715609d0b4cab583191b6
Author: Brecht Van Lommel
Date:   Wed Dec 7 19:33:54 2022 +0100
Branches: master
https://developer.blender.org/rBbbfb074155e5e366729715609d0b4cab583191b6

Fix macOS tests failures with new libraries on buildbot

Don't assume a trailing slash in the install path.

===

M   build_files/cmake/platform/platform_apple.cmake

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index f7351f482bb..81545612176 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -496,7 +496,7 @@ if(PLATFORM_BUNDLED_LIBRARIES)
   # Environment variables to run precompiled executables that needed libraries.
   list(JOIN PLATFORM_BUNDLED_LIBRARY_DIRS ":" _library_paths)
   set(PLATFORM_ENV_BUILD 
"DYLD_LIBRARY_PATH=\"${_library_paths};${DYLD_LIBRARY_PATH}\"")
-  set(PLATFORM_ENV_INSTALL 
"DYLD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX_WITH_CONFIG}Blender.app/Contents/Resources/lib/;$DYLD_LIBRARY_PATH")
+  set(PLATFORM_ENV_INSTALL 
"DYLD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX_WITH_CONFIG}/Blender.app/Contents/Resources/lib/;$DYLD_LIBRARY_PATH")
   unset(_library_paths)
 endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [904cab0418c] master: Fix Cycles Hydra build errors

2022-12-07 Thread Brecht Van Lommel
Commit: 904cab0418c423bd19d9cf74526dad6f57a5aac7
Author: Brecht Van Lommel
Date:   Tue Oct 18 14:13:05 2022 +0200
Branches: master
https://developer.blender.org/rB904cab0418c423bd19d9cf74526dad6f57a5aac7

Fix Cycles Hydra build errors

Still initializing GLEW after libepoxy switch, and ellipse area light.

===

M   intern/cycles/hydra/display_driver.cpp
M   intern/cycles/hydra/light.cpp

===

diff --git a/intern/cycles/hydra/display_driver.cpp 
b/intern/cycles/hydra/display_driver.cpp
index 1a989605335..711542e0a3f 100644
--- a/intern/cycles/hydra/display_driver.cpp
+++ b/intern/cycles/hydra/display_driver.cpp
@@ -64,10 +64,6 @@ void HdCyclesDisplayDriver::gl_context_create()
 #endif
 
   if (!gl_pbo_id_) {
-if (glewInit() != GLEW_OK) {
-  return;
-}
-
 glGenBuffers(1, _pbo_id_);
   }
 }
diff --git a/intern/cycles/hydra/light.cpp b/intern/cycles/hydra/light.cpp
index 195b0794a75..36ef6cdc390 100644
--- a/intern/cycles/hydra/light.cpp
+++ b/intern/cycles/hydra/light.cpp
@@ -382,12 +382,12 @@ void HdCyclesLight::Initialize(HdRenderParam *renderParam)
   }
   else if (_lightType == HdPrimTypeTokens->diskLight) {
 _light->set_light_type(LIGHT_AREA);
-_light->set_round(true);
+_light->set_ellipse(true);
 _light->set_size(1.0f);
   }
   else if (_lightType == HdPrimTypeTokens->rectLight) {
 _light->set_light_type(LIGHT_AREA);
-_light->set_round(false);
+_light->set_ellipse(false);
 _light->set_size(1.0f);
   }
   else if (_lightType == HdPrimTypeTokens->sphereLight) {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ec04870091a] master: Fix Cycles standalone float textures not taking into account colorspace metadata

2022-12-07 Thread Brecht Van Lommel
Commit: ec04870091a36c433cd75c29dda94e937ba279fd
Author: Brecht Van Lommel
Date:   Mon Nov 14 18:09:45 2022 +0100
Branches: master
https://developer.blender.org/rBec04870091a36c433cd75c29dda94e937ba279fd

Fix Cycles standalone float textures not taking into account colorspace metadata

This got lost in colorspace refactoring at some point. It probably does not
affect many files in practice, but implementation was wrong regardless.

===

M   intern/cycles/scene/colorspace.cpp
M   intern/cycles/scene/colorspace.h
M   intern/cycles/scene/image.cpp
M   intern/cycles/scene/image.h
M   intern/cycles/scene/image_oiio.cpp

===

diff --git a/intern/cycles/scene/colorspace.cpp 
b/intern/cycles/scene/colorspace.cpp
index 189e3bc752d..9d598927864 100644
--- a/intern/cycles/scene/colorspace.cpp
+++ b/intern/cycles/scene/colorspace.cpp
@@ -95,16 +95,19 @@ bool ColorSpaceManager::colorspace_is_data(ustring 
colorspace)
 }
 
 ustring ColorSpaceManager::detect_known_colorspace(ustring colorspace,
+   const char *file_colorspace,
const char *file_format,
bool is_float)
 {
   if (colorspace == u_colorspace_auto) {
 /* Auto detect sRGB or raw if none specified. */
 if (is_float) {
-  bool srgb = (colorspace == "sRGB" || colorspace == "GammaCorrected" ||
-   (colorspace.empty() &&
-(strcmp(file_format, "png") == 0 || strcmp(file_format, 
"tiff") == 0 ||
- strcmp(file_format, "dpx") == 0 || strcmp(file_format, 
"jpeg2000") == 0)));
+  bool srgb = (strcmp(file_colorspace, "sRGB") == 0 ||
+   strcmp(file_colorspace, "GammaCorrected") == 0 ||
+   (file_colorspace[0] == '\0' &&
+(strcmp(file_format, "png") == 0 || strcmp(file_format, 
"jpeg") == 0 ||
+ strcmp(file_format, "tiff") == 0 || strcmp(file_format, 
"dpx") == 0 ||
+ strcmp(file_format, "jpeg2000") == 0)));
   return srgb ? u_colorspace_srgb : u_colorspace_raw;
 }
 else {
diff --git a/intern/cycles/scene/colorspace.h b/intern/cycles/scene/colorspace.h
index 985fc756763..a458d870bfd 100644
--- a/intern/cycles/scene/colorspace.h
+++ b/intern/cycles/scene/colorspace.h
@@ -21,6 +21,7 @@ class ColorSpaceManager {
* convert to and from. If the colorspace is u_colorspace_auto, we auto
* detect a colospace. */
   static ustring detect_known_colorspace(ustring colorspace,
+ const char *file_colorspace,
  const char *file_format,
  bool is_float);
 
diff --git a/intern/cycles/scene/image.cpp b/intern/cycles/scene/image.cpp
index 0352ed3e66c..a5c794bc762 100644
--- a/intern/cycles/scene/image.cpp
+++ b/intern/cycles/scene/image.cpp
@@ -261,7 +261,7 @@ void ImageMetaData::detect_colorspace()
 {
   /* Convert used specified color spaces to one we know how to handle. */
   colorspace = ColorSpaceManager::detect_known_colorspace(
-  colorspace, colorspace_file_format, is_float());
+  colorspace, colorspace_file_hint.c_str(), colorspace_file_format, 
is_float());
 
   if (colorspace == u_colorspace_raw) {
 /* Nothing to do. */
diff --git a/intern/cycles/scene/image.h b/intern/cycles/scene/image.h
index 9edb6a7eaf5..da47d8144bc 100644
--- a/intern/cycles/scene/image.h
+++ b/intern/cycles/scene/image.h
@@ -69,6 +69,7 @@ class ImageMetaData {
 
   /* Optional color space, defaults to raw. */
   ustring colorspace;
+  string colorspace_file_hint;
   const char *colorspace_file_format;
 
   /* Optional transform for 3D images. */
diff --git a/intern/cycles/scene/image_oiio.cpp 
b/intern/cycles/scene/image_oiio.cpp
index 7bcf1ccb073..5790c179d77 100644
--- a/intern/cycles/scene/image_oiio.cpp
+++ b/intern/cycles/scene/image_oiio.cpp
@@ -85,6 +85,7 @@ bool OIIOImageLoader::load_metadata(const ImageDeviceFeatures 
& /*features*/,
   }
 
   metadata.colorspace_file_format = in->format_name();
+  metadata.colorspace_file_hint = spec.get_string_attribute("oiio:ColorSpace");
 
   in->close();

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [f627abea2da] master: Fix Cycles Hydra build issue with USD 22.05

2022-12-07 Thread Brecht Van Lommel
Commit: f627abea2daf7121885b03e958bb890d14b96467
Author: Brecht Van Lommel
Date:   Wed Oct 26 15:44:56 2022 +0200
Branches: master
https://developer.blender.org/rBf627abea2daf7121885b03e958bb890d14b96467

Fix Cycles Hydra build issue with USD 22.05

Thanks to Alex Fuller for proposing the solution.

===

M   intern/cycles/hydra/material.cpp

===

diff --git a/intern/cycles/hydra/material.cpp b/intern/cycles/hydra/material.cpp
index 9406e20cef9..b613cee0b01 100644
--- a/intern/cycles/hydra/material.cpp
+++ b/intern/cycles/hydra/material.cpp
@@ -235,7 +235,11 @@ void HdCyclesMaterial::Sync(HdSceneDelegate *sceneDelegate,
   }
   else {
 networkConverted = std::make_unique();
+#  if PXR_VERSION >= 2205
+*networkConverted = HdConvertToHdMaterialNetwork2(networkOld);
+#  else
 HdMaterialNetwork2ConvertFromHdMaterialNetworkMap(networkOld, 
networkConverted.get());
+#  endif
 network = networkConverted.get();
   }
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d8ffb4655c3] master: Fix missed libraries in auto CMake config update for 3.5 libraries

2022-12-07 Thread Brecht Van Lommel
Commit: d8ffb4655c34e2f060accf8639b54c83bacb9998
Author: Brecht Van Lommel
Date:   Wed Dec 7 15:36:19 2022 +0100
Branches: master
https://developer.blender.org/rBd8ffb4655c34e2f060accf8639b54c83bacb9998

Fix missed libraries in auto CMake config update for 3.5 libraries

===

M   build_files/cmake/platform/platform_old_libs_update.cmake

===

diff --git a/build_files/cmake/platform/platform_old_libs_update.cmake 
b/build_files/cmake/platform/platform_old_libs_update.cmake
index 1e98ea7a4ff..14f64ff0607 100644
--- a/build_files/cmake/platform/platform_old_libs_update.cmake
+++ b/build_files/cmake/platform/platform_old_libs_update.cmake
@@ -45,14 +45,16 @@ if(UNIX AND DEFINED NANOVDB_INCLUDE_DIR)
   endif()
 endif()
 
-# Detect update to 3.4 libs with shared libraries.
+# Detect update to 3.5 libs with shared libraries.
 if(UNIX AND
   DEFINED TBB_LIBRARY AND
   TBB_LIBRARY MATCHES "libtbb.a$" AND
   EXISTS ${LIBDIR}/usd/include/pxr/base/tf/pyModule.h)
-  message(STATUS "Auto updating CMake configuration for Blender 3.4 libraries")
+  message(STATUS "Auto updating CMake configuration for Blender 3.5 libraries")
   unset_cache_variables("^BLOSC")
   unset_cache_variables("^BOOST")
+  unset_cache_variables("^Boost")
+  unset_cache_variables("^IMATH")
   unset_cache_variables("^OPENCOLORIO")
   unset_cache_variables("^OPENEXR")
   unset_cache_variables("^OPENIMAGEIO")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ebff39d5bb3] master: Build: make running executables as part of build/tests work with shared libs

2022-12-07 Thread Brecht Van Lommel
Commit: ebff39d5bb3697a767eb3f6c662e29cef326e2ae
Author: Brecht Van Lommel
Date:   Mon Dec 5 23:05:25 2022 +0100
Branches: master
https://developer.blender.org/rBebff39d5bb3697a767eb3f6c662e29cef326e2ae

Build: make running executables as part of build/tests work with shared libs

Ensure the environment is set up for blender_test, idiff and oslc so that they
can find the required shared libraries.

Also deduplicate add_bundled_libraries() between Linux and macOS.

Includes contributions by Ray Molenkamp and Brecht Van Lommel.

Ref T99618

===

M   build_files/cmake/Modules/GTestTesting.cmake
M   build_files/cmake/macros.cmake
M   build_files/cmake/platform/platform_apple.cmake
M   build_files/cmake/platform/platform_unix.cmake
M   build_files/cmake/platform/platform_win32.cmake
M   intern/cycles/kernel/osl/shaders/CMakeLists.txt
M   tests/python/CMakeLists.txt

===

diff --git a/build_files/cmake/Modules/GTestTesting.cmake 
b/build_files/cmake/Modules/GTestTesting.cmake
index 5ffd158361e..d6f5b2a5cd6 100644
--- a/build_files/cmake/Modules/GTestTesting.cmake
+++ b/build_files/cmake/Modules/GTestTesting.cmake
@@ -95,6 +95,9 @@ macro(BLENDER_SRC_GTEST_EX)
   set_tests_properties(${TARGET_NAME} PROPERTIES
 ENVIRONMENT LSAN_OPTIONS=exitcode=0:$ENV{LSAN_OPTIONS}
   )
+  if(WIN32)
+set_tests_properties(${TARGET_NAME} PROPERTIES ENVIRONMENT 
"PATH=${CMAKE_INSTALL_PREFIX_WITH_CONFIG}/blender.shared/;$ENV{PATH}")
+  endif()
 endif()
 if(WIN32)
   set_target_properties(${TARGET_NAME} PROPERTIES VS_GLOBAL_VcpkgEnabled 
"false")
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 824c587c86e..eadf9273e26 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -422,7 +422,9 @@ function(blender_add_test_suite)
   --test-assets-dir "${CMAKE_SOURCE_DIR}/../lib/tests"
   --test-release-dir "${_test_release_dir}"
   )
-
+  if(WIN32)
+set_tests_properties(${ARGS_SUITE_NAME} PROPERTIES ENVIRONMENT 
"PATH=${CMAKE_INSTALL_PREFIX_WITH_CONFIG}/blender.shared/;$ENV{PATH}")
+  endif()
   unset(_test_release_dir)
 endfunction()
 
@@ -1257,3 +1259,21 @@ endmacro()
 macro(without_system_libs_end)
   unset(CMAKE_IGNORE_PATH)
 endmacro()
+
+# Utility to gather and install precompiled shared libraries.
+macro(add_bundled_libraries library_dir)
+  if(EXISTS ${LIBDIR})
+set(_library_dir ${LIBDIR}/${library_dir})
+if(WIN32)
+  file(GLOB _all_library_versions ${_library_dir}/*\.dll)
+elseif(APPLE)
+  file(GLOB _all_library_versions ${_library_dir}/*\.dylib*)
+else()
+  file(GLOB _all_library_versions ${_library_dir}/*\.so*)
+endif()
+list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_all_library_versions})
+list(APPEND PLATFORM_BUNDLED_LIBRARY_DIRS ${_library_dir})
+unset(_all_library_versions)
+unset(_library_dir)
+ endif()
+endmacro()
diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 31171d083c1..cc13749a5ad 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -21,18 +21,6 @@ function(print_found_status
   endif()
 endfunction()
 
-# Utility to install precompiled shared libraries.
-macro(add_bundled_libraries library)
-  if(EXISTS ${LIBDIR})
-set(_library_dir ${LIBDIR}/${library}/lib)
-file(GLOB _all_library_versions ${_library_dir}/*\.dylib*)
-list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_all_library_versions})
-list(APPEND PLATFORM_BUNDLED_LIBRARY_DIRS ${_library_dir})
-unset(_all_library_versions)
-unset(_library_dir)
-  endif()
-endmacro()
-
 # 
 # Find system provided libraries.
 
@@ -364,7 +352,7 @@ if(WITH_OPENMP)
 set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib/")
 set(OpenMP_LINKER_FLAGS "-L'${OpenMP_LIBRARY_DIR}' -lomp")
 set(OpenMP_LIBRARY "${OpenMP_LIBRARY_DIR}/libomp.dylib")
-add_bundled_libraries(openmp)
+add_bundled_libraries(openmp/lib)
   endif()
 endif()
 
@@ -480,6 +468,12 @@ if(PLATFORM_BUNDLED_LIBRARIES)
   # different.
   set(CMAKE_SKIP_BUILD_RPATH FALSE)
   list(APPEND CMAKE_BUILD_RPATH ${PLATFORM_BUNDLED_LIBRARY_DIRS})
+
+  # Environment variables to run precompiled executables that needed libraries.
+  list(JOIN PLATFORM_BUNDLED_LIBRARY_DIRS ":" _library_paths)
+  set(PLATFORM_ENV_BUILD 
"DYLD_LIBRARY_PATH=\"${_library_paths};${DYLD_LIBRARY_PATH}\"")
+  set(PLATFORM_ENV_INSTALL 
"DYLD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX_WITH_CONFIG}Blender.app/Contents/Resources/lib/;$DYLD_LIBRARY_PATH")
+  unset(_library_paths)
 endif()
 
 # Same as `CFBu

[Bf-blender-cvs] [20883841c75] master: Linux: stop using static libstdc++ for release builds

2022-12-07 Thread Brecht Van Lommel
Commit: 20883841c751e1dc28dc9b69ee20c797eeab4ca7
Author: Brecht Van Lommel
Date:   Mon Dec 5 23:28:29 2022 +0100
Branches: master
https://developer.blender.org/rB20883841c751e1dc28dc9b69ee20c797eeab4ca7

Linux: stop using static libstdc++ for release builds

This is not compatible with upcoming shared libraries usage, where we can't
let each library have their own libstdc++ and safely exchange memory.

Hopefully it is no longer required either. This is from before Blender builds
were even made on CentOS 7, and there is no obvious reason it is still needed.

Ref T99618

===

M   build_files/buildbot/config/blender_linux.cmake

===

diff --git a/build_files/buildbot/config/blender_linux.cmake 
b/build_files/buildbot/config/blender_linux.cmake
index bedeeb6a690..3f3695ed481 100644
--- a/build_files/buildbot/config/blender_linux.cmake
+++ b/build_files/buildbot/config/blender_linux.cmake
@@ -28,4 +28,4 @@ set(LIBDIR 
"${CMAKE_CURRENT_LIST_DIR}/../../../../lib/${LIBDIR_NAME}" CACHE STRI
 # Platform specific configuration, to ensure static linking against everything.
 
 # Additional linking libraries
-set(CMAKE_EXE_LINKER_FLAGS   "-lrt -static-libstdc++ -no-pie"  CACHE STRING "" 
FORCE)
+set(CMAKE_EXE_LINKER_FLAGS   "-lrt -no-pie"  CACHE STRING "" FORCE)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a79cfe64355] tmp-vfx-platform-2023: Fix missing OpenImageIO python bindings harvest on Linux/macOS

2022-12-06 Thread Brecht Van Lommel
Commit: a79cfe643552342c6d76f2b08dd5ecbb51e3f901
Author: Brecht Van Lommel
Date:   Tue Dec 6 20:49:50 2022 +0100
Branches: tmp-vfx-platform-2023
https://developer.blender.org/rBa79cfe643552342c6d76f2b08dd5ecbb51e3f901

Fix missing OpenImageIO python bindings harvest on Linux/macOS

===

M   build_files/build_environment/cmake/harvest.cmake

===

diff --git a/build_files/build_environment/cmake/harvest.cmake 
b/build_files/build_environment/cmake/harvest.cmake
index f11dc9b54a3..893042afa00 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -180,7 +180,7 @@ harvest(opencollada/include/opencollada opencollada/include 
"*.h")
 harvest(opencollada/lib/opencollada opencollada/lib "*.a")
 harvest(opencolorio/include opencolorio/include "*.h")
 harvest_rpath_lib(opencolorio/lib opencolorio/lib "*${SHAREDLIBEXT}*")
-harvest_rpath_python(opencolorio/lib/python${PYTHON_SHORT_VERSION} 
python/lib/python${PYTHON_SHORT_VERSION} "*PyOpenColorIO*")
+harvest_rpath_python(opencolorio/lib/python${PYTHON_SHORT_VERSION} 
python/lib/python${PYTHON_SHORT_VERSION} "*")
 harvest(openexr/include openexr/include "*.h")
 harvest_rpath_lib(openexr/lib openexr/lib "*${SHAREDLIBEXT}*")
 harvest_rpath_bin(openimageio/bin openimageio/bin "idiff")
@@ -188,6 +188,7 @@ harvest_rpath_bin(openimageio/bin openimageio/bin "maketx")
 harvest_rpath_bin(openimageio/bin openimageio/bin "oiiotool")
 harvest(openimageio/include openimageio/include "*")
 harvest_rpath_lib(openimageio/lib openimageio/lib "*${SHAREDLIBEXT}*")
+harvest_rpath_python(openimageio/lib/python${PYTHON_SHORT_VERSION} 
python/lib/python${PYTHON_SHORT_VERSION} "*")
 harvest(openimagedenoise/include openimagedenoise/include "*")
 harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
 harvest(embree/include embree/include "*.h")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a44a6cf4c49] tmp-vfx-platform-2023: OpenImageIO: update to 2.4.6.0

2022-12-06 Thread Brecht Van Lommel
Commit: a44a6cf4c4943a7cb47f92653fe77af45969ece3
Author: Brecht Van Lommel
Date:   Tue Dec 6 20:37:23 2022 +0100
Branches: tmp-vfx-platform-2023
https://developer.blender.org/rBa44a6cf4c4943a7cb47f92653fe77af45969ece3

OpenImageIO: update to 2.4.6.0

===

M   build_files/build_environment/cmake/versions.cmake
M   build_files/build_environment/patches/openimageio.diff

===

diff --git a/build_files/build_environment/cmake/versions.cmake 
b/build_files/build_environment/cmake/versions.cmake
index 92141239ea1..f54fcd5715f 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -165,9 +165,9 @@ set(OPENMP_URI 
https://github.com/llvm/llvm-project/releases/download/llvmorg-${
 set(OPENMP_HASH_TYPE MD5)
 set(OPENMP_FILE openmp-${OPENMP_VERSION}.src.tar.xz)
 
-set(OPENIMAGEIO_VERSION v2.3.20.0)
+set(OPENIMAGEIO_VERSION v2.4.6.0)
 set(OPENIMAGEIO_URI 
https://github.com/OpenImageIO/oiio/archive/refs/tags/${OPENIMAGEIO_VERSION}.tar.gz)
-set(OPENIMAGEIO_HASH defb1fe7c8e64bac60eb3cacaf5c3736)
+set(OPENIMAGEIO_HASH c7acc1b9a8fda04ef48f7de1feda4dae)
 set(OPENIMAGEIO_HASH_TYPE MD5)
 set(OPENIMAGEIO_FILE OpenImageIO-${OPENIMAGEIO_VERSION}.tar.gz)
 
diff --git a/build_files/build_environment/patches/openimageio.diff 
b/build_files/build_environment/patches/openimageio.diff
index d05fc1f295f..f4a4627fa03 100644
--- a/build_files/build_environment/patches/openimageio.diff
+++ b/build_files/build_environment/patches/openimageio.diff
@@ -21,16 +21,3 @@ diff -Naur orig/src/cmake/compiler.cmake 
external_openimageio/src/cmake/compiler
  endif (MSVC)
  
  if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD"
-diff -Naur orig/src/include/OpenImageIO/platform.h 
external_openimageio/src/include/OpenImageIO/platform.h
 orig/src/include/OpenImageIO/platform.h2020-05-10 21:43:52 -0600
-+++ external_openimageio/src/include/OpenImageIO/platform.h2020-05-13 
17:04:36 -0600
-@@ -41,6 +41,9 @@
- #ifndef NOMINMAX
- #define NOMINMAX
- #endif
-+#ifndef NOGDI
-+#define NOGDI
-+#endif
- #include 
- #endif
-

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7d99c51e17c] master: Cycles: enable light tree again

2022-12-06 Thread Brecht Van Lommel
Commit: 7d99c51e17c4722949a90c5992cebd203246527f
Author: Brecht Van Lommel
Date:   Tue Dec 6 17:35:12 2022 +0100
Branches: master
https://developer.blender.org/rB7d99c51e17c4722949a90c5992cebd203246527f

Cycles: enable light tree again

Bugs that caused wrong renders should be fixed now, and tests that showed minor
floating point differences on platforms were tweaked to sidestep the problem.

Ref T77889

===

M   intern/cycles/blender/addon/ui.py
M   intern/cycles/blender/sync.cpp

===

diff --git a/intern/cycles/blender/addon/ui.py 
b/intern/cycles/blender/addon/ui.py
index 28828266746..d0d66d09442 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -410,10 +410,10 @@ class 
CYCLES_RENDER_PT_sampling_lights(CyclesButtonsPanel, Panel):
 cscene = scene.cycles
 
 col = layout.column(align=True)
-#col.prop(cscene, "use_light_tree")
+col.prop(cscene, "use_light_tree")
 sub = col.row()
 sub.prop(cscene, "light_sampling_threshold", text="Light Threshold")
-#sub.active = not cscene.use_light_tree
+sub.active = not cscene.use_light_tree
 
 
 class CYCLES_RENDER_PT_subdivision(CyclesButtonsPanel, Panel):
diff --git a/intern/cycles/blender/sync.cpp b/intern/cycles/blender/sync.cpp
index 7fb5f70e590..f8be1b210b8 100644
--- a/intern/cycles/blender/sync.cpp
+++ b/intern/cycles/blender/sync.cpp
@@ -347,7 +347,7 @@ void BlenderSync::sync_integrator(BL::ViewLayer 
_view_layer, bool background)
 integrator->set_motion_blur(view_layer.use_motion_blur);
   }
 
-  bool use_light_tree = false;  // get_boolean(cscene, "use_light_tree");
+  bool use_light_tree = get_boolean(cscene, "use_light_tree");
   integrator->set_use_light_tree(use_light_tree);
   integrator->set_light_sampling_threshold(
   (use_light_tree) ? 0.0f : get_float(cscene, "light_sampling_threshold"));

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [bc9548da807] master: Merge branch 'blender-v3.4-release'

2022-12-06 Thread Brecht Van Lommel
Commit: bc9548da80737a0c36eda22f0923087971073d81
Author: Brecht Van Lommel
Date:   Tue Dec 6 18:05:08 2022 +0100
Branches: master
https://developer.blender.org/rBbc9548da80737a0c36eda22f0923087971073d81

Merge branch 'blender-v3.4-release'

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [16b6116b9dc] master: Fix Cycles light tree render errors on Windows

2022-12-06 Thread Brecht Van Lommel
Commit: 16b6116b9dc0b4acf52997c2da0bcd62789f102d
Author: Brecht Van Lommel
Date:   Tue Dec 6 16:50:26 2022 +0100
Branches: master
https://developer.blender.org/rB16b6116b9dc0b4acf52997c2da0bcd62789f102d

Fix Cycles light tree render errors on Windows

Due to mistake in popcount implementation. Thanks to Weizhen for help
figuring this out.

===

M   intern/cycles/util/math.h

===

diff --git a/intern/cycles/util/math.h b/intern/cycles/util/math.h
index 0fbe7a67a4f..078ed5d8aab 100644
--- a/intern/cycles/util/math.h
+++ b/intern/cycles/util/math.h
@@ -796,11 +796,11 @@ ccl_device float bits_to_01(uint bits)
 ccl_device_inline uint popcount(uint x)
 {
   /* TODO(Stefan): pop-count intrinsic for Windows with fallback for older 
CPUs. */
-  uint i = x & 0x;
+  uint i = x;
   i = i - ((i >> 1) & 0x);
   i = (i & 0x) + ((i >> 2) & 0x);
   i = (((i + (i >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24;
-  return i & 1;
+  return i;
 }
 #  endif
 #elif defined(__KERNEL_ONEAPI__)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [513b639df92] tmp-vfx-platform-2023: OSL: set to 1.12.7.1 instead of specific hash

2022-12-06 Thread Brecht Van Lommel
Commit: 513b639df92677fc3fe903fba61dfd08584105e7
Author: Brecht Van Lommel
Date:   Tue Dec 6 14:56:44 2022 +0100
Branches: tmp-vfx-platform-2023
https://developer.blender.org/rB513b639df92677fc3fe903fba61dfd08584105e7

OSL: set to 1.12.7.1 instead of specific hash

It's no longer required after fixes, just use latest official now.

===

M   build_files/build_environment/cmake/versions.cmake

===

diff --git a/build_files/build_environment/cmake/versions.cmake 
b/build_files/build_environment/cmake/versions.cmake
index 76744d12f6c..92141239ea1 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -198,9 +198,9 @@ set(TIFF_CPE 
"cpe:2.3:a:libtiff:libtiff:${TIFF_VERSION}:*:*:*:*:*:*:*")
 # Commit c8dd33f5a37b6a6db0b6950d24f9a7cff5ceb799 breaks rendering in Cycles 
with OptiX, so this
 # is intentionally still a commit before that and therefore 1.13.0.1. To be 
updated to a newer
 # version before landing this in master.
-set(OSL_VERSION 1a7670600c8b08c2443a78d03c8c27e9a1149140)
-set(OSL_URI 
https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/archive/${OSL_VERSION}.tar.gz)
-set(OSL_HASH 7b6d6716b05d1addb92a8f47280bf77f)
+set(OSL_VERSION 1.12.7.1)
+set(OSL_URI 
https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/archive/v${OSL_VERSION}.tar.gz)
+set(OSL_HASH 53211da86c34ba6e0344998c1a6d219c)
 set(OSL_HASH_TYPE MD5)
 set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9b9f8053ce2] tmp-vfx-platform-2023: Cleanup: whitespace

2022-12-05 Thread Brecht Van Lommel
Commit: 9b9f8053ce2ac8063d43d1131e1244cfc17b408b
Author: Brecht Van Lommel
Date:   Mon Dec 5 23:33:59 2022 +0100
Branches: tmp-vfx-platform-2023
https://developer.blender.org/rB9b9f8053ce2ac8063d43d1131e1244cfc17b408b

Cleanup: whitespace

===

M   build_files/cmake/platform/platform_apple.cmake
M   build_files/cmake/platform/platform_unix.cmake
M   intern/cycles/kernel/osl/shaders/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index a8ce4db943e..f7351f482bb 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -327,7 +327,7 @@ if(WITH_LLVM)
   if(WITH_CLANG)
 find_package(Clang)
 if(NOT CLANG_FOUND)
-   message(FATAL_ERROR "Clang not found.")
+  message(FATAL_ERROR "Clang not found.")
 endif()
   endif()
 
diff --git a/build_files/cmake/platform/platform_unix.cmake 
b/build_files/cmake/platform/platform_unix.cmake
index 03ad1308143..260fa2e58b2 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -210,7 +210,7 @@ if(WITH_SDL)
 )
 # unset(SDLMAIN_LIBRARY CACHE)
 set_and_warn_library_found("SDL" SDL_FOUND WITH_SDL)
-endif()
+  endif()
 endif()
 
 # Codecs
@@ -487,18 +487,18 @@ if(WITH_LLVM)
   set_and_warn_library_found("LLVM" LLVM_FOUND WITH_LLVM)
 
   if(LLVM_FOUND)
-  if(WITH_CLANG)
-find_package_wrapper(Clang)
+if(WITH_CLANG)
+  find_package_wrapper(Clang)
   set_and_warn_library_found("Clang" CLANG_FOUND WITH_CLANG)
-  endif()
+endif()
 
-  # Symbol conflicts with same UTF library used by OpenCollada
-  if(EXISTS ${LIBDIR})
-if(WITH_OPENCOLLADA AND (${LLVM_VERSION} VERSION_LESS "4.0.0"))
-  list(REMOVE_ITEM OPENCOLLADA_LIBRARIES ${OPENCOLLADA_UTF_LIBRARY})
+# Symbol conflicts with same UTF library used by OpenCollada
+if(EXISTS ${LIBDIR})
+  if(WITH_OPENCOLLADA AND (${LLVM_VERSION} VERSION_LESS "4.0.0"))
+list(REMOVE_ITEM OPENCOLLADA_LIBRARIES ${OPENCOLLADA_UTF_LIBRARY})
+  endif()
 endif()
   endif()
-endif()
 endif()
 
 if(WITH_OPENSUBDIV)
@@ -655,11 +655,11 @@ if(WITH_GHOST_WAYLAND)
   endif()
 
   if(_use_system_wayland)
-  pkg_check_modules(wayland-client wayland-client>=1.12)
-  pkg_check_modules(wayland-egl wayland-egl)
-  pkg_check_modules(wayland-scanner wayland-scanner)
-  pkg_check_modules(wayland-cursor wayland-cursor)
-  pkg_check_modules(wayland-protocols wayland-protocols>=1.15)
+pkg_check_modules(wayland-client wayland-client>=1.12)
+pkg_check_modules(wayland-egl wayland-egl)
+pkg_check_modules(wayland-scanner wayland-scanner)
+pkg_check_modules(wayland-cursor wayland-cursor)
+pkg_check_modules(wayland-protocols wayland-protocols>=1.15)
 pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
   else()
 # CentOS 7 packages have too old a version, a newer version exist in the
diff --git a/intern/cycles/kernel/osl/shaders/CMakeLists.txt 
b/intern/cycles/kernel/osl/shaders/CMakeLists.txt
index 0b5d11fc480..bfd203416cb 100644
--- a/intern/cycles/kernel/osl/shaders/CMakeLists.txt
+++ b/intern/cycles/kernel/osl/shaders/CMakeLists.txt
@@ -126,6 +126,7 @@ set(SRC_OSL_HEADERS
 set(SRC_OSO
 
 )
+
 # TODO, add a module to compile OSL
 foreach(_file ${SRC_OSL})
   set(_OSL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${_file})

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [e59baa8de93] tmp-vfx-platform-2023: macOS: don't stop hiding usdBlender symbols before libraries land

2022-12-05 Thread Brecht Van Lommel
Commit: e59baa8de93925b0f166e59883253c1aeb1bd5d9
Author: Brecht Van Lommel
Date:   Mon Dec 5 23:34:33 2022 +0100
Branches: tmp-vfx-platform-2023
https://developer.blender.org/rBe59baa8de93925b0f166e59883253c1aeb1bd5d9

macOS: don't stop hiding usdBlender symbols before libraries land

===

M   source/creator/symbols_apple.map

===

diff --git a/source/creator/symbols_apple.map b/source/creator/symbols_apple.map
index 7514921f839..5619f151bd2 100644
--- a/source/creator/symbols_apple.map
+++ b/source/creator/symbols_apple.map
@@ -59,6 +59,7 @@ png_*
 *textFileFormatYy*
 *TIFF*
 *tinyformat*
+*usdBlender*
 vorbis*
 vp8*
 vp9*

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7d1be8f6bb1] tmp-vfx-platform-2023: Build: fully disable MaterialX, auto clear OpenColorIO variables also

2022-12-05 Thread Brecht Van Lommel
Commit: 7d1be8f6bb134ab7d744b6b979352b6f6cf5752e
Author: Brecht Van Lommel
Date:   Mon Dec 5 22:10:16 2022 +0100
Branches: tmp-vfx-platform-2023
https://developer.blender.org/rB7d1be8f6bb134ab7d744b6b979352b6f6cf5752e

Build: fully disable MaterialX, auto clear OpenColorIO variables also

===

M   build_files/cmake/config/blender_full.cmake
M   build_files/cmake/config/blender_release.cmake
M   build_files/cmake/platform/platform_old_libs_update.cmake

===

diff --git a/build_files/cmake/config/blender_full.cmake 
b/build_files/cmake/config/blender_full.cmake
index 4602962d1cd..b44250b011b 100644
--- a/build_files/cmake/config/blender_full.cmake
+++ b/build_files/cmake/config/blender_full.cmake
@@ -58,7 +58,7 @@ set(WITH_QUADRIFLOW  ON  CACHE BOOL "" FORCE)
 set(WITH_SDL ON  CACHE BOOL "" FORCE)
 set(WITH_TBB ON  CACHE BOOL "" FORCE)
 set(WITH_USD ON  CACHE BOOL "" FORCE)
-set(WITH_MATERIALX   ON  CACHE BOOL "" FORCE)
+set(WITH_MATERIALX   OFF CACHE BOOL "" FORCE)
 
 set(WITH_MEM_JEMALLOCON  CACHE BOOL "" FORCE)
 
diff --git a/build_files/cmake/config/blender_release.cmake 
b/build_files/cmake/config/blender_release.cmake
index dc2fad3ad2d..08cb882ebfb 100644
--- a/build_files/cmake/config/blender_release.cmake
+++ b/build_files/cmake/config/blender_release.cmake
@@ -59,7 +59,7 @@ set(WITH_QUADRIFLOW  ON  CACHE BOOL "" FORCE)
 set(WITH_SDL ON  CACHE BOOL "" FORCE)
 set(WITH_TBB ON  CACHE BOOL "" FORCE)
 set(WITH_USD ON  CACHE BOOL "" FORCE)
-set(WITH_MATERIALX   ON  CACHE BOOL "" FORCE)
+set(WITH_MATERIALX   OFF CACHE BOOL "" FORCE)
 
 set(WITH_MEM_JEMALLOC  ON  CACHE BOOL "" FORCE)
 
diff --git a/build_files/cmake/platform/platform_old_libs_update.cmake 
b/build_files/cmake/platform/platform_old_libs_update.cmake
index 77dc61c77b4..1e98ea7a4ff 100644
--- a/build_files/cmake/platform/platform_old_libs_update.cmake
+++ b/build_files/cmake/platform/platform_old_libs_update.cmake
@@ -53,6 +53,7 @@ if(UNIX AND
   message(STATUS "Auto updating CMake configuration for Blender 3.4 libraries")
   unset_cache_variables("^BLOSC")
   unset_cache_variables("^BOOST")
+  unset_cache_variables("^OPENCOLORIO")
   unset_cache_variables("^OPENEXR")
   unset_cache_variables("^OPENIMAGEIO")
   unset_cache_variables("^OPENSUBDIV")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [3ae85e05597] tmp-vfx-platform-2023: Build: don't enable MaterialX yet, only after libraries land for all platforms

2022-12-05 Thread Brecht Van Lommel
Commit: 3ae85e0559766da7d92a224507c23933751bb0ed
Author: Brecht Van Lommel
Date:   Mon Dec 5 22:04:07 2022 +0100
Branches: tmp-vfx-platform-2023
https://developer.blender.org/rB3ae85e0559766da7d92a224507c23933751bb0ed

Build: don't enable MaterialX yet, only after libraries land for all platforms

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6b83df6c907..4de2454cfd8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -331,7 +331,7 @@ option(WITH_ALEMBIC "Enable Alembic Support" ON)
 option(WITH_USD "Enable Universal Scene Description (USD) 
Support" ON)
 
 # MaterialX
-option(WITH_MATERIALX   "Enable MaterialX Support" ON)
+option(WITH_MATERIALX   "Enable MaterialX Support" OFF)
 
 # 3D format support
 # Disable opencollada when we don't have precompiled libs

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [6fec2c4ff43] tmp-vfx-platform-2023: Merge branch 'master' into tmp-vfx-platform-2023

2022-12-05 Thread Brecht Van Lommel
Commit: 6fec2c4ff4303f13839175975591d94435127245
Author: Brecht Van Lommel
Date:   Mon Dec 5 22:06:08 2022 +0100
Branches: tmp-vfx-platform-2023
https://developer.blender.org/rB6fec2c4ff4303f13839175975591d94435127245

Merge branch 'master' into tmp-vfx-platform-2023

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0808eaf44e8] master: Cycles: temporarily disable light tree again due to platform differences

2022-12-05 Thread Brecht Van Lommel
Commit: 0808eaf44e8130a902e31178848c74e4a47fb677
Author: Brecht Van Lommel
Date:   Mon Dec 5 21:40:49 2022 +0100
Branches: master
https://developer.blender.org/rB0808eaf44e8130a902e31178848c74e4a47fb677

Cycles: temporarily disable light tree again due to platform differences

Regression tests are failing with some platform/compiler combinations, and
fixing this is taking some time.

Ref T77889

===

M   intern/cycles/blender/addon/ui.py
M   intern/cycles/blender/sync.cpp

===

diff --git a/intern/cycles/blender/addon/ui.py 
b/intern/cycles/blender/addon/ui.py
index d0d66d09442..28828266746 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -410,10 +410,10 @@ class 
CYCLES_RENDER_PT_sampling_lights(CyclesButtonsPanel, Panel):
 cscene = scene.cycles
 
 col = layout.column(align=True)
-col.prop(cscene, "use_light_tree")
+#col.prop(cscene, "use_light_tree")
 sub = col.row()
 sub.prop(cscene, "light_sampling_threshold", text="Light Threshold")
-sub.active = not cscene.use_light_tree
+#sub.active = not cscene.use_light_tree
 
 
 class CYCLES_RENDER_PT_subdivision(CyclesButtonsPanel, Panel):
diff --git a/intern/cycles/blender/sync.cpp b/intern/cycles/blender/sync.cpp
index f8be1b210b8..7fb5f70e590 100644
--- a/intern/cycles/blender/sync.cpp
+++ b/intern/cycles/blender/sync.cpp
@@ -347,7 +347,7 @@ void BlenderSync::sync_integrator(BL::ViewLayer 
_view_layer, bool background)
 integrator->set_motion_blur(view_layer.use_motion_blur);
   }
 
-  bool use_light_tree = get_boolean(cscene, "use_light_tree");
+  bool use_light_tree = false;  // get_boolean(cscene, "use_light_tree");
   integrator->set_use_light_tree(use_light_tree);
   integrator->set_light_sampling_threshold(
   (use_light_tree) ? 0.0f : get_float(cscene, "light_sampling_threshold"));

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9f662b383b1] tmp-vfx-platform-2023: Build: make OpenColorIO dynamic library and enable Python bindings

2022-12-05 Thread Brecht Van Lommel
Commit: 9f662b383b18214bf45a7f683ccf1a3ceb2432aa
Author: Brecht Van Lommel
Date:   Mon Dec 5 17:21:47 2022 +0100
Branches: tmp-vfx-platform-2023
https://developer.blender.org/rB9f662b383b18214bf45a7f683ccf1a3ceb2432aa

Build: make OpenColorIO dynamic library and enable Python bindings

And fix some missing python/pybind11 dependencies.

Needs more work for Windows.

===

M   build_files/build_environment/cmake/epoxy.cmake
M   build_files/build_environment/cmake/harvest.cmake
M   build_files/build_environment/cmake/materialx.cmake
M   build_files/build_environment/cmake/opencolorio.cmake
M   build_files/build_environment/cmake/openimageio.cmake
M   build_files/build_environment/cmake/pybind11.cmake
M   build_files/cmake/platform/platform_apple.cmake
M   build_files/cmake/platform/platform_unix.cmake

===

diff --git a/build_files/build_environment/cmake/epoxy.cmake 
b/build_files/build_environment/cmake/epoxy.cmake
index fe674135842..312784598d4 100644
--- a/build_files/build_environment/cmake/epoxy.cmake
+++ b/build_files/build_environment/cmake/epoxy.cmake
@@ -23,3 +23,8 @@ if(BUILD_MODE STREQUAL Release AND WIN32)
 DEPENDEES install
   )
 endif()
+
+add_dependencies(
+  external_epoxy
+  external_python_site_packages
+)
diff --git a/build_files/build_environment/cmake/harvest.cmake 
b/build_files/build_environment/cmake/harvest.cmake
index 8b2a3a77ca7..f11dc9b54a3 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -179,9 +179,8 @@ endif()
 harvest(opencollada/include/opencollada opencollada/include "*.h")
 harvest(opencollada/lib/opencollada opencollada/lib "*.a")
 harvest(opencolorio/include opencolorio/include "*.h")
-harvest(opencolorio/lib opencolorio/lib "*.a")
-harvest(opencolorio/lib/static opencolorio/lib "*.a")
-harvest(minizipng/lib opencolorio/lib "*.a")
+harvest_rpath_lib(opencolorio/lib opencolorio/lib "*${SHAREDLIBEXT}*")
+harvest_rpath_python(opencolorio/lib/python${PYTHON_SHORT_VERSION} 
python/lib/python${PYTHON_SHORT_VERSION} "*PyOpenColorIO*")
 harvest(openexr/include openexr/include "*.h")
 harvest_rpath_lib(openexr/lib openexr/lib "*${SHAREDLIBEXT}*")
 harvest_rpath_bin(openimageio/bin openimageio/bin "idiff")
diff --git a/build_files/build_environment/cmake/materialx.cmake 
b/build_files/build_environment/cmake/materialx.cmake
index 37913c74d6a..cb45f444e59 100644
--- a/build_files/build_environment/cmake/materialx.cmake
+++ b/build_files/build_environment/cmake/materialx.cmake
@@ -8,6 +8,8 @@ set(MATERIALX_EXTRA_ARGS
   -DMATERIALX_PYTHON_VERSION=${PYTHON_SHORT_VERSION}
   -DMATERIALX_BUILD_SHARED_LIBS=ON
   -DCMAKE_DEBUG_POSTFIX=_d
+  -Dpybind11_ROOT=${LIBDIR}/pybind11
+  -DPython_EXECUTABLE=${PYTHON_BINARY}
 )
 
 ExternalProject_Add(external_materialx
@@ -47,3 +49,9 @@ if(WIN32)
   unset(MATERIALX_PYTHON_TARGET)
   unset(MATERIALX_PYTHON_TARGET_DOS)
 endif()
+
+add_dependencies(
+  external_materialx
+  external_python
+  external_pybind11
+)
diff --git a/build_files/build_environment/cmake/opencolorio.cmake 
b/build_files/build_environment/cmake/opencolorio.cmake
index 79d1ffa9c2e..fbf1a9f6354 100644
--- a/build_files/build_environment/cmake/opencolorio.cmake
+++ b/build_files/build_environment/cmake/opencolorio.cmake
@@ -2,10 +2,10 @@
 
 set(OPENCOLORIO_EXTRA_ARGS
   -DOCIO_BUILD_APPS=OFF
-  -DOCIO_BUILD_PYTHON=OFF
+  -DOCIO_BUILD_PYTHON=ON
   -DOCIO_BUILD_NUKE=OFF
   -DOCIO_BUILD_JAVA=OFF
-  -DBUILD_SHARED_LIBS=OFF
+  -DBUILD_SHARED_LIBS=ON
   -DOCIO_BUILD_DOCS=OFF
   -DOCIO_BUILD_TESTS=OFF
   -DOCIO_BUILD_GPU_TESTS=OFF
@@ -23,8 +23,22 @@ set(OPENCOLORIO_EXTRA_ARGS
   -Dminizip-ng_LIBRARY=${LIBDIR}/minizipng/lib/libminizip${LIBEXT}
   -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
   -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
+  -DPython_EXECUTABLE=${PYTHON_BINARY}
+  -Dpybind11_ROOT=${LIBDIR}/pybind11
 )
 
+if(APPLE)
+  set(OPENCOLORIO_EXTRA_ARGS
+${OPENCOLORIO_EXTRA_ARGS}
+"-DCMAKE_SHARED_LINKER_FLAGS=-liconv 
${LIBDIR}/bzip2/lib/${LIBPREFIX}bz2${LIBEXT}"
+  )
+elseif(UNIX)
+  set(OPENCOLORIO_EXTRA_ARGS
+${OPENCOLORIO_EXTRA_ARGS}
+"-DCMAKE_SHARED_LINKER_FLAGS=${LIBDIR}/bzip2/lib/${LIBPREFIX}bz2${LIBEXT}"
+  )
+endif()
+
 if(BLENDER_PLATFORM_ARM)
   set(OPENCOLORIO_EXTRA_ARGS
 ${OPENCOLORIO_EXTRA_ARGS}
@@ -64,6 +78,8 @@ add_dependencies(
   external_pystring
   external_zlib
   external_minizipng
+  external_python
+  external_pybind11
 )
 
 if(WIN32)
diff --git a/build_files/build_environment/cmake/openimageio.cmake 
b/build_files/build_environment/cmake/openimageio.cmake
index 329d525e60e..d65fbe8223e 100644
--- a/build_files/build_environment/cmake/openimageio.cmake
+++ b/bui

[Bf-blender-cvs] [5270610b29e] master: Fix Cycles uninitialized variables in mesh light sampling

2022-12-05 Thread Brecht Van Lommel
Commit: 5270610b29ee3c548d19a310777d569582f2abfc
Author: Brecht Van Lommel
Date:   Mon Dec 5 20:16:10 2022 +0100
Branches: master
https://developer.blender.org/rB5270610b29ee3c548d19a310777d569582f2abfc

Fix Cycles uninitialized variables in mesh light sampling

Causing wrong renders and differences between platforms.

===

M   intern/cycles/kernel/light/area.h
M   intern/cycles/kernel/light/triangle.h
M   intern/cycles/scene/light.cpp
M   intern/cycles/scene/light_tree.cpp

===

diff --git a/intern/cycles/kernel/light/area.h 
b/intern/cycles/kernel/light/area.h
index 6d2d6ace344..98c354ec34b 100644
--- a/intern/cycles/kernel/light/area.h
+++ b/intern/cycles/kernel/light/area.h
@@ -361,6 +361,8 @@ ccl_device_forceinline bool 
area_light_tree_parameters(const ccl_global KernelLi
 distance = make_float2(min_distance, min_distance);
   }
 
+  cos_theta_u = FLT_MAX;
+
   const float3 extentu = klight->area.axis_u * klight->area.len_u;
   const float3 extentv = klight->area.axis_v * klight->area.len_v;
   for (int i = 0; i < 4; i++) {
diff --git a/intern/cycles/kernel/light/triangle.h 
b/intern/cycles/kernel/light/triangle.h
index eaad584acc7..1a5e8e9e62c 100644
--- a/intern/cycles/kernel/light/triangle.h
+++ b/intern/cycles/kernel/light/triangle.h
@@ -302,6 +302,8 @@ ccl_device_forceinline bool triangle_light_tree_parameters(
 distance = make_float2(min_distance, min_distance);
   }
 
+  cos_theta_u = FLT_MAX;
+
   const int object = kemitter->mesh_light.object_id;
   float3 vertices[3];
   triangle_world_space_vertices(kg, object, kemitter->prim_id, -1.0f, 
vertices);
diff --git a/intern/cycles/scene/light.cpp b/intern/cycles/scene/light.cpp
index 2421a66d2b8..73ee1141be7 100644
--- a/intern/cycles/scene/light.cpp
+++ b/intern/cycles/scene/light.cpp
@@ -456,7 +456,7 @@ void LightManager::device_update_distribution(Device *,
   dscene->light_distribution.copy_to_device();
 }
 
-void LightManager::device_update_tree(Device *device,
+void LightManager::device_update_tree(Device *,
   DeviceScene *dscene,
   Scene *scene,
   Progress )
diff --git a/intern/cycles/scene/light_tree.cpp 
b/intern/cycles/scene/light_tree.cpp
index 121b5593bde..9bf4bdca097 100644
--- a/intern/cycles/scene/light_tree.cpp
+++ b/intern/cycles/scene/light_tree.cpp
@@ -88,7 +88,7 @@ LightTreePrimitive::LightTreePrimitive(Scene *scene, int 
prim_id, int object_id)
 
 /* TODO: need a better way to handle this when textures are used. */
 float area = triangle_area(vertices[0], vertices[1], vertices[2]);
-energy = area * 
scene->shader_manager->linear_rgb_to_gray(shader->emission_estimate);
+energy = area * average(shader->emission_estimate);
 
 /* NOTE: the original implementation used the bounding box centroid, but 
primitive centroid
  * seems to work fine */
@@ -181,7 +181,7 @@ LightTreePrimitive::LightTreePrimitive(Scene *scene, int 
prim_id, int object_id)
   strength *= lamp->get_shader()->emission_estimate;
 }
 
-energy = scene->shader_manager->linear_rgb_to_gray(strength);
+energy = average(strength);
   }
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0731d78d009] master: Cycles: remove shadow pass

2022-12-05 Thread Brecht Van Lommel
Commit: 0731d78d0096939ad61b0c81cba888f5a1f98001
Author: Brecht Van Lommel
Date:   Thu Dec 1 22:42:50 2022 +0100
Branches: master
https://developer.blender.org/rB0731d78d0096939ad61b0c81cba888f5a1f98001

Cycles: remove shadow pass

This was not working well in non-trivial scenes before the light tree, and now
it is even harder to make it work well with the light tree. It would average the
with equal weight for every light object regardless of intensity or distance, 
and
be quite noisy due to not working with multiple importance sampling.

We may restore this if were enough good use cases for the previous 
implementation,
but let's wait and see what the feedback is.

Some uses cases for this have been replaced by the shadow catcher passes, which
did not exist when this was added.

Ref T77889

===

M   intern/cycles/blender/addon/engine.py
M   intern/cycles/blender/addon/properties.py
M   intern/cycles/blender/addon/ui.py
M   intern/cycles/blender/session.cpp
M   intern/cycles/blender/sync.cpp
M   intern/cycles/kernel/data_template.h
M   intern/cycles/kernel/film/light_passes.h
M   intern/cycles/kernel/integrator/shade_surface.h
M   intern/cycles/kernel/integrator/shade_volume.h
M   intern/cycles/kernel/integrator/shadow_state_template.h
M   intern/cycles/kernel/types.h
M   intern/cycles/scene/film.cpp
M   intern/cycles/scene/light.cpp
M   intern/cycles/scene/pass.cpp

===

diff --git a/intern/cycles/blender/addon/engine.py 
b/intern/cycles/blender/addon/engine.py
index 4ac078ed8a5..5aa17216aa6 100644
--- a/intern/cycles/blender/addon/engine.py
+++ b/intern/cycles/blender/addon/engine.py
@@ -204,7 +204,6 @@ def list_render_passes(scene, srl):
 if crl.use_pass_volume_indirect:   yield ("VolumeInd", "RGB",  
'COLOR')
 if srl.use_pass_emit:  yield ("Emit",  "RGB",  
'COLOR')
 if srl.use_pass_environment:   yield ("Env",   "RGB",  
'COLOR')
-if srl.use_pass_shadow:yield ("Shadow","RGB",  
'COLOR')
 if srl.use_pass_ambient_occlusion: yield ("AO","RGB",  
'COLOR')
 if crl.use_pass_shadow_catcher:yield ("Shadow Catcher",  
"RGB",  'COLOR')
 # autopep8: on
diff --git a/intern/cycles/blender/addon/properties.py 
b/intern/cycles/blender/addon/properties.py
index 2a04a7a4b5f..3f3fae32f40 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -170,7 +170,6 @@ enum_view3d_shading_render_pass = (
 ('EMISSION', "Emission", "Show the Emission render pass"),
 ('BACKGROUND', "Background", "Show the Background render pass"),
 ('AO', "Ambient Occlusion", "Show the Ambient Occlusion render pass"),
-('SHADOW', "Shadow", "Show the Shadow render pass"),
 ('SHADOW_CATCHER', "Shadow Catcher", "Show the Shadow Catcher render 
pass"),
 
 ('', "Light", ""),
diff --git a/intern/cycles/blender/addon/ui.py 
b/intern/cycles/blender/addon/ui.py
index 959b945461e..4f5edd469be 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -954,7 +954,6 @@ class CYCLES_RENDER_PT_passes_light(CyclesButtonsPanel, 
Panel):
 col = layout.column(heading="Other", align=True)
 col.prop(view_layer, "use_pass_emit", text="Emission")
 col.prop(view_layer, "use_pass_environment")
-col.prop(view_layer, "use_pass_shadow")
 col.prop(view_layer, "use_pass_ambient_occlusion", text="Ambient 
Occlusion")
 col.prop(cycles_view_layer, "use_pass_shadow_catcher")
 
diff --git a/intern/cycles/blender/session.cpp 
b/intern/cycles/blender/session.cpp
index 6641e2b8ac5..7dfacec8fc9 100644
--- a/intern/cycles/blender/session.cpp
+++ b/intern/cycles/blender/session.cpp
@@ -559,11 +559,6 @@ static bool bake_setup_pass(Scene *scene, const string 
_type_str, const int
  0);
 integrator->set_use_emission((bake_filter & 
BL::BakeSettings::pass_filter_EMIT) != 0);
   }
-  /* Shadow pass. */
-  else if (strcmp(bake_type, "SHADOW") == 0) {
-type = PASS_SHADOW;
-use_direct_light = true;
-  }
   /* Light component passes. */
   else if (strcmp(bake_type, "DIFFUSE") == 0) {
 if ((bake_filter & BL::BakeSettings::pass_filter_DIRECT) &&
diff --git a/intern/cycles/blender/sync.cpp b/intern/cycles/blender/sync.cpp
index d3598fd19b9..a085202200f 100644
--- a/intern/cycles/blender/sync.cpp
+++ b/intern/cycles/blender

[Bf-blender-cvs] [a3c45bc3136] soc-2022-many-lights-sampling: Cycles: disable light tree on HIP due to internal compiler errors

2022-12-02 Thread Brecht Van Lommel
Commit: a3c45bc31364fed8f1a16da01c92c04bc19ee097
Author: Brecht Van Lommel
Date:   Fri Dec 2 16:17:54 2022 +0100
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rBa3c45bc31364fed8f1a16da01c92c04bc19ee097

Cycles: disable light tree on HIP due to internal compiler errors

To avoid this blocking the merge to master, but still plan to fix this for
the 3.5 release.

===

M   intern/cycles/device/device.cpp
M   intern/cycles/device/device.h
M   intern/cycles/device/hip/device.cpp
M   intern/cycles/kernel/light/sample.h
M   intern/cycles/kernel/types.h
M   intern/cycles/scene/light.cpp

===

diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp
index 6aef5458246..ff7e46d48ab 100644
--- a/intern/cycles/device/device.cpp
+++ b/intern/cycles/device/device.cpp
@@ -351,6 +351,7 @@ DeviceInfo Device::get_multi_device(const 
vector ,
   info.num = 0;
 
   info.has_nanovdb = true;
+  info.has_light_tree = true;
   info.has_osl = true;
   info.has_guiding = true;
   info.has_profiling = true;
@@ -399,6 +400,7 @@ DeviceInfo Device::get_multi_device(const 
vector ,
 
 /* Accumulate device info. */
 info.has_nanovdb &= device.has_nanovdb;
+info.has_light_tree &= device.has_light_tree;
 info.has_osl &= device.has_osl;
 info.has_guiding &= device.has_guiding;
 info.has_profiling &= device.has_profiling;
diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h
index 11d693cb25b..b9308dc8949 100644
--- a/intern/cycles/device/device.h
+++ b/intern/cycles/device/device.h
@@ -65,6 +65,7 @@ class DeviceInfo {
   int num;
   bool display_device;/* GPU is used as a display device. */
   bool has_nanovdb;   /* Support NanoVDB volumes. */
+  bool has_light_tree;/* Support light tree. */
   bool has_osl;   /* Support Open Shading Language. */
   bool has_guiding;   /* Support path guiding. */
   bool has_profiling; /* Supports runtime collection of profiling 
info. */
@@ -84,6 +85,7 @@ class DeviceInfo {
 cpu_threads = 0;
 display_device = false;
 has_nanovdb = false;
+has_light_tree = true;
 has_osl = false;
 has_guiding = false;
 has_profiling = false;
diff --git a/intern/cycles/device/hip/device.cpp 
b/intern/cycles/device/hip/device.cpp
index 3c9c73e7db0..518239f9877 100644
--- a/intern/cycles/device/hip/device.cpp
+++ b/intern/cycles/device/hip/device.cpp
@@ -137,6 +137,7 @@ void device_hip_info(vector )
 info.num = num;
 
 info.has_nanovdb = true;
+info.has_light_tree = false;
 info.denoisers = 0;
 
 info.has_gpu_queue = true;
diff --git a/intern/cycles/kernel/light/sample.h 
b/intern/cycles/kernel/light/sample.h
index 9297746ce35..39bf3a59949 100644
--- a/intern/cycles/kernel/light/sample.h
+++ b/intern/cycles/kernel/light/sample.h
@@ -337,6 +337,7 @@ ccl_device_inline bool 
light_sample_from_volume_segment(KernelGlobals kg,
   int emitter_shader_flag = 0;
   float emitter_pdf_selection = 0.0f;
 
+#ifdef __LIGHT_TREE__
   if (kernel_data.integrator.use_light_tree) {
 if (!light_tree_sample(kg,
  randu,
@@ -355,7 +356,9 @@ ccl_device_inline bool 
light_sample_from_volume_segment(KernelGlobals kg,
   return false;
 }
   }
-  else {
+  else
+#endif
+  {
 if (!light_distribution_sample(kg,
randu,
randv,
@@ -425,6 +428,7 @@ ccl_device bool light_sample_from_position(KernelGlobals kg,
   int emitter_shader_flag = 0;
   float emitter_pdf_selection = 0.0f;
 
+#ifdef __LIGHT_TREE__
   if (kernel_data.integrator.use_light_tree) {
 if (!light_tree_sample(kg,
   randu,
@@ -443,7 +447,9 @@ ccl_device bool light_sample_from_position(KernelGlobals kg,
   return false;
 }
   }
-  else {
+  else
+#endif
+  {
 if (!light_distribution_sample(kg,
randu,
randv,
@@ -509,10 +515,13 @@ ccl_device_inline bool 
light_sample_new_position(KernelGlobals kg,
   return false;
 }
 
+#ifdef __LIGHT_TREE__
 if (kernel_data.integrator.use_light_tree) {
   ls->pdf *= ls->pdf_selection;
 }
-else {
+else
+#endif
+{
   /* Handled in triangle_light_sample for effeciency. */
 }
 return true;
@@ -558,6 +567,7 @@ ccl_device_inline float 
light_sample_mis_weight_forward_surface(KernelGlobals kg
   float pdf = triangle_light_pdf(kg, sd, t);
 
   /* Light selection pdf. */
+#ifdef __LIGHT_TREE__
   if (kernel_data.integrator.use_light_tree) {
 float3 ray_P = INTEGRATOR_STATE(state, ray, P);
 const float3 N = INTEGRATOR_STATE(state, path, mis_origin_n);
@@ -565,7 +575,9 @@ ccl_device_inline float 
light_sample_mis_weight_forwar

[Bf-blender-cvs] [d55e3733e8a] soc-2022-many-lights-sampling: Cleanup: remove unused shadow pass code

2022-12-02 Thread Brecht Van Lommel
Commit: d55e3733e8a64529edf9c9e2648d71e00571d1dd
Author: Brecht Van Lommel
Date:   Fri Dec 2 15:29:21 2022 +0100
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rBd55e3733e8a64529edf9c9e2648d71e00571d1dd

Cleanup: remove unused shadow pass code

===

M   intern/cycles/kernel/data_template.h
M   intern/cycles/scene/light.cpp

===

diff --git a/intern/cycles/kernel/data_template.h 
b/intern/cycles/kernel/data_template.h
index 5f420b3579d..06df7fe1e62 100644
--- a/intern/cycles/kernel/data_template.h
+++ b/intern/cycles/kernel/data_template.h
@@ -97,7 +97,6 @@ KERNEL_STRUCT_MEMBER(film, int, pass_emission)
 KERNEL_STRUCT_MEMBER(film, int, pass_background)
 KERNEL_STRUCT_MEMBER(film, int, pass_ao)
 KERNEL_STRUCT_MEMBER(film, float, pass_alpha_threshold)
-KERNEL_STRUCT_MEMBER(film, float, pass_shadow_scale)
 KERNEL_STRUCT_MEMBER(film, int, pass_shadow_catcher)
 KERNEL_STRUCT_MEMBER(film, int, pass_shadow_catcher_sample_count)
 KERNEL_STRUCT_MEMBER(film, int, pass_shadow_catcher_matte)
@@ -131,10 +130,6 @@ KERNEL_STRUCT_MEMBER(film, int, 
use_approximate_shadow_catcher)
 KERNEL_STRUCT_MEMBER(film, int, pass_guiding_color)
 KERNEL_STRUCT_MEMBER(film, int, pass_guiding_probability)
 KERNEL_STRUCT_MEMBER(film, int, pass_guiding_avg_roughness)
-/* Padding. */
-KERNEL_STRUCT_MEMBER(film, int, pad1)
-KERNEL_STRUCT_MEMBER(film, int, pad2)
-KERNEL_STRUCT_MEMBER(film, int, pad3)
 KERNEL_STRUCT_END(KernelFilm)
 
 /* Integrator. */
diff --git a/intern/cycles/scene/light.cpp b/intern/cycles/scene/light.cpp
index b78863e3f6e..b18cd63a0ee 100644
--- a/intern/cycles/scene/light.cpp
+++ b/intern/cycles/scene/light.cpp
@@ -266,13 +266,12 @@ bool LightManager::object_usable_as_light(Object *object)
   return false;
 }
 
-void LightManager::device_update_distribution(Device *device,
+void LightManager::device_update_distribution(Device *,
   DeviceScene *dscene,
   Scene *scene,
   Progress )
 {
   KernelIntegrator *kintegrator = >data.integrator;
-  KernelFilm *kfilm = >data.film;
 
   /* Update CDF over lights. */
   progress.set_status("Updating Lights", "Computing distribution");
@@ -305,7 +304,6 @@ void LightManager::device_update_distribution(Device 
*device,
   }
 
   const size_t num_lights = kintegrator->num_lights;
-  const size_t num_background_lights = kintegrator->num_background_lights;
   const size_t num_distribution = num_triangles + num_lights;
 
   /* Distribution size. */
@@ -454,18 +452,6 @@ void LightManager::device_update_distribution(Device 
*device,
 }
   }
 
-  /* bit of an ugly hack to compensate for emitting triangles influencing
-   * amount of samples we get for this pass */
-  kfilm->pass_shadow_scale = 1.0f;
-
-  if (kintegrator->distribution_pdf_triangles != 0.0f) {
-kfilm->pass_shadow_scale /= 0.5f;
-  }
-
-  if (num_background_lights < num_lights) {
-kfilm->pass_shadow_scale /= (float)(num_lights - num_background_lights) / 
(float)num_lights;
-  }
-
   /* Copy distribution to device. */
   dscene->light_distribution.copy_to_device();
 }
@@ -476,7 +462,6 @@ void LightManager::device_update_tree(Device *device,
   Progress )
 {
   KernelIntegrator *kintegrator = >data.integrator;
-  KernelFilm *kfilm = >data.film;
 
   if (!kintegrator->use_light_tree) {
 dscene->light_tree_nodes.free();
@@ -556,9 +541,6 @@ void LightManager::device_update_tree(Device *device,
   /* Update integrator state. */
   kintegrator->use_direct_light = !light_prims.empty();
 
-  /* TODO: this shadow scale mechanism does not work for light tree. */
-  kfilm->pass_shadow_scale = 1.0f;
-
   /* TODO: For now, we'll start with a smaller number of max lights in a node.
* More benchmarking is needed to determine what number works best. */
   LightTree light_tree(light_prims, kintegrator->num_distant_lights, 8);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [60ecf2ee0ec] soc-2022-many-lights-sampling: Merge branch 'master' into soc-2022-many-lights-sampling

2022-12-02 Thread Brecht Van Lommel
Commit: 60ecf2ee0ecab1057ffe687508baa83531252fa3
Author: Brecht Van Lommel
Date:   Fri Dec 2 18:27:47 2022 +0100
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rB60ecf2ee0ecab1057ffe687508baa83531252fa3

Merge branch 'master' into soc-2022-many-lights-sampling

===



===

diff --cc intern/cycles/kernel/light/area.h
index 2108073c199,db8faf6ec10..16d2e2c7d3a
--- a/intern/cycles/kernel/light/area.h
+++ b/intern/cycles/kernel/light/area.h
@@@ -321,44 -342,4 +342,44 @@@ ccl_device_inline bool area_light_sampl
  
return true;
  }
 +
 +template
 +ccl_device_forceinline bool area_light_tree_parameters(const ccl_global 
KernelLight *klight,
 +   const float3 centroid,
 +   const float3 P,
 +   const float3 N,
 +   const float3 
bcone_axis,
 +   ccl_private float 
_theta_u,
 +   ccl_private float2 
,
 +   ccl_private float3 
_to_centroid)
 +{
 +  if (!in_volume_segment) {
 +/* TODO: a cheap substitute for minimal distance between point and 
primitive. Does it
 + * worth the overhead to compute the accurate minimal distance? */
 +float min_distance;
 +point_to_centroid = safe_normalize_len(centroid - P, _distance);
 +distance = make_float2(min_distance, min_distance);
 +  }
 +
-   const float3 extentu = klight->area.extentu;
-   const float3 extentv = klight->area.extentv;
++  const float3 extentu = klight->area.axis_u * klight->area.len_u;
++  const float3 extentv = klight->area.axis_v * klight->area.len_v;
 +  for (int i = 0; i < 4; i++) {
 +const float3 corner = ((i & 1) - 0.5f) * extentu + 0.5f * ((i & 2) - 1) * 
extentv + centroid;
 +float distance_point_to_corner;
 +const float3 point_to_corner = safe_normalize_len(corner - P, 
_point_to_corner);
 +cos_theta_u = fminf(cos_theta_u, dot(point_to_centroid, point_to_corner));
 +if (!in_volume_segment) {
 +  distance.x = fmaxf(distance.x, distance_point_to_corner);
 +}
 +  }
 +
 +  const bool front_facing = dot(bcone_axis, point_to_centroid) < 0;
 +  const bool shape_above_surface = dot(N, centroid - P) + fabsf(dot(N, 
extentu)) +
 +   fabsf(dot(N, extentv)) >
 +   0;
 +  const bool in_volume = is_zero(N);
 +
 +  return (front_facing && shape_above_surface) || in_volume;
 +}
 +
  CCL_NAMESPACE_END

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [59052c3759f] soc-2022-many-lights-sampling: Merge branch 'master' into soc-2022-many-lights-sampling

2022-12-02 Thread Brecht Van Lommel
Commit: 59052c3759ff79b208a2ca890eb036a152e2466c
Author: Brecht Van Lommel
Date:   Fri Dec 2 18:59:45 2022 +0100
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rB59052c3759ff79b208a2ca890eb036a152e2466c

Merge branch 'master' into soc-2022-many-lights-sampling

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [948f13a8e70] master: Cleanup: compiler warning

2022-12-02 Thread Brecht Van Lommel
Commit: 948f13a8e70d7f26b8178dd0b153963c8cc6485d
Author: Brecht Van Lommel
Date:   Fri Dec 2 19:08:56 2022 +0100
Branches: master
https://developer.blender.org/rB948f13a8e70d7f26b8178dd0b153963c8cc6485d

Cleanup: compiler warning

===

M   intern/cycles/scene/light.cpp

===

diff --git a/intern/cycles/scene/light.cpp b/intern/cycles/scene/light.cpp
index 4907810c117..804f6bb7bd1 100644
--- a/intern/cycles/scene/light.cpp
+++ b/intern/cycles/scene/light.cpp
@@ -265,7 +265,7 @@ bool LightManager::object_usable_as_light(Object *object)
   return false;
 }
 
-void LightManager::device_update_distribution(Device *device,
+void LightManager::device_update_distribution(Device *,
   DeviceScene *dscene,
   Scene *scene,
   Progress )

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [2a33875065a] master: Fix link error after recent changes to use span for iterating over nodes

2022-12-02 Thread Brecht Van Lommel
Commit: 2a33875065ab360ca015b42a75558ebcbac1ae2a
Author: Brecht Van Lommel
Date:   Fri Dec 2 18:50:38 2022 +0100
Branches: master
https://developer.blender.org/rB2a33875065ab360ca015b42a75558ebcbac1ae2a

Fix link error after recent changes to use span for iterating over nodes

===

M   source/blender/nodes/shader/node_shader_util.cc

===

diff --git a/source/blender/nodes/shader/node_shader_util.cc 
b/source/blender/nodes/shader/node_shader_util.cc
index fcf0e80a2e5..b1617a779ea 100644
--- a/source/blender/nodes/shader/node_shader_util.cc
+++ b/source/blender/nodes/shader/node_shader_util.cc
@@ -7,6 +7,8 @@
 
 #include "DNA_node_types.h"
 
+#include "BKE_node_runtime.hh"
+
 #include "node_shader_util.hh"
 
 #include "NOD_socket_search_link.hh"

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


  1   2   3   4   5   6   7   8   9   10   >