Commit Graph

3728 Commits

Author SHA1 Message Date
Ray Molenkamp
a602e4fa40 CMake: Fix ASAN builds on windows
When building with asan enabled on windows tools such as
msgfmt will run before the install phase which normally
copies the required asan dlls next to the binaries preventing
msgfmt from stating and causing a build error.

This change adds the MSVC path to the PLATFORM_ENV_BUILD_DIRS
so when we run the various tools the asan shared libs can
be found.
2024-05-07 12:19:20 -06:00
Campbell Barton
45fe1dcdf2 cppcheck: exclude file that hangs for hours 2024-05-07 13:07:04 +10:00
Brecht Van Lommel
794df958f6 Build: Explicitly specify Homebrew Bison path on macOS for libs
To avoid using the too old system version.
2024-05-06 19:09:45 +02:00
Brecht Van Lommel
3aa00e14e4 Build: Use CMake for sndfile deps building on all platforms
Resolves issues finding opus, and makes Linux and macOS match
Windows more closely.

Pull Request: https://projects.blender.org/blender/blender/pulls/121401
2024-05-06 17:06:38 +02:00
Attila Áfra
205b909669 Build: Upgrade OIDN to 2.3.0-beta
This updates OIDN to 2.3.0-beta. The final version is planned to be
released in time for Blender 4.2 Beta. The most relevant changes:

1. Much higher quality when denoising with accurate prefiltering in *high*
   quality mode, but at the cost of lower performance (use *balanced*
   quality mode to revert to previous *high* quality mode)
2. Added new *fast* quality mode for 1.5-2x higher performance viewport
   denoising
3. Lazy device module loading to avoid potential stability issues caused by
   drivers of unused devices
4. Release CUDA primary context as soon as the OIDN device gets destroyed
   to prevent potential memory leaks

To enable 2 and 3, code changes are needed in Blender, to be committed
separately.

Ref #118455

Pull Request: https://projects.blender.org/blender/blender/pulls/121359
2024-05-06 14:14:58 +02:00
Campbell Barton
9d6ab4b1dc cppcheck: ignore more checks in the log summary 2024-05-06 11:50:03 +10:00
Campbell Barton
1c50e12d86 cppcheck: support canceling without overwriting the previous log
Without this canceling cppcheck part way through meant comparing old/new
log-files wasn't possible without manual renaming.

Now the new log-files are only written (and previous execution renamed
to ".old.log") once generating the log has completed.
2024-05-06 09:20:02 +10:00
Campbell Barton
28783890b4 cppcheck: exclude noisy unusedPrivateFunction from log summary 2024-04-30 12:52:53 +10:00
Brecht Van Lommel
5a458fe92a Build: Patch OIIO to not load plugins from (DY)LD_LIBRARY_PATH
This can cause crashes when loading incompatible plugins that happen to
be installed in one of the directories.

This change has been merged upstream, but there will likely be no stable
release in time for the next Blender release. So patch locally for now.

Fix #120480: Blender fails to launch on Steam on Arch Linux

Ref #118455

Pull Request: https://projects.blender.org/blender/blender/pulls/121136
2024-04-26 17:02:39 +02:00
Ben-7
0136289cb6 CMake: Windows: clang-cl fixes
Support for building blender with clang on windows on x64 was added
years ago but given there are no active users support has crumbled a
bit.

This PR brings the build system back into working order but upstream
patches in openVDB are still required for a successful build see PR
#120317 for details.

Blender when build with clang the classroom scenes rendered on the cpu
with cycles is seeing a 5% reduction in render time on both an
AMD 7700x and an Intel 14900k.
2024-04-24 15:59:47 +02:00
Sergey Sharybin
c3e1f63635 Build: Add pipeline overrides for Windows arm64 platform 2024-04-19 14:51:35 +02:00
Campbell Barton
06adfcaf38 Cleanup: unused imports 2024-04-19 16:09:30 +10:00
Campbell Barton
0ceefd6358 Cleanup: cmake syntax 2024-04-19 15:50:26 +10:00
Ray molenkamp
39c901407e MSVC: Add cmake option for external manifests
This PR adds a cmake option `WITH_WINDOWS_EXTERNAL_MANIFEST`
which is off by default which addresses the following 2 problems:

The CI env occasionally fails to link the manifest into blender.exe
with mt.exe getting file in use error. The solutions mentioned online
vary wildly between, just rebuild, turn off your AV, use this magic
switch. None of them actually point to a root cause we can address.

When building blender with clang and the visual studio generator
it also somehow doesn't embed the manifest.

If the bots stay problematic this option can be turned on for the CI
environment, and will be automatically turned on when it detects clang
and the visual studio generator being used.

Pull Request: https://projects.blender.org/blender/blender/pulls/111683
2024-04-18 16:57:04 +02:00
Campbell Barton
a7d1bd9735 cppcheck: use source relative paths in the summary
Reduces visual noise & make it more convenient to compare summaries
from different systems.

