Commit Graph

14319 Commits

Author SHA1 Message Date
Sergey Sharybin
06c0bd6699 Merge branch 'blender-v4.3-release' 2024-10-16 16:29:24 +02:00
Alaska
24f2fe4880 Fix: Cycles HIP: Failing volume renders with HIP 6.1
Fix the failing rendering of volumes on Windows with HIP SDK 6.1
by reducing the optimization level.

There should be no functional or performance difference for the average
user as the Blender foundation currently does not use HIP SDK 6.1
on Windows. This change is primarily to fix issues for community members
building Blender locally.

Pull Request: https://projects.blender.org/blender/blender/pulls/128836
2024-10-16 16:28:54 +02:00
Alaska
356482ecb5 Cleanup: Fix ambiguous Unicode character warning in Cycles tree.h
Gitea would complain the apostrophe in one of the code comments in
tree.h was an ambiguous Unicode character. So fix it by swapping it
for a more common apostrophe type.
2024-10-16 21:21:57 +13:00
Xavier Hallade
610f85d9f8 Cycles: use Embree 4.3.3+ rtcGetErrorString to convert error codes 2024-10-15 19:26:04 +02:00
Sergey Sharybin
91eb980891 Merge branch 'blender-v4.3-release' 2024-10-15 11:42:48 +02:00
Mark Stead
dfc58d282b Fix #69731: Cycles: Vector Pass ignores animated FOV
This PR fixes the motion vector values when using animation of the (perspective)
camera focal length (and therefore changing the fov).

Pull Request: https://projects.blender.org/blender/blender/pulls/127442
2024-10-15 11:42:11 +02:00
Xavier Hallade
26edd760bb Merge branch 'blender-v4.3-release' 2024-10-15 10:33:11 +02:00
Xavier Hallade
2cfe69c07d Cycles: Fix error handling of BVH transfer to device
Previously, in case of a failure during BVH transfer, when running out
of memory for example, we could get an error such as "BVH failed to
migrate to the GPU due to Embree library error (no error)", because
embree error status was actually reset before being queried.
This commit fixes its propagation.

Pull Request: https://projects.blender.org/blender/blender/pulls/129022
2024-10-15 10:31:30 +02:00
Jeroen Bakker
399060aa0e Merge branch 'blender-v4.3-release' 2024-10-14 15:45:34 +02:00
Jeroen Bakker
af151e89a7 Fix: Vulkan: Unguarded Access Device Queues
Multiple threads can access the same device queue from different
threads. This could happen when doing a cycles preview render, baking
eevee volume probes or generating material previews.

This PR adds a mutex around access to the device queues.

Detected when researching #128608

Pull Request: https://projects.blender.org/blender/blender/pulls/128974
2024-10-14 15:30:11 +02:00
Campbell Barton
3350eeba62 Merge branch 'blender-v4.3-release' 2024-10-12 22:48:08 +11:00
Campbell Barton
15be0030f6 Cleanup: various non-functional C++ changes
- Avoid shadowing.
- Use default functions.
- Remove unused struct member from GpencilBatchCache.
2024-10-12 22:44:19 +11:00
Alaska
e0cd45d04a Cleanup: Readd important details to Cycles ray offsetting TODO
The ray offsetting triangle tests are not numerically identical to
those found in custom BVH implementations.
There was a TODO to fix this, but there was no explaination for why
it should be done. This fixes that.
2024-10-11 02:41:20 +13:00
Jeroen Bakker
a62fa40b58 Merge branch 'blender-v4.3-release' 2024-10-10 11:28:53 +02:00
Anthony Roberts
ef58d4ae26 Windows: Switch to ProcessorNameString for CPU identification on ARM64
This probably should always have been the value used, really.

Now, instead of reporting `Qualcomm Technologies Inc`, it reports the more informative `Snapdragon(R) X Elite - X1E78100 - Qualcomm(R) Oryon(TM) CPU` on a Thinkpad T14s Gen6 device.

