Commit graph

1660 commits

Author SHA1 Message Date
Ray Molenkamp
c9b0f0c0d2 Fix: Excessive warnings coming out of extern_vulkan_memory_allocator
Looks like someone tried to suppress the warn in the past, but didn't
succeed.

It's making some noise on the bots [1] so best to deal with them.

[1] https://builder.blender.org/admin/#/builders/133/builds/19099

Pull Request: https://projects.blender.org/blender/blender/pulls/152552
2026-03-10 14:23:32 +01:00
Jonas Holzman
7a9ca824c5 Build: macOS: Fix bitwise operation enum type warning in Audaspace
This fixes the following warning:

```
<...>/blender/extern/audaspace/plugins/coreaudio/CoreAudioDevice.cpp:160:73: warning: bitwise operation between different enumeration types ('(unnamed enum at <...>/CoreAudioTypes.framework/Headers/CoreAudioBaseTypes.h:573:1)' and '(unnamed enum at <...>/CoreAudioTypes.framework/Headers/CoreAudioBaseTypes.h:522:1)') is deprecated [-Wdeprecated-anon-enum-enum-conversion]
  160 |         stream_basic_description.mFormatFlags |= kAudioFormatFlagsNativeEndian | kLinearPCMFormatFlagIsPacked;

```

This deprecation (and warning) is new in C++20. The issue came from
macOS CoreAudio using an internal macro (CF_ENUM) to define anonymous
enums with an underlying type, with the warning then being cause by both
of these constants being part of different enums.

Fixed by adding an explict cast to the underlying type
(AudioFormatFlags) before applying the bitwise operation.
2026-02-21 18:07:16 +01:00
Ray Molenkamp
18a01ebc6b CMake: Remove ceres and eigen from /extern
This change reduces compile time:

```
before: 648.4 s weighted time (15645.9 s elapsed time sum, 24.1x parallelism)
after : 613.6 s weighted time (14110.1 s elapsed time sum, 23.0x parallelism)
-----------------------------------------------------------------------------
Diff  : -34.8 s                -1535.8
```

We now also bundle less libraries within the Blender code base.
2026-02-05 23:10:02 +01:00
Campbell Barton
8285ff7b81 CMake: resolve uninitialized variable warnings 2026-01-29 02:37:08 +00:00
Campbell Barton
5549bc5723 CMake: use set(VAR "") for empty initialization, unset() for cleanup
In CMake, set(VAR) without a value unsets the variable rather than
initializing it to empty. This causes issues with --warn-uninitialized
and can lead to unexpected behavior when the variable is used later.

Use set(VAR "") when initializing variables that will be appended to
or used in expressions. Use unset() to explicitly remove temporary
variables after use.

Ref !153503
2026-01-29 11:48:33 +11:00
Campbell Barton
ee4247f627 CMake: remove unused no-op code
Remove empty function calls, unused variables, and dead code blocks
that have no effect.

Ref !153506
2026-01-29 11:48:33 +11:00
Aras Pranckevicius
4ec2885a3c Audio: rewrite Audaspace integration to use C++ APIs
Primarily driven by #153249 (sound modifier data is always leaked).

Audaspace itself is written in C++ and uses C++ smart pointers
(shared_ptr) for all resource lifetime management. But the additional
"C" Audaspace API layer was not, it was allocating raw C pointers that
pointed to the C++ smart pointers.

However some parts of Blender code were not really paying attention to
that; particularly all the sound modifier related code. The modifiers
are just created and then kinda forgotten about; their lifetime is
never managed on Blender side which means they were always resulting in
a leak.

The only reason why that Audaspace C API layer exists, is because back
in the day whole Blender was written in C and could not use C++ APIs.
But that is no longer true, so rewrite the Audaspace integration to use
C++ APIs directly. Everywhere on Blender side, just use regular
shared_ptr handles that Audaspace already uses.

- BKE_sound_types.hh defines just the audaspace handle types, for data
  structures that need to store them as members.
- Everything else was already storing Audaspace objects outside of DNA
  structs, except for NlaStrip. Move the "speaker handle" of it into a
  separately allocated runtime struct then.
