Commit Graph

546 Commits

Author SHA1 Message Date
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
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]: 6549019ae1
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 a975c7096a Cleanup: line length in CMake files 2024-03-07 13:26:55 +11: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
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
Campbell Barton ca8dc11a85 Merge branch 'blender-v4.1-release' 2024-03-01 16:25:29 +11:00
Campbell Barton 65f5e8b775 Cleanup: undefined defined variable warnings with CMake 2024-03-01 16:22:06 +11:00
Falk David 5c7e4e15ca Cleanup: Fix typo 2024-02-28 15:23:09 +01:00
Sebastian Parborg 203d3e0d40 Linux: Don't always enable the CPU checker
When building a non portable build or when not using the precompiled
libraries, do not enable the CPU checker.

Make the cmake configure step error out when building with
WITH_STRICT_BUILD_OPTIONS if the LIBDIR can not be found.

Pull Request: https://projects.blender.org/blender/blender/pulls/118519
2024-02-26 15:41:22 +01:00
Sergey Sharybin 3dc832a904 Switch SVN to Git submodules using Git-LFS
This change makes it so build system and update utilities for Blender builds
are using pre-compiled libraries and other resources attached as Git modules
instead of using checkout of SVN repositories in the parent folder.

The directory layout:
```
  * release/datafiles/
    * assets/        -> blender-assets.git
      * publish/
      * ...
      * README.txt
  * lib/
    * darwin_x64/    -> lib-darwin_x64.git
    * darwin_arm64/  -> lib-darwin_arm64.git
    * linux_x64/     -> lib-linux_x64.git
    * windows_x64/   -> lib-windows_x64.git
  * tests/
    * data/         -> blender-test-data.git
```

The changes about configuring the actual Git sub-modules are not included
into this patch, as those require repository to actually exist before it
can be used.

The assets submodule is enabled by default, and the rest of them are
disabled. This means that if someone runs `git submodule update --init`
they will not get heavy libraries. The platform-specific and tests
related submodules are enabled when using `make update` or `make test`.

All the submodules are tracked: this means that when new commits are
done to the submodule, the blender.git repository is to be updated to
point them to the new hash. This causes some extra manual work, but it
allows to more easily update Blender and its dependencies to known good
state when performing operations like bisect.

Ref #108978

Pull Request: https://projects.blender.org/blender/blender/pulls/117946
2024-02-22 13:50:55 +01:00
Brecht Van Lommel 17ca22ae9f macOS: Raise minimum required version to macOS 11.2
This was already the minimum requirement for Intel and Apple Silicon
GPUs. It is required for the Metal backend to work correctly.

Previously the minimum for AMD GPUs was 10.15.

Pull Request: https://projects.blender.org/blender/blender/pulls/118287
2024-02-16 17:53:51 +01:00
Sergey Sharybin f11292104d Render Tests: Separate difference of Color and Alpha
This change fixes confusion situation when the render output
is an RGBA image: the difference in color was not visible in
the report because alpha channel was all zeros. This is due
to idiff performing per-channel difference.

The solution to this problem is to have separate images for
color and alpha difference, which makes it clear where the
difference actually is coming from.
2024-01-25 10:04:16 +01:00
Campbell Barton dd8c42bfaf CMake: mark freetype & tiff directories as advanced
It's not clear what these are used for as they seem like recent
additions and are set to "NOT-FOUND" even when tiff/freetype are found.

Marking as advanced instead of removing so as not to interfere with
freetype/tiff finding logic.
2024-01-23 20:45:19 +11:00
Campbell Barton 5afd33d129 PyAPI: drop support for Python 3.10
All platforms have been updated to support 3.11
so supporting 3.10 is no longer needed.
2024-01-09 22:23:41 +11:00
Brecht Van Lommel df43c8e7ef Fix macOS not auto updating cmake cache for Python 3.11 2024-01-08 13:14:34 +01:00
Brecht Van Lommel 0e4da8d55f Fix macOS ARM build failing with make lite
OpenImageIO headers have a dependency on Imath headers when not on x86_64.
2024-01-08 13:14:34 +01:00
Sergey Sharybin b66dec58ed macOS: Silence noisy linker warning about duplicate libraries
The warning was introduced with XCode 15 and conflicted with some
assumptions in the CMake. Even without actual cyclic dependency
between targets CMake might decide to pass library multiple times
to the linker, to ensure all its users find symbols from it.