Pull Request: https://projects.blender.org/blender/blender/pulls/128808
2024-10-10 10:37:17 +02:00
Campbell Barton
0cec2462cd Cleanup: remove redundant checks in Wayland drag & drop
Since #128766 was fixed, there is no need for an `in_use` check.
2024-10-10 09:14:25 +11:00
Campbell Barton
930a8b199b Merge branch 'blender-v4.3-release' 2024-10-09 22:37:38 +11:00
Campbell Barton
20756a07cd Fix #128766: crash dropping files with Wayland
Dropping files could crash ~10% of the time on some systems,
although I wasn't able to reproduce the error.

The ownership of GWL_Seat::data_offer_dnd wasn't handled correctly,
where the value could be handled by both wl_data_device_listener::leave
& drop callbacks.

Resolve by ensuring the data-offer is handled by the drop callback.
2024-10-09 22:29:16 +11:00
Campbell Barton
7dc92ab0d1 Merge branch 'blender-v4.3-release' 2024-10-09 15:36:23 +11:00
Campbell Barton
8d7c98a3c8 GHOST/Unix: always use getpwuid for home directory access
getpwuid for accessing home wasn't used when looking up the path
for older Blender versions. There is no reason for the code-paths
to differ. Use a shared utility function to access home.
2024-10-09 15:34:07 +11:00
Clément Foucault
014db2e32e Fix: GPU: Broken GPU subdivision
The file glsl_compute_kernel.glsl is not written
in our safe GLSL. Don't run the preprocessor on it.

Fixes #128735
2024-10-08 17:26:44 +02:00
Campbell Barton
7d33cd9877 GHOST/Wayland: reference the stable tablet-v2 API
The tablet API become stable in wayland-protocol 1.35

NOTE: this was reverted [0] because I missed adding the files to lib.
The files have been included, so use the stable API.

No functional changes expected.

[0]: c525e4db83
2024-10-08 09:37:52 +11:00
Lukas Stockner
11ae08157e Revert Cycles SVM state cleanup due to Mac ARM test timeout
Not sure what is happening here, needs to be checked by someone on Mac.
Let's revert for now, it's not like this is a critical change.

Pull Request: https://projects.blender.org/blender/blender/pulls/110443
2024-10-08 00:33:56 +02:00
Lukas Stockner
0a4877264d Cycles: Cleanup: Move SVM execution state into a helper struct
This packs the SVM stack, current node offset and closure weight into one struct, and just passes that to each SVM node implementation.

This way we don't have to pass the offset back and forth all over the place, and adding additional state (e.g. for layering in the future) becomes easier.

Pull Request: https://projects.blender.org/blender/blender/pulls/110443
2024-10-07 19:09:52 +02:00
Campbell Barton
c1f18be1ba Merge branch 'blender-v4.3-release' 2024-10-07 13:05:28 +11:00
Campbell Barton
6039cb17e6 Unix: use getpwuid() to access home when the variable/tilde expand fails
This was already done in GHOST, but not BKE_appdir_folder_home.

Also null check the return value from getpwuid() as it's not
guaranteed to be non-null.
2024-10-07 13:00:56 +11:00
Lukas Stockner
b8d0bef3b4 Cleanup: Cycles: Consolidate coordinate system conversions
- Deduplicate Fisheye projection code
- Replace spherical/cartesian conversions with shared helpers
- Replace transforms from/to local coordinate systems with shared helpers

The main type of repeated transform that's not covered here is `to/from_coords`, but with separate values for xy and z (e.g. BSDFs that already computed `dot(wi, N)` earlier, so they only need `dot(wi, X)` and `dot(wi, Y)` later). Could also be replaced, but it would feel weirdly specific for a helper function.

Pull Request: https://projects.blender.org/blender/blender/pulls/125999
2024-10-07 02:18:49 +02:00
Xavier Hallade
b614953971 Cycles: oneAPI: fix Linux compilation with fno-honor-nans
Previously, when compiling on Rocky Linux 8 with fno-honor-nans, compile
time was more than 5x longer than expected, and there was an unresolved
symbol to __sqrtf_finite in GPU binaries.
Once defining sqrtf in compat.h, both issues are effectively gone, this
was certainly due to problematic interactions with build system's math
library headers.
So we can remove current workaround of defining fhonor-nans, and now
have the same set of flags on both Windows and Linux.
2024-10-04 17:50:24 +02:00
Sergey Sharybin
d6b44b3a49 Merge branch 'blender-v4.3-release' 2024-10-04 12:40:20 +02:00
Alaska
0709743c0c Fix: Cycles: Rendering of the Principled BSDF when using adaptive kernel compilation
Fixes a issue where the Principled BSDF would render incorrectly if
`__SUBSURFACE__` is off. Which is common when using adaptive kernel
compilation (a unsupported Cycles feature).