- Instead of many Audaspace handles being "void *"" as previously, now
  they are AUD_Sound, AUD_Sequence, AUD_SequenceEntry etc which makes
  it clearer what is what.
- The "C" part of Audaspace library is no longer compiled now.

Pull Request: https://projects.blender.org/blender/blender/pulls/153386
2026-01-26 17:45:46 +01:00
Campbell Barton
3720079292 CMake: correct typos, compiler checks and message type
- Fix variable name typo in `buildinfo.cmake`.
- Use `CMAKE_CXX_COMPILER_ID` instead of `CMAKE_C_COMPILER_ID`
  when adding C++ compiler flags in `gflags` and `gtest`.
- Change message type from `ERROR` to `STATUS` for missing system Python
  in tests configuration, matching similar messages that aren't fatal.
2026-01-26 02:21:42 +00:00
Campbell Barton
e229181baa Cleanup: spelling/wording in CMake
Mainly changes to comments, one message wording correction.
2026-01-26 09:47:27 +11:00
Sebastian Parborg
f82c8bf578 Cmake: Do not use the depricated CMAKE_COMPILER_IS_GNUCC variable
We should now use 'CMAKE_C_COMPILER_ID STREQUAL "GNU"' instead:
https://cmake.org/cmake/help/latest/variable/CMAKE_COMPILER_IS_GNUCC.html
2026-01-23 15:10:28 +01:00
Thomas Dinges
f7d920a89b Build: Library changes for Blender 5.1
This commit includes new minimum compiler requirements for Blender 5.1 as well as updated and new libraries.

**New compiler requirements**
* Windows x64: Visual Studio 2022 (17.14.14 or newer)
* Windows arm64: Visual Studio 2022 (17.14.23 or newer)
* Linux x64: gcc 14 (when used with our libraries)

**New libraries**
Abseil 20250814.1
ThorVG 1.0.0-pre31
OpenJPH 0.25.2

**Updated libraries**
AOM 3.13.1
Expat 2.7.2
FFI 3.5.2
HIPRT 606b4886efabce918dd0634ef71c06615a47c83b
Imath 3.2.2
ISPC 1.29.1
libheif 1.20.2
MaterialX 1.39.4
MESON 1.9.0
minizip-ng  4.0.10
Numpy 2.3.4
oneAPI Level Zero 1.21.9
OneTBB 2022.3.0
OpenColorIO 2.5.0
OpenEXR 3.4.3
OpenImageDenoise 2.4.1
OpenImageIO 3.1.7
OpenSubDiv 3.7.0
OpenVDB 13.0.0
OpenXR 1.1.53
PIP 25.2
Python 3.13.9
ShaderC 2025.4
Vulkan 1.4.328
webp 1.6.0
Yaml CPP 0.8.0
ZSTD 1.5.7 (z-standard 0.25.0)

**Library changes**
FMT (moved from /extern to libs)
Ceres (updated version in lib, will be removed from /extern in a later commit)
Eigen (updated version in lib, will be removed from /extern in a later commit))

Ref #147201

Co-authored-by: Nikita Sirgienko <nikita.sirgienko@intel.com>
Co-authored-by: Ray Molenkamp <github@lazydodo.com>
Co-authored-by: Sebastian Parborg <sebastian@blender.org>
Co-authored-by: Anthony Roberts <anthony.roberts@linaro.org>
Co-authored-by: Jonas Holzman <jonas@holzman.fr>
Co-authored-by: Bart van der Braak <bart@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/149852
2026-01-22 18:49:15 +01:00
Jacques Lucke
0981cf25cf Cleanup: avoid comparing double to enum
This is necessary for C++20 compatibility.
2026-01-16 18:01:46 +01:00
Jacques Lucke
8e9726c143 Cleanup: use constexpr int instead of enum
This is necessary for C++20 compatibility.
2026-01-16 18:01:46 +01:00
Brecht Van Lommel
e46f4c1a7e Refactor: Use more modern bf::dependencies and bf::extern in CMake
Replacing various include directories, defines and libraries specified
directly.

Additionally, this makes it so bf::dependencies are automatically added
last to the target. This ensures include directories from bf::extern libraries
have priority over them, so that e.g. our own fmtlib will be used rather than
one that might be installed on the system.

