Commit Graph

14641 Commits

Author SHA1 Message Date
Brecht Van Lommel
4786fbe774 Refactor: Remove extern "C" from most headers
The only remaining code in source/blender that must be compiled as C
is now datatoc generated code and the DNA defaults that use designated
initializers.

Pull Request: https://projects.blender.org/blender/blender/pulls/134469
2025-02-13 18:58:08 +01:00
Sergey Sharybin
2050eca8bb Merge branch 'blender-v4.4-release' 2025-02-13 18:43:51 +01:00
Sergey Sharybin
ee8b9a3799 Fix: Adding new objects in HIP-RT rendered viewport errors out
The issue was caused by c0ba800f64.

Simple solution for now: check the data size and free the memory to
allow the device memory to be re-allocated. Seems the safest for the
upcoming release.

Ideally we'd need to avoid having these manual tricks with the device
memory pointers.

Pull Request: https://projects.blender.org/blender/blender/pulls/134516
2025-02-13 18:42:05 +01:00
Campbell Barton
61b2bf4953 Merge branch 'blender-v4.4-release' 2025-02-13 11:23:45 +11:00
Campbell Barton
c83c62439e Cleanup: correct typo 2025-02-13 11:14:50 +11:00
Brecht Van Lommel
68a510fe9b Merge branch 'blender-v4.4-release' 2025-02-12 21:50:28 +01:00
Nikita Sirgienko
2bab4ae370 Cycles: oneAPI: Optimize texture access by using GPU HW sampler
The current usage of software-based texture operations in
the oneAPI implementation puts additional register pressure on
the GPU compiler during register allocation. And it also creates
code that requires maintenance. This commit is intended to address
this situation by utilizing a recently productized SYCL bindless
texture API to enable HW-based texture operations using
Intel GPUs' hardware sampler.

This currently translates to 1-11% rendering speedups (scene-specific)
on my Arc A770 and Arc B580. At the moment, there are small
performance regressions with NanoVDB texture operations on Arc B580
and small performance regressions in shade surface MNEE and Raytrace
kernels on Arc A770, but they look recoverable and will be handled
in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/133457
2025-02-12 21:47:34 +01:00
Nikita Sirgienko
a0b7ad436b Cleanup: Cycles: oneAPI: Switch to non-experimental work item API
There is now a non-experimental API for this_work_item functionality, so
let's use it for better code quality and also to avoid the deprecation
warning during compilation.

No functional or performance changes are expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/133472
2025-02-12 21:46:22 +01:00
Xavier Hallade
89f70855e0 Cycles: oneAPI: Enable kernels compression
This is done using zstd with compression level 19 so it's aligned with
the other backends that had it enabled in
4bde68cdd6.

Pull Request: https://projects.blender.org/blender/blender/pulls/134049
2025-02-12 21:45:16 +01:00
Brecht Van Lommel
416d2c6115 Merge branch 'blender-v4.4-release' 2025-02-12 17:26:38 +01:00
Brecht Van Lommel
44e9e3bfb2 Fix: Build error with latest MSVC 2022 2025-02-12 17:18:55 +01:00
Bastien Montagne
e6f495bf97 Cleanup: OCIO intern wrapper: Use MEM_new.
Existing code was essentailly doing same thing as `MEM_new`, can as well
use that one directly.
2025-02-12 15:01:19 +01:00
Sean Kim
a2b75c87c8 Merge branch 'blender-v4.4-release' 2025-02-11 14:10:10 -08:00
Sergey Sharybin
a535a1a027 Fix #132782: MetalRT: Missing Geometry in Cycles preview on MacOS 15.2
The issue also happens on macOS 15.3.

This is a Metal driver bug, a fix is coming in macOS 15.4. Until then
disable refitting the viewport. There is no perceptible benefit from
refitting, so while it might be less that ideal it allows to side step
the problem and still benefit from the HWRT.

Pull Request: https://projects.blender.org/blender/blender/pulls/134399
2025-02-11 21:42:38 +01:00
Brecht Van Lommel
2c34786474 Merge branch 'blender-v4.4-release' 2025-02-11 20:43:17 +01:00
Brecht Van Lommel
529ce46744 Fix: Cycles silently ignores unknown --cycles--device type
Pull Request: https://projects.blender.org/blender/blender/pulls/134354
2025-02-11 20:42:21 +01:00
Brecht Van Lommel
9ad19396f5 Fix: Cycles Metal invalid storage mode check
Pull Request: https://projects.blender.org/blender/blender/pulls/134337
2025-02-11 20:42:01 +01:00
Brecht Van Lommel
21a90f26b6 Cleanup: Fix C++20 deprecation warnings in Cycles
Pull Request: https://projects.blender.org/blender/blender/pulls/134338
2025-02-11 16:42:03 +01:00
Brecht Van Lommel
ff6ec94226 Merge branch 'blender-v4.4-release' 2025-02-10 19:56:17 +01:00
Brecht Van Lommel
f63c192543 Fix: Cycles OptiX with OSL 1.14 failure in some render tests 2025-02-10 19:34:24 +01:00
Brecht Van Lommel
2f44765bc8 Merge branch 'blender-v4.4-release' 2025-02-10 16:52:04 +01:00
Brecht Van Lommel
d9ea0e0a29 Fix: Cycles oneAPI kernel not rebuilding when the compiler is updated
This is not a complete solution because there may be indirect changes
to the compiler other than the binary that require a rebuild, but this
should catch the simple cases at least.
2025-02-10 16:41:10 +01:00
Weizhen Huang
b76fbb285e Cycles: Change the integration measure in Huang Hair from gamma to h
To align better with the pixel and reduce the samples needed.