Pull Request: https://projects.blender.org/blender/blender/pulls/128003
2024-10-04 12:39:03 +02:00
Clément Foucault
0bfd5e3536 GPU: Add GLSL preprocessor
This splits the GLSL processing into its own file
as it will grow in complexity.

Removes the complexity from `datatoc` and chain them
during the build process.

Rel #128076

Pull Request: https://projects.blender.org/blender/blender/pulls/128261
2024-10-04 11:33:21 +02:00
Sergey Sharybin
fef934c56e Merge branch 'blender-v4.3-release' 2024-10-04 09:58:06 +02:00
Sergey Sharybin
6c3f3a7fb6 Fix: Proper forward declaration for friend class
Turns out it is possible to have code to pick up wrong class
when defining a friend:

```
intern\cycles\device/memory.h(255): warning C4099: 'GPUDevice': type name first seen using 'struct' now seen using 'class'
source\blender\gpu\GPU_platform.hh(69): note: see declaration of 'GPUDevice'
```

Now made it so the classes have forward declaration in the CCL
namespace, avoiding possible conflict with the classes with the
same name in the global namespace.

Pull Request: https://projects.blender.org/blender/blender/pulls/128485
2024-10-04 09:56:54 +02:00
secext2022
528bd239f0 Fix #114210: IME fails with WLROOTS based WAYLAND compositors
Wayland text input could not switch input method.

When using an input method editor (e.g. input Chinese),
switching the input method (e.g. input English -> input Chinese)
during input text was not supported.

Resolve the issue by calling `zwp_text_input_v3_disable` every time
after receiving a `leave` event, and call `zwp_text_input_v3_enable`
every time after receive `enter` event, when text input is enabled.

Ref: !127824
2024-10-04 14:53:30 +10:00
Chris Clyne
5a27280916 EEVEE: Light & Shadow linking
This adds feature parity with Cycles regarding light and shadow liking.

Technically, this extends the GBuffer header to 32 bits, and uses
the top bits to store the object's light set membership index.
The same index is also added to `ObjectInfo` in place of padding bytes.

For shadow linking, the shadow blocker sets bitmask is stored per
tilemap. It is then used during the GPU culling phase to cull objects
that do not belong to the shadow's sets.

Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/127514
2024-10-03 18:41:06 +02:00
Campbell Barton
4fa3dc0dd4 Cleanup: spelling in comments, use uppercase tags 2024-10-03 12:11:52 +10:00
Alexandre Cardaillac
0315eae536 Cycles: Add more scattering phase functions
Previously, Cycles only supported the Henyey-Greenstein phase function for volume scattering.
While HG is flexible and works for a wide range of effects, sometimes a more physically accurate
phase function may be needed for realism.

Therefore, this adds three new phase functions to the code:
Rayleigh: For particles with a size below the wavelength of light, mostly athmospheric scattering.
Fournier-Forand: For realistic underwater scattering.
Draine: Fairly specific on its own (mostly for interstellar dust), but useful for the next entry.
Mie: Approximates Mie scattering in water droplets using a mix of Draine and HG phase functions.

These phase functions can be combined using Mix nodes as usual.

Co-authored-by: Lukas Stockner <lukas@lukasstockner.de>
Pull Request: https://projects.blender.org/blender/blender/pulls/123532
2024-10-02 11:12:53 +02:00
Nikita Sirgienko
fb21f3fb56 Cleanup: Cycles: oneAPI: Fix deprecation warnings about get_pointer() 2024-10-01 22:26:15 +02:00
Jonas Holzman
92d00678ac macOS: Add Image Clipboard Copy/Paste Support
This Pull Request adds support for image clipboard copy-pasting to the Image Viewer on macOS, accepting sources from both raw image data and image files.