Pull Request: https://projects.blender.org/blender/blender/pulls/151920
2026-01-14 17:45:17 +01:00
Campbell Barton
fe217c9b45 extern/curve_fit_nd: update the curve fitting library
Resolve error refitting 2-knot cyclic curves that could cause "spikes"
in the resulting curve.
2026-01-14 16:18:26 +11:00
Campbell Barton
32614c4eaf extern/curve_fit_nd: update the curve fitting library
Changes include:
- Fix stale error values being used during refinement
  with the "refit" solver.
- Use multiple split-point detection methods
  (max distance, sign-change & inflection point for S-shaped curves).
- Heap comparator uses the index as a tie breaker for more stable
  ordering when values match.

Results in higher quality fitting as measured by area delta
between input/output polygons.

Ref !152677
2026-01-12 00:50:45 +00:00
Campbell Barton
3935658dfd extern/curve_fit_nd: update the curve fitting library
- Fix solver bug in degree-3 speed polynomial calculation
  (from the original OpenToonz implementation).
- Extend the refit method to support custom corners.
- Improve the refit solver by scanning for a local optimum
  around the initial refit point.
- Minor fixes and optimizations.

While the difference is subtle, both the fix to the solver and the
improved refit method produce better results that tend to be a closer
fit with the same error margin - as measured by the area between the
input polygon and the resulting curve.

This applies to freehand drawing of bezier curves and grease-pencil.

Ref !152513
2026-01-07 21:56:28 +11:00
Brecht Van Lommel
41a27b4eed Refactor: Move code in source/ into blender namespace
Previously only a subset of the code was in this namespace. This improves
consistency, and means common types like Vector, StringRef and float3
don't need blender:: prefixes anywhere.

This does not move code into sub-namespaces, but gets us a step closer to
the end goal.

* Add namespace blender {} to almost all files.
* Remove unnecessary blender:: prefixes and using namespace blender;.
* Freestyle was not not moved, it remains in top level namespace freestyle.
* Cycles integration code was modified to use blender:: prefixes.
* bUUID existed both in the top level and blender namespace. To resolve this
  conflict, the wrapper class is now blender::UUID.

Some blender:: prefixes remain primarily because of ambiguous namespaces, for
example animrig:: could refer to both blender::animrig and blender::ed::animrig.

Pull Request: https://projects.blender.org/blender/blender/pulls/152329
2026-01-06 20:00:02 +01:00
Jörg Müller
816c806a60 Audaspace: porting bugfix from upstream. 2026-01-01 15:54:21 +01:00
Jeroen Bakker
4bcb6e15b0 Vulkan: Enable VMA asserts
These asserts where disabled to work around the issue that resources
could be created when Blender is being exited. This isn't the case
anymore so it should be safe to enable asserts in VMA.

Pull Request: https://projects.blender.org/blender/blender/pulls/151830
2025-12-18 14:04:42 +01:00
Sebastian Parborg
137b58a980 CMake: Update the last remaining <3.10 cmake min version
This was missed in an earlier update

Pull Request: https://projects.blender.org/blender/blender/pulls/151585
2025-12-13 21:13:24 +01:00
salipour
742b629067 Fix #150553: Cycles HIP RT crash without rocm-hip-devel on Fedora
Both HIP and HIP RT rely on the HIP runtime, which is provided by the rocm-hip
package as both a versioned and an unversioned library (libamdhip64.so.x and
libamdhip64.so). On Fedora, however, rocm-hip ships only the versioned library,
while the unversioned one is provided by rocm-hip-devel.

The version of HIP RT used in Blender currently looks only for the unversioned
library and fails to load the driver if it’s missing. HIP itself, by contrast,
looks for both the versioned and unversioned libraries. Cycles enables HIP RT
as long as the hiprt library is present, even if HIP RT fails to load the
runtime—leading to undefined behavior.

This addresses the issue by disabling HIP RT when the unversioned HIP runtime
library is not found.

Ref #150553

Pull Request: https://projects.blender.org/blender/blender/pulls/151081
2025-12-05 20:09:37 +01:00
Aras Pranckevicius
d05ac27b59 Fix: Build failure with Audaspace but without FFTW
AUD_Sound_Echo was wrongly inside WITH_CONVOLUTION guards