Also use a more strict regex when checking for error ID's.
2024-04-16 14:50:46 +10:00
Campbell Barton
f6605523e8 cppheck: improvements to checking script
Various changes that simplify running cppcheck, comparing results
from the previous execution.

- Create a summary of the log that groups errors by type,
  useful since some kinds of warnings tend to lead to errors in the
  code more than others.
- Keep a copy of the previous runs logs - useful for comparisons.
- Log the output in the order of the files selected to check.
- Fix non thread-safe output sometimes mixing warnings from different
  processes.
2024-04-14 20:44:03 +10:00
Ray Molenkamp
8b9743eb40 CMake: Change build flags to use SSE42 if available
This cleans up our `TEST_SSE_SUPPORT` macro to only test
for SSE42 and passes the flags to the CMAKE_C/CXX_FLAGS

the cpu check module needed to move to its own folder since
the flags at the end of a CMakeLists.txt appear to be used
for all targets inside a CMakeLists file and cpu_check cannot
be build with sse42 flags.

This only affects Mac/Linux since MSVC has no buildflags
to target SSE42

Pull Request: https://projects.blender.org/blender/blender/pulls/118468
2024-04-11 20:46:14 +02:00
Jeroen Bakker
c15e5116ab Vulkan: MoltenVK Support for Developers
MoltenVK original intent was to let developers work on a mac system developing
for the vulkan eco-system. MoltenVK doesn't support all the features that we
require and would require additional workarounds to be actually supported.

It is not expected that we will release Blender with MoltenVK for this reason.
But it still has value for shader developers to validate shaders on metal and
vulkan on a single platform.

![image](/attachments/9a4a9904-a5f6-4922-896d-744dfb78244c)

Pull Request: https://projects.blender.org/blender/blender/pulls/117940
2024-04-11 11:04:43 +02:00
Campbell Barton
51fd558be2 cppcheck: suppress noisy output
Some of these could be enabled if there is an interest to consider
them warnings, until then they're noisy and don't often hint at errors
in the code.
2024-04-08 12:02:58 +10:00
Campbell Barton
cbee0f5477 cppcheck: update the checking utility to resolve issues in source/
The script to run cppcheck failed for most files in source/ because
of a syntax error in MEM_guardedalloc.h with attribute functions.

Workaround the error by including BLI_compiler_attrs.h directly.

Other changes:

- Specify c++17 / c11 standards for C++ & C.
- Resolve errors from undefined integer ranges.
- Set the check level to exhaustive so checks always run.
- Suppress noisy missingIncludeSystem warning.
- Move run-time compiler defines into a temporary include
  which resolves argument quoting errors when cppcheck is used with
  clang's parser.
2024-04-02 17:02:23 +11:00
Campbell Barton
03d728e281 Cleanup: improve type checking in project_source_info.py
Since the type hints were added it seems mypy has been improved
making it possible to remove the workarounds.
2024-04-02 10:26:14 +11:00
Campbell Barton
ae950451ea Cleanup: remove redundant f-string use 2024-04-01 16:51:32 +11:00
Campbell Barton
0eb1317e70 Cleanup: remove unused exception value 2024-03-29 16:18:28 +11:00
Campbell Barton
6a937d646b Cleanup: remove unused variables 2024-03-21 10:11:54 +11:00
Brecht Van Lommel
971e82b93a Merge branch 'blender-v4.1-release' 2024-03-15 21:13:19 +01:00
Brecht Van Lommel
b32554e53b Build: Upgrade OpenImageDenoise to 2.2.2
Fixing memory leak reported in #119035, and crashes with old AMD
drivers and unsupported GPUs.

Pull Request: https://projects.blender.org/blender/blender/pulls/119538
2024-03-15 21:11:04 +01:00
Campbell Barton
a654e0dde3 Cleanup: unset temporary variables in CMake 2024-03-14 10:38:15 +11:00
Brecht Van Lommel
92f6ba5a5f Merge branch 'blender-v4.1-release' 2024-03-11 15:09:55 +01:00
Brecht Van Lommel
c388ed1e53 Fix #118709: Crash in OIDN GPU detection for unsupported HIP device
Pull Request: https://projects.blender.org/blender/blender/pulls/119315
2024-03-11 15:09:24 +01:00
Jesse Yurkovich
5b522359ee Cleanup: Centralize MSVC conformance related cmake items
Move the MSVC conformance flags to a win32-specific central location.