Tracking Issue: #111404

Pull Request: https://projects.blender.org/blender/blender/pulls/126574
2024-10-01 18:32:32 +02:00
Jeroen Bakker
71b7dd8079 Vulkan: Remove core 1.2 extensions
Vulkan backend registered extensions that were already part of Vulkan
1.2 core. These extensions don't need to be registered.

Pull Request: https://projects.blender.org/blender/blender/pulls/128408
2024-10-01 13:40:13 +02:00
Kevin Chuang
9f4da19800 Vulkan: Add support for VK_KHR_fragment_shader_barycentric
This PR introduces support for the extension `VK_KHR_fragment_shader_barycentric`,
and includes a few miscellaneous improvements related to it.

1. Add support for `VK_KHR_fragment_shader_barycentric`, if the physical device
  supports it. Otherwise, gpu_BaryCoord is generated through an injected geom
  shader, like it was previously.
2. Simplify the logic of checking has_geometry_stage in vert shader.
3. Fix a potential issue of location mismatch in an injected geom shader.

Related to #127687
Resolves #126228

Pull Request: https://projects.blender.org/blender/blender/pulls/127995
2024-10-01 09:32:59 +02:00
Campbell Barton
6cbdf0223b Cleanup: defer imports on startup 2024-10-01 10:01:16 +10:00
Campbell Barton
c6fd26a3f5 Cleanup: spelling in comments 2024-10-01 09:59:33 +10:00
Xavier Hallade
284b89a0a3 Cycles: oneAPI: compile kernels with fast-relaxed-math
This enables most of the GPU compiler's optimizations while -ffast-math
isn't set at DPC++ level.
It brings an overall 1% speedup and currently doesn't change the unit
tests pass rate.
2024-09-30 21:40:00 +02:00
Lukas Stockner
f96f3c33af Cycles: Add some more math optimizations
This enables three additional math optimizations:
-ffp-contract=fast (enables FMA generation)
-freciprocal-math (enables x/y -> x*(1/y))
-fassociative-math (enables e.g. a*b + c*b -> (a+c)*b)

These are used on Windows and HIP anyways, so our code can't expect exact IEEE
semantics in any case.

The only difference between the new set and -ffast-math is that we don't use
-ffinite-math-only since this causes issues with the BVH (see ce1f2e271d) and
breaks e.g. isnan.

This causes a ~1.5% speedup in my very quick test, but might be higher for some
more math-intensive cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/128342
2024-09-30 15:58:40 +02:00
Lukas Stockner
908d3c387f Cleanup: Cycles: Deduplicate math optimization flags
The only difference between Windows+Clang and the others is a prefix, so use
some CMake logic to just prepend that to all flags instead of duplicating them.

Pull Request: https://projects.blender.org/blender/blender/pulls/128342
2024-09-30 15:58:38 +02:00
Lukas Stockner
5f4c18c0bb Cycles: Apply SSE4.2 minimum regardless of compiler
We require it on all x86 platforms, so now it's assumed on all compilers that
support it.

Pull Request: https://projects.blender.org/blender/blender/pulls/128342
2024-09-30 15:58:36 +02:00
Lukas Stockner
de80c24ed4 Cleanup: Cycles: Rename CYCLES_x_KERNEL_FLAGS to CYCLES_x_FLAGS in CMake
Pull Request: https://projects.blender.org/blender/blender/pulls/128342
2024-09-30 15:58:31 +02:00
Lukas Stockner
442d99fe03 Cleanup: Cycles: Split vectorization and optimization CMake build flags
These aren't really related to each other, and not separating it caused
some issues - for example, enabling NATIVE_ONLY would disable math
optimizations.

Pull Request: https://projects.blender.org/blender/blender/pulls/128342
2024-09-30 15:58:29 +02:00
Lukas Stockner
a8ee5485c2 Cleanup: Cycles: Fix flag name
Pull Request: https://projects.blender.org/blender/blender/pulls/128342
2024-09-30 15:58:27 +02:00