Upstream Audaspace PR: https://github.com/neXyon/audaspace/pull/65

Pull Request: https://projects.blender.org/blender/blender/pulls/151138
2025-12-05 08:00:57 +01:00
Jörg Müller
4961ed3bef Audaspace: port changes from upstream. 2025-11-22 18:34:57 +01:00
Andrew Marshall
bcce2d2030 Fix: Incorrect HIP library load path on Linux
Missing comma meant the following line was concatenated with this one.

Broken in 14bd7a531f.

Pull Request: https://projects.blender.org/blender/blender/pulls/150321
2025-11-22 01:35:06 +01:00
Alaska
575d2d631f Fix #149443: Crash using HIP RT or OIDN on recent AMD GPU drivers
At the moment, HIP RT and OIDN tries to load the HIP 6.X runtime,
while the rest of Cycles tries to load a HIP 7.X runtime,
which then leads to undefined behaviour and crashing.

To fix this issue, this commit prioritizes loading the HIP 6.X runtime
and falls back to the HIP 7.X runtime if 6.X doesn't exist.

Pull Request: https://projects.blender.org/blender/blender/pulls/149488
2025-11-07 16:18:34 +01:00
Richard Antalik
b27ba0fef1 Fix: VSE: Can not cancel waveform reading job
When there are lot of sound strips in VSE timeline, waveform rendering
could not be stopped. This causes problems mainly when .blend file was
opened by accident and different one can not be opened until all
waveforms are read, which can take a minute.

This was caused by code, where value of `stop` boolean pointer was
stored in local variable and cast into short. Pointer to this local
variable was passed to `AUD_readSound()`. Then value of `stop` bool
pointer was set to that local variable again. Because the code runs in
multiple threads now, it is quite likely, that `stop` value gets
overwritten by older thread. Especially, because `AUD_readSound()` does
interrupt its process only when `stop` was true before its execution,
so it is done very quickly.

Pass boolean pointer directly to `AUD_readSound()`, so the waveform
reading process can be interrupted immediately. The change in Audaspace
is already merged in
9b1be5f7c9

Finally, while the waveform reading job now can be cancelled, new job
will be created immediately. This is technically correct behavior, even
though it can cause other problems described in #144082

Pull Request: https://projects.blender.org/blender/blender/pulls/149301
2025-11-06 19:48:22 +01:00
Andrej730
0fc320fcb6 Fix: typo in audaspace doc-string that breaks rst generation
The typo is breaking docs generation for this page.
Add missing `:` to resolve it

See PR description for image and other details