The paper was using gamma because the jacobian |d_gamma/d_h| approaches
infinity at the boundaries, but it seems that clamping at 0.999 is
enough for numerical stability.

In practice I did not notice a change in the noise level, but it
simplifies the range computation and renders faster due to reduced
sample amount.

Co-authored-by: Olivier Maury <omaury@meta.com>

Ref: !129616

Pull Request: https://projects.blender.org/blender/blender/pulls/134130
2025-02-10 14:58:26 +01:00
Sergey Sharybin
4e9f85b76f Merge branch 'blender-v4.4-release' 2025-02-10 14:55:57 +01:00
Patrick Mours
5810c94f95 Cycles: Add Blackwell to Cycles CUDA binaries architectures
Enables building of a Cubin for GPUs based on Blackwell architecture
if CUDA toolkit version 12.8 or higher is installed.
Only added sm_120 to the default set, since it is the one relevant for
consumer GPUs (RTX 5090 etc.) that are generally used with Blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/134170
2025-02-10 14:55:28 +01:00
Campbell Barton
e659e87a67 Cleanup: cmake formatting, sort file lists 2025-02-10 19:40:06 +11:00
Alaska
a32b8b546d Merge branch 'blender-v4.4-release' 2025-02-08 01:25:00 +13:00
Alaska
3791001b1c Fix: Object info random on lights do not work in Cycles OSL
This commit adds the `light:random` attribute to OSL, allowing the
object info node to now match between SVM and OSL when using the
random output on a light.

Pull Request: https://projects.blender.org/blender/blender/pulls/134095
2025-02-07 13:23:51 +01:00
Hans Goudey
54dc692d7b Refactor: Use StringRef for attribute API and BMesh CustomData functions
Replace `const char *` with `StringRef` for the API in `BKE_attribute.h`.
The benefits are slightly simpler code and possibly slightly improved
performance through avoiding the need to measure string length.

Pull Request: https://projects.blender.org/blender/blender/pulls/134183
2025-02-06 21:38:19 +01:00
weizhen
19fa8e5e77 Merge branch 'blender-v4.4-release' 2025-02-06 18:44:04 +01:00
weizhen
0f8eed340e Fix: Cycles: Compilation issue with OSL on GPU 2025-02-06 18:42:46 +01:00
Weizhen Huang
1d24c8c927 Merge branch 'blender-v4.4-release' 2025-02-06 16:24:16 +01:00
Weizhen Huang
b26221a06a Fix #74979: Cycles: Support Normal texture for bump mapping on triangles
The derivatives of the normal were simply not computed.

The offsetted normals are computed by perturbating the barycentric
coordinates. At triangle boundaries, the normals are extrapolated,
so discontinuities might be visible.

Currently only supported on triangles.

Pull Request: https://projects.blender.org/blender/blender/pulls/133769
2025-02-06 16:22:19 +01:00
Aki Sakurai
c551d2a819 Fix: Inverted tablet pen Y tilt on macOS
On macOS, the tablet pen Y tilt behavior is inverted; an increase in the
tilt value corresponds to tilting the device away from the user. Account
for this difference by negating the Y tilt axis in the Cocoa pen tablet
handling code.

Refs:
* 0f128fd7c5/src/plugins/platforms/cocoa/qnsview_tablet.mm (L63)
* https://source.chromium.org/chromium/chromium/src/+/main:components/input/web_input_event_builders_mac.mm;drc=0af5ffa1e4cc4cc4f818725f8fee93ec57855e4b;l=421