This behavior is expected to be tweaked in the upcoming CMake
version, but until it is released and became widely used by all
Blender macOS developers silence the warning.

Pull Request: https://projects.blender.org/blender/blender/pulls/116718
2024-01-03 09:24:36 +01:00
Brecht Van Lommel 1f3ce2a311 Build: changes to macOS build flags to fix linker warnings
* Different fix for Mantaflow linker warnings that works with new OpenVDB.
* Use new linker for arm64 as it no longer produces warnings with latest
  Xcode. Still use the old one for x86_64 as some warnings remain.
* Fix wrong x86_64 build target in deps builder.

For the upcoming 4.1 libraries.

Ref #113157

Pull Request: https://projects.blender.org/blender/blender/pulls/116708
2024-01-02 16:22:48 +01:00
Campbell Barton 526019b559 CMake: default to Python 3.11, auto-update existing variables 2023-12-23 14:39:55 +11:00
Brecht Van Lommel 802ac5ba5a Build: Library updates for 4.1
Update libraries to match VFX platform 2024, and a few other upgrades to
latest versions.

boost 1.82.0
deflate 1.18 (new)
ffi 3.4.4
freeglut (deleted)
ispc 1.12.1
llvm 17.0.6
materialx 1.38.8
mesa 23.3.0
numpy 1.24.3
opencolorio 2.3.0
openexr 3.2.1
openimageio 2.5.6.0
opensubdiv 3.6.0
openvdb 11.0.0
osl 1.13.5.0 (now dynamic)
python 3.11.6
sqlite 3.42.0
sse2neon 0d6e9b3dd4
usd 23.11
vulkan 1.3.270
xm2 2.12.3

This only updates the build scripts, the precompiled libraries for each
platform will land over the coming weeks.

Ref #113157

Co-authored-by: Ray Molenkamp <github@lazydodo.com>
Co-authored-by: Campbell Barton <campbell@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/116420
2023-12-21 19:16:11 +01:00
Ray Molenkamp 7e916474db CMake/MSVC: Remove stale OIIO sse flag
We disabled SSE for OIIO headers in the days we still supported
32 bit builds, as it was giving build errors there. OIIO handles
this internally now so we no longer need to explicitly disable it,
also we stopped shipping 32 bit quite a while ago
2023-12-07 09:02:52 -07:00
Ray Molenkamp f644c936b6 shader_builder: Fix startup error on windows
needed shaderc_shared.dll to be available in the path
2023-11-27 08:35:37 -07:00
Harley Acheson 6ae5e1ade8 Core: Allow Optional Use of Harfbuzz and FriBiDi
Harfbuzz and FriBiDi are included in our external libraries for all
platforms. This PR adds the glue to make them available as optional
build components (off by default).

Pull Request: https://projects.blender.org/blender/blender/pulls/114947
2023-11-23 23:35:03 +01:00
Sebastian Parborg eaef914487 CMake: Allow building with system Vulkan and ShaderC
Previously the cmake code would try to run the LIBDIR specific "findX.cmake" files for both vulkan and shaderc.

However these would pick up system headers and libraries when LIBDIR were not present. This would lead to compilation errors as the system library configurations were not taken into account or queried.

This changes it so that if LIBDIR is not present, the proper pkgconfig files will be used instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/114639
2023-11-10 18:10:41 +01:00
Brecht Van Lommel ffd701ab58 Build: auto update CMake config for shared library OpenImageDenoise 2023-11-09 18:23:52 +01:00
Werner, Stefan b414187efb Build: Update OpenImageDenoise to 2.1.0
Major new feature in v2 is GPU support. This is not enabled yet,
this commit only changes the library version without enabling new
functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/112143
2023-11-08 10:12:05 +01:00
Campbell Barton 944905c394 CMake: mark X11 & openpgl variables as advanced 2023-11-04 16:41:26 +11:00
Campbell Barton 0c91466785 GHOST/Wayland: remove WITH_GHOST_WAYLAND_DBUS
This was only used for accessing cursor themes which only worked
with gnome and wasn't used in official releases.
Use the default theme or the theme defined by XCURSOR_THEME.