Pull Request: https://projects.blender.org/blender/blender/pulls/149221
2025-11-03 10:33:54 +01:00
Aras Pranckevicius
dc3727bd80 Fix #149125: Preserve Pitch on retimed sounds broken when anything is animated
Similar case as was with equalizer modifier recently (#141084):
here the AnimateableTimeStretchPitchScale effect was being
constantly re-created every frame, as soon as anything in VSE
timeline has an animation.

Fix this by checking if Audaspace sequence handle for the sound
is already an instance of AnimateableTimeStretchPitchScale; if it
is then just use the already created one.

Pull Request: https://projects.blender.org/blender/blender/pulls/149127
2025-11-03 08:42:57 +01:00
Lukas Tönne
025c401dca Fix #144250: Crash when mantaflow solver does not converge and skips cleanup
Mantaflow likes to throw exceptions when things go wrong, which includes a
simple case of the solver not converging sufficiently. This should not be
catastrophic, but cleanup of buffers is omitted when such an exception occurs.
This then leads to yet another failure when the solver is stopped because of
incorrect buffer refcounts. That exception bubbles up through the python layer
and causes errors in the Blender integration wrapper that cause crashes.

Pull Request: https://projects.blender.org/blender/blender/pulls/147527
2025-10-07 15:49:07 +02:00
Thomas Dinges
66224d69b0 Deps: Library changes for Blender 5.0
This commit includes the changes to the build system, updated hashes to the actual new libraries as well as a required test update.

* DPC++ 6.2.0 RC
* freetype 2.13.3
* HIP 6.4.5010
* IGC 2.16.0
* ISPC 1.28.0
* libharu  2.4.5
* libpng 1.6.50
* libvpx 1.15.2
* libxml2 2.14.5
* LLVM 20.1.8
* Manifold 3.2.1
* MaterialX 1.39.3
* OpenColorIO 2.4.2
* openexr 3.3.5
* OpenImageIO 3.0.9.1
* openjpeg 2.5.3
* OpenShadingLanguage 1.14.7.0
* openssl 3.5.2
* Python 3.11.13
* Rubber Band 4.0.0
* ShaderC 2025.3
* sqlite 3.50.4
* USD 25.08
* Wayland 1.24.0

Ref #138940

Co-authored-by: Ray Molenkamp <github@lazydodo.com>
Co-authored-by: Jesse Yurkovich <jesse.y@gmail.com>
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Nikita Sirgienko <nikita.sirgienko@intel.com>
Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Co-authored-by: Kace <lakacey03@gmail.com>
Co-authored-by: Sebastian Parborg <sebastian@blender.org>
Co-authored-by: Anthony Roberts <anthony.roberts@linaro.org>
Co-authored-by: Jonas Holzman <jonas@holzman.fr>

Pull Request: https://projects.blender.org/blender/blender/pulls/144479
2025-10-02 18:34:11 +02:00
Sebastian Parborg
fcc1502146 Cleanup: Remove the now unused lzma and lzo libraries from extern
LZO and LZMA has been unused in Blender since #141461

Pull Request: https://projects.blender.org/blender/blender/pulls/146842
2025-09-26 15:55:47 +02:00
Jonas Holzman
c08d42aebf macOS: Support Xcode Archiving for distributing application bundles
This is a port of iOS commit f3f8647 to main, for Xcode archiving to
also work for macOS bundles, allowing the bundle to be archived and
later distributed via Testflight, App Store Connect, etc...

Additonal Xcode property also had to be added to the extern draco shared
library target to prevent it from being included in the Xcode archive
(an implicit behavior for `SHARED` CMake libraries), without this,
the archive would get polluted, preventing it from being properly
recognized as a proper app bundle archive.

Pull Request: https://projects.blender.org/blender/blender/pulls/146027
2025-09-23 20:56:18 +02:00
Jörg Müller
719e207fcc Audaspace: port changes from upstream.
More accurate seeking for animated time stretching.
2025-09-09 08:13:42 +02:00
Aras Pranckevicius
c249a11922 Cleanup: update ufbx to latest version
No behavior changes, only a tiny warning fix for some gcc versions.
And it is nicer to be on latest tagged release instead of
in-development state.

Pull Request: https://projects.blender.org/blender/blender/pulls/145727
2025-09-04 14:40:13 +02:00
Sahar A. Kashi
14bd7a531f Cycles: Remove ROCm 5 code path and add ROCm 7 runtime to search list
This pull request removes ROCm 5 code path and adds ROCm 7 runtime to
library search list.

ROCm 5 runtime is no longer shipped with AMD drivers, and ROCm 5 compiler
is no longer compatible with newer driver versions.

It also adds ROCm 7 runtime to the list of runtime libraries to look for.
Starting later this year, ROCm 7 runtime will be bundled with the driver
installer, and all future runtime fixes and improvements will target ROCm 7.

Once ROCm 7 runtime is rolled out, ROCm 6 compiler will continue to work
with it for about a year as a transitional measure. Beyond that, compatibility
is not guaranteed.

Pull Request: https://projects.blender.org/blender/blender/pulls/145279
2025-08-28 11:35:01 +02:00
Jörg Müller
ebfad2c071 Audaspace: porting changes from upstream.
Fixes for ffmpeg 8 and bugfix of a memory leak.
2025-08-26 20:46:56 +02:00
Jörg Müller
f085f88835 Audaspace: porting changes from upstream.
This change introduces animated time stretching and pitch scaling.
It also extends the Python API with AnimateableProperty.
Note: to be used, this still needs rubberband.

Credit: Kacey La
2025-08-23 17:25:38 +02:00
Bartosz Kosiorek
55bdaab4da Fix #144701: Wrong falling fluid behaviour
Error introduced with performance improvement in #137733.

Pull Request: https://projects.blender.org/blender/blender/pulls/144884
2025-08-22 19:19:29 +02:00
Campbell Barton
66ed599c33 Cleanup: remove Python scripts & directory from CMake source file lists 2025-08-21 17:09:18 +10:00
Jeroen Bakker
1f1098c498 Vulkan: Remove MoltenVK
Blender had some support for using MoltenVK. However there are some key
issues why MotlenVK cannot be used. Bugs have been reported up-stream.
As it doesn't work and holds back regular developments it will be removed
from the main branch.

Any efforts on making Vulkan run on Apple (including KosmicKrisp)
is considered a community effort and can be done in a development
branch.

Pull Request: https://projects.blender.org/blender/blender/pulls/144602
2025-08-15 09:36:38 +02:00
Jeroen Bakker
7286885789 Vulkan: Update VMA to 3.3.0
Updated to latest release. Has some fixes and a new API for easy
integration with Volk.

Pull Request: https://projects.blender.org/blender/blender/pulls/144434
2025-08-14 13:20:45 +02:00
Jesse Yurkovich
0240a1f32f Cleanup: CMake: Modernize bf_intern_openvdb dependencies
This follows the other CMake "modernization" commits, this time for
`bf_intern_openvdb` and the OpenVDB dependency itself.

The difference with this one is that `intern/openvdb` becomes an
"optional" dependency itself. This is because downstream consumers often
want to include this dependency rather than openvdb directly, so this
target must also be optional. Optional, in this case, means the target
always exists but may be entirely empty.

Summary
- If you are using BKE APIs to access openvdb features, then use the
  `bf::blenkernel` target
- If you are only using `intern/openvdb` APIs then use the
  `bf::intern::optional::openvdb` target (rare)
- For all other cases, use the `bf::dependencies::optional::openvdb`
  target (rare)

context: https://devtalk.blender.org/t/cmake-cleanup/30260
Pull Request: https://projects.blender.org/blender/blender/pulls/137071
2025-08-12 21:26:38 +02:00
Brad Smith
501df52b53 Fix: Build failure on riscv64 platform
Use `__LP64__` consistently for 64-bit platform detection and simplify
the checks a bit. The amd64, aarch64 and powerpc64 checks are covered
by `__LP64__`.

Pull Request: https://projects.blender.org/blender/blender/pulls/143679
2025-08-12 17:05:25 +02:00
Jörg Müller
957ee8953b Audaspace: porting changes from upstream.
This change introduces time stretching and pitch scaling.
However, none of this will be compiled at the moment, as rubberband
needs to be added to the dependencies first.

Credit: Kacey La
2025-07-26 19:00:34 +02:00
Campbell Barton
c3cdc11283 CMake: quiet build warnings from fmtlib
Reference fmtlib as a system include to suppress noisy messages.
2025-07-16 15:32:03 +10:00
Brecht Van Lommel
8392ca915b Cycles: Remove glog dependency, redirect logs to CLOG
* Add own simple logging system to replace glog, which is no longer
  maintained by Google.
* When building in Blender, integrate with CLOG and print all messages
  through that system instead.
* --log cycles now replaces --debug-cycles. The latter still works but
  is no longer documented.

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:24 +02:00
Lukas Stockner
7842b27326 GTest: Fix compiler warning with GCC 15
`<ciso646>` is deprecated in C++17, and now GCC 15 has started to complain,
so include an upstream commit that fixes this.

Pull Request: https://projects.blender.org/blender/blender/pulls/139417
2025-06-26 02:03:34 +02:00
Brecht Van Lommel
aa25b4d3c2 Merge branch 'blender-v4.5-release' 2025-06-17 20:21:00 +02:00
Zhou Qiankang
1692817b5e Fix: Wrong HIP device pointer size on riscv64 and loongarcg64
Add __LP64__ to 64-bit platform detection, to ensure hipDeviceptr_t has the
correct size on these platforms.

Pull Request: https://projects.blender.org/blender/blender/pulls/140528
2025-06-17 20:18:00 +02:00