Pull Request: https://projects.blender.org/blender/blender/pulls/119235
2024-03-09 23:42:20 +01:00
Hans Goudey
04a9790035 Merge branch 'blender-v4.1-release' 2024-03-08 16:35:33 -05:00
Ray Molenkamp
850b89ba51 deps_builder: fix URI for the blender mirror of the source packages
This was still using the SVN repository, which isn't used any more
since the migration to git lfs.
2024-03-08 10:01:44 -07:00
Campbell Barton
cb4351665a Cleanup: format, trailing space 2024-03-08 11:31:01 +11:00
Campbell Barton
5214e6f35d Cleanup: unset temporary CMake variables
Also use consistent case (for `_*_SEARCH_DIRS`).
2024-03-08 10:54:56 +11:00
Hans Goudey
744f3b2823 Cleanup: Grammar in comments: Fix uses of "own"
"Own" (the adjective) cannot be used on its own. It should be combined
with something like "its own", "our own",  "her own", or "the object's own".
It also isn't used separately to mean something like "separate".

Also, "its own" is correct instead of "it's own" which is a misues of the verb.
2024-03-07 16:23:35 -05:00
Campbell Barton
0cd414120b Unbreak build on macOS with AppleClang from recent cleanup
Exact an exact match with Clang broke building when the compiler ID
was "AppleClang", reverting parts of [0].

[0]: 6549019ae19cecbea524782054dca0e99cb833b8
2024-03-07 19:56:58 +11:00
Campbell Barton
6549019ae1 Cleanup: use STREQUAL instead of MATCHES for exact comparisons
MATCHES takes a REGEX and searches the input for a match,
this isn't necessary for CMAKE_SYSTEM_PROCESSOR & CMAKE_*_COMPILER_ID.
2024-03-07 17:56:41 +11:00
Campbell Barton
d0fc9e2d9d Merge branch 'blender-v4.1-release' 2024-03-07 17:36:31 +11:00
Campbell Barton
239395565a Build: fix building openimagedenoise on Linux
hipPointerAttribute_t.memoryType was renamed to type,
perform the rename on Linux to fix build error.
2024-03-07 17:32:04 +11:00
Campbell Barton
a975c7096a Cleanup: line length in CMake files 2024-03-07 13:26:55 +11:00
Brecht Van Lommel
b3d55b37bc Merge branch 'blender-v4.1-release' 2024-03-06 16:52:54 +01:00
Brecht Van Lommel
216637ab56 Build: Upgrade OSL to 1.13.7, OIDN to 2.2.1
Fix #118020: Crash with OptiX OSL on Windows
Maybe help with #119035: Memory leaks with OIDN GPU

Ref #113157

Pull Request: https://projects.blender.org/blender/blender/pulls/119095
2024-03-06 16:34:27 +01:00
Anthony Roberts
445fd42c61 Windows: Add ARM64 support
* Only works on machines with a Qualcomm Snapdragon 8cx Gen3 or above.
  Older generation devices are not and will not be supported due to
  some driver issues
* Requires VS2022 for building.
* Uses new MSVC preprocessor for sse2neon compatibility.
* SIMD is not enabled, waiting on conversion of blenlib to C++.

Ref #119126

Pull Request: https://projects.blender.org/blender/blender/pulls/117036
2024-03-06 16:14:34 +01:00
Anthony Roberts
7e3b83b146 Build: Add Windows ARM64 support for library dependencies
* VS2022 is required.
* Only OpenPGL and DPCPP are disabled, other libraries are supported.
* Embree is built with LLVM and VS2019 tools, and for that reason has
  its own cmake file as it is quite different.
* TBB and USD patches should become obsolete once these are upstreamed
  and Blender upgrades to the latest versions.

Ref #119126

Pull Request: https://projects.blender.org/blender/blender/pulls/117036
2024-03-06 16:14:33 +01:00
Ray Molenkamp
55dfe399b5 deps_builder: Fix openpgl build error on windows
$ was on the wrong line causing a build error,
issue introduced in 28e771372bcad3194bc55f56e9da32361036b241
2024-03-04 15:12:15 -07:00
Campbell Barton
8c16b612ca Merge branch 'blender-v4.1-release' 2024-03-04 12:53:37 +11:00
Campbell Barton
7e9a36c1fa Cleanup: suppress undefined variable use warnings 2024-03-04 12:51:24 +11:00
Sebastian Parborg
1cdf41a341 Fix: CMake LIBDIR check not working as intended after cleanup
After 65f5e8b775, the LIBDIR cmake check would actually not print any
warnings if the LIBDIR could not be found automatically.
2024-03-01 19:44:02 +01:00
Sebastian Parborg
4b114861c0 Fix: CMake LIBDIR check not working as intended after cleanup
After ca8dc11a85, the LIBDIR cmake check would actually not print any
warnings or error out if the LIBDIR could not be found automatically.

Pull Request: https://projects.blender.org/blender/blender/pulls/118975
2024-03-01 19:37:36 +01:00
Bastien Montagne
c3d3528280 Fix broken CMake file after recent refactor.
Basically all 'normal' builds were erroring in CMake config after
ca8dc11a85.
2024-03-01 12:17:44 +01:00