Eventually wp_cursor_shape_manager_v1 can be supported which avoids
having to access the theme.
2023-10-07 21:31:15 +11:00
Campbell Barton 1dafc2786f CMake: fix building on macOS 2023-10-07 20:21:52 +11:00
Campbell Barton b434d40dbf CMake: quiet noisy messages on every run
Printing that a library is found every time CMake runs isn't helpful.
Restrict these messages for the first execution so messages are limited
to information developers may need to know such as features being
disabled because of incompatible configurations.
2023-10-07 18:20:30 +11:00
Jeroen Bakker 1aca58cf16 Vulkan: Enable as Experimental Option
This PR enables vulkan backend as experimental option.
It will only be available in alpha builds on Linux and Windows.

This option is highly experimental and enabled to get some insight
on supported platforms. Don't expect a fully working Blender
yet. Also don't expect it to have usable performance.

**What is known to not work?**

* OCIO textures are not supported on Intel and AMD GPUs. sRGB/Standard is supported
  on those platforms.
* AMD Polaris based GPUs on Linux will generate a crash when drawing the 3d cursor as it
  doesn't support the needed vertex format. Comment out `DRW_draw_cursor` in `DRW_draw_region_info`.
* The colors in the node editor and sequencer are of as sRGB viewports aren't detected correctly.
* The image / UV editor isn't working as many texture formats haven't been tested yet. Some
  tweaks are also needed to do correct depth testing.
* 3D Viewport is known to be flickering. Sometimes workbench doesn't display anything.
* 3D Viewport wireframe will crash as it uses a framebuffer with gaps between color attachments,
  which isn't supported yet. (#113141)
* Rotate the view widget is partially drawn due to incompatible depth clipping.
* GPU Selection isn't working. It is expected to be solved when Overlay-Next will become the
  default engine. For now disable GPU depth picking in the preferences.
* Cycles/EEVEE are known to not work with Vulkan yet. Cycles requires Vulkan Pixel Buffer.
   Cuda <-> Vulkan interop might require a different approach than OpenGL as Vulkan doesn't allow
  importing memory from a Cuda context. EEVEE uses features that aren't available yet in the backend
* Workbench is working, except Workbench shadows.
* EEVEE-Next basics are working. Shadows, lights are known to be not working. Materials/Shading
  works in simple scenes. Changes are expected in EEVEE-Next that will break Vulkan compatibility
  in the near future.
* Systems with multiple GPUs is not expected to work.
* Wayland support is in development and requires some iterations. You can start Blender, but
  the protocols are not aligned yet.
* OpenXR hasn't been modified and is expected to fail.
* The backend is very strict when mis-using the GPU module. In debug builds it may crash
  on asserts.
* Older drivers/GPUs might not have all the features that we require. The workarounds
  for the missing features still need to be implemented.

**A word about performance**

In the project planning we focus first on stability and platform support. The performance of Vulkan is
around 20% of what we want to achieve. The reason is that each command sent to the
GPU is done one at a time. The implementation even waits until we have feedback that the GPU
is idle again.

Geometry is currently stored in System RAM. The GPU will read and cache the data when
accessing geometry. This slows down when using objects with much geometry.
Some performance features like MDI (Multi-Draw-Indirect) hasn't been implemented and
falls back to Single Draw Indirect.

**Why enable it is an experimental option?**

* Ensures that new features are being tested with Vulkan
* Ensure that building with Vulkan is possible on supported platforms
* Get feedback from developers if Vulkan can run on their system or that
  there are special cases that we are not aware of. Main development
  environment has been Linux/X11 with occasionally testing using Windows.