Pull Request: https://projects.blender.org/blender/blender/pulls/133932
2025-02-06 11:20:31 +01:00
Hans Goudey
93ab2813a7 Cleanup: Remove unnecessary "using" statements 2025-02-05 18:27:43 -05:00
Weizhen Huang
8e4d5a47d7 Cleanup: Cycles: add utility function is_circular() for Huang Hair
Pull Request: https://projects.blender.org/blender/blender/pulls/134129
2025-02-05 18:44:04 +01:00
Weizhen Huang
f22bfc46d1 Cleanup: Cycles: use utility struct Interval to improve readability 2025-02-05 18:44:03 +01:00
Harley Acheson
9b77148298 Merge branch 'blender-v4.4-release' 2025-02-05 08:19:13 -08:00
Harley Acheson
3f4a1cabbf UI: On Win11 Use WM Window Decoration Styles API
On Windows 11 use the new WM Window Decoration Styles API, introduced
in ce42d92503. This will match the OS Title bar color to  that of the
main window top bar and also do similar color matching with content
in separate windows like Preferences. Note that this will not have any
effect on versions of Windows prior to 11.

Pull Request: https://projects.blender.org/blender/blender/pulls/134054
2025-02-05 17:15:35 +01:00
Weizhen Huang
b0e3cd14ff Cleanup: Compiler warning
use reference type `BL::ID &` to prevent copying
2025-02-05 16:28:14 +01:00
Nikita Sirgienko
bee534eea5 Build: Upgrade Intel Graphics Compiler to 2.1.14 on Linux
This corresponds the latest rolling 2448.13 release:
https://dgpu-docs.intel.com/releases/packages.html?release=Rolling+2448.13&os=Ubuntu+24.04

Graphics compiler upgrades require increasing the minimum required
driver (compute-runtime) version to the corresponding one to guarantee
compatibility, which is XX.XX.31740.15 in this release, so we bump this
requirement accordingly.

Co-authored-by: Xavier Hallade <me@ph0b.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/134051
2025-02-05 15:00:04 +01:00
Weizhen Huang
d2db9927ed Fix #86648: reduce ray differentials size for bump mapping
Use sub-pixel differentials for bump mapping helps with reducing
artifacts when objects are moving or when textures have high frequency
details.

Currently we scale it by 0.1 because it seems to work good in practice,
we can adjust the value in the future if it turns out to be impractical.

Ref: #122892

Pull Request: https://projects.blender.org/blender/blender/pulls/133991
2025-02-05 13:39:27 +01:00
Weizhen Huang
f4e4f19af2 Cleanup: Cycles: improve comments and variable names of bump-related functions
- Rename dx/dy -> dfdx/dfdy to match the actual computed quantity
- Add template functions to compute dfdx/dfdy on triangles for sharing
  among different data types
- Add documentation to some functions
- Some code shuffling that makes it easier to scale dfdx/dfdy in the
  future
- Some other trivial changes
2025-02-05 13:39:27 +01:00
Campbell Barton
4669e0f1ab Fix UNIX NDOF state being start/finish during continuous motion
Logic to ensure finish events were sent wasn't working properly
because processing the events could run before the SPNAV API had
filled the event queue.

Resolve by adding a delay of 100ms, before generating a "finish" event.

For the user this caused the NDOF Guide to flicker while navigating.
2025-02-05 22:03:02 +11:00
Campbell Barton
613e34b559 Docs: cross reference progress enum for GHOST/WM API's
Note that these enums need to be kept in sync.
2025-02-05 21:53:52 +11:00
Campbell Barton
df3d1bf506 Cleanup: use const arguments & variables where appropriate 2025-02-05 14:38:56 +11:00
Campbell Barton
bc6dc89d50 Cleanup: quiet check_spelling_* warnings, use doxygen doc-strings 2025-02-05 10:29:00 +11:00
Alex
c6d7bee181 Cycles: Burley diffuse closure for MaterialX compatibility
Add Burley diffuse to OSL for MaterialX compatibility. It is OSL only and
isn't a closure that will be looked for in SVM.

Pull Request: https://projects.blender.org/blender/blender/pulls/133845
2025-02-04 19:38:56 +01:00
Brecht Van Lommel
f80f97ca0d Refactor: Cycles: Rename rcp to reciprocal
To avoid symbol conflicts with upcoming HIP changes. Also remove
unused implementations for float4 and float8.

Pull Request: https://projects.blender.org/blender/blender/pulls/134045
2025-02-04 18:59:24 +01:00
Jonas Holzman
ce42d92503 macOS: Colored Titlebar and WM Window Decoration Styles API - GSoC 2024
As part of the GSoC 2024 project "Improvements to the Blender macOS User
Interface Experience" [1], this patch implements colored titlebar window
decorations on macOS, based on the current Blender theme colors.

Additionally, this patch introduces a new WM/GHOST API for implementing
and enabling custom decoration styles on any system/desktop environment
that support customizing window decorations.

[1]: https://devtalk.blender.org/t/gsoc-2024-proposal-improvements-to-the-blender-macos-user-interface-experience/34022)

Pull Request: https://projects.blender.org/blender/blender/pulls/123982
2025-02-04 16:18:19 +01:00