* Validate Add-ons that use the `gpu` module.
* Possible to enable GLSL validation on the buildbot. (Needs more work).
* Does it compile on all machines or does it require more changes to cmake
  config. We expect it to be able to compile without installing the Vulkan SDK.
  The Vulkan SDK is a very powerful tool, but only when actually doing GPU
  development. Otherwise it is an overhead which slows down other
  activities.

**How can the backend be enabled?**

Currently the Vulkan backend can be enabled per Blender session by starting
using the command line argument `--gpu-backend vulkan`. In the future, when
the backend is more mature, we will add a user preference to switch between
OpenGL and Vulkan.

Pull Request: https://projects.blender.org/blender/blender/pulls/113057
2023-10-06 15:24:21 +02:00
Campbell Barton 273af6855a CMake: cache the HAVE_BROTLI result
Avoid detecting HAVE_BROTLI every time CMake runs,
only re-detect if the freetype includes change.
2023-10-06 17:58:26 +11:00
Ray Molenkamp 751c9ef620 CMake/MSVC: Fix build error for RelWithDebInfo configuration
CMake decided to link the Debug libs for MaterialX because no specific
RelWithDebInfo configuration was provided, strange default imho but
not difficult to fix.
2023-09-27 18:03:16 -06:00
Brecht Van Lommel 2ed8df333b Fix Hydra not being disabled when USD library not found on Linux 2023-09-26 18:53:05 +02:00
Ray Molenkamp 974bb38c51 CMake: Update platform_win32.cmake with webp 1.3 support
WebP 1.3 changed the library filenames to include a lib prefix and
added an additional library.
2023-09-22 08:59:03 -06:00
Brecht Van Lommel d387ef224f macOS: upgrade to Xcode 15
For Blender 4.0 only, 3.3 and 3.6 keep using the older Xcode version.

The new linker in Xcode 15 gives many warnings due to duplicated
libraries, generated by CMake to resolve circular dependencies. For now
use the old linker to silence these warnings.

Remove legacy flags for libc++, this is the default for a long time and
generates warnings with the new linker.

Reason for upgrade is to take advantage of MetalRT curve support.

Pull Request: https://projects.blender.org/blender/blender/pulls/110243
2023-09-20 16:25:14 +02:00
Brecht Van Lommel 62c898f2e0 Fix (DY)LD_LIBRARY_PATH ignored for oslc and shader builder in build
Accidentally used CMake instead of environment variable.

Pull Request: https://projects.blender.org/blender/blender/pulls/111234
2023-08-30 17:00:02 +02:00
Campbell Barton b8054b0cb2 Cleanup: white-space for UNIX platform error messages 2023-08-24 10:37:52 +10:00
Ray Molenkamp e7c94b35b8 Fix: Missing PDB on windows
Missed one cmake check in 0df3aedfa8
2023-08-19 00:09:19 -06:00
Ray Molenkamp d5e50460e7 CMake/MSVC: Use /debug:fastlink for debug builds
This changes the default linker options for debug builds to use
fastlinking, this causes the PDB only to be usable on the machine
it is being created on, however since debug builds cannot be
distributed to end users (wont run due to missing debug CRT on
their system) this isn't a problem.

This halves the time required for an incremental link on my system
from 7->3.5 seconds
2023-08-18 10:47:47 -06:00
Campbell Barton cfc9473c3f CMake: always define BROTLI_LIBRARIES
Previously FREETYPE_LIBRARIES would sometimes contain
BROTLI libraries, since some configurations set them separately,
declare them separately under all configurations to avoid
changes to one platform breaking others.

Also quiets uninitialized variable warning.
2023-08-17 11:53:58 +10:00
Campbell Barton c713c70781 CMake: quiet uninitialized warnings 2023-08-17 11:53:56 +10:00
Campbell Barton 130af96e6b CMake: quiet case sensitivity warning for Boost_DIR
Quiets warning from CMake policy: CMP0144
2023-08-17 11:53:50 +10:00
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Ray Molenkamp deb4aa88b0 CMake/CPack: Fix windows distribution
the revert in 282944caac was incomplete
this commit restores the missing bits needed to make blender run
again.
2023-08-13 22:21:12 -06:00