Commit Graph

15148 Commits

Author SHA1 Message Date
Brecht Van Lommel
63cfc32dea Merge branch 'blender-v4.5-release' 2025-07-08 14:56:00 +02:00
Brecht Van Lommel
ba5cf35d2a Fix #141381: Cycles unnecessary re-subdivision with persistent data
Pull Request: https://projects.blender.org/blender/blender/pulls/141605
2025-07-08 14:55:30 +02:00
Campbell Barton
7b98f19afb Merge branch 'blender-v4.5-release' 2025-07-08 20:35:16 +10:00
Lukas Stockner
71cdb55953 Fix #140562: Cycles crash with texture in custom camera with SVM on GPU
After spending way too much time looking into the image handle code
because I assumed the issue is some interaction between OSL code using
a texture and the image system that's in SVM mode (which never happened
before the custom camera) with printf debuggine because OptiX doesn't
work in debug builds, it turns out the issue was something else entirely:
C++ iterator bullshit.

Specifically, when we remove an entry from services->textures, this
invalidates the iterator, so the code restarts from the beginning.
However, the for-loop still increments the iterator *before* checking
the termination criterion.
If we remove the only element of the map, we:
- Set it = map.begin(), which equals map.end() since it's empty now
- Increment it at the end of the loop iteration
- Compare it == map.end(), which is wrong now since we're past the end

No idea how this didn't blow up sooner, none of this seems camera-specific??
Anyways, the fix is simple - only increment if we didn't restart.

Pull Request: https://projects.blender.org/blender/blender/pulls/141580
2025-07-08 11:51:22 +02:00
Campbell Barton
542503ddf2 Cleanup: format 2025-07-08 18:01:57 +10:00
Campbell Barton
c0e9edd70c Refactor: minor changes to prepare for Hi-DPI custom cursors on Wayland 2025-07-08 17:22:26 +10:00
Campbell Barton
439253eab5 Cleanup: use consistent terms in capability flags
Consistently use terms "cursor" & "clipboard" as a prefix
so they auto-complete more usefully.

Previously both ordering was used.
2025-07-08 16:35:42 +10:00
Campbell Barton
3ae7ba1255 GHOST/Wayland: use wl_surface_damage_buffer when available
Also damage the entire buffer, there is no reason to clamp this
to the buffer bounds.
2025-07-08 16:35:42 +10:00
Campbell Barton
f2b01dbcb8 Cleanup: order capability flags as defined
When setting GHOST capability flags, use the order they are defined
to make the code easier to follow when manually updating.
2025-07-08 11:04:39 +10:00
Lukas Stockner
bfcfe730ed Cleanup: Cycles: Move F82 Fresnel model into helper function 2025-07-08 01:23:33 +02:00
Campbell Barton
0ec2878cb6 Fix crash freeing cursors in Wayland
Regression in [0] missed clearing the mask when setting RGBA cursors.

[0]: 7b02b813f8
2025-07-08 08:09:04 +10:00
Harley Acheson
4fe0e788a9 Merge of blender-v4.5-release 2025-07-07 10:17:56 -07:00
Pratik Hadawale ~ sake :)
f090572ca8 Fix #141158: Fullscreen startup file causes white flicker with Vulkan backend
When launching Blender via blender-launcher.exe, the window briefly
displays incorrectly on startup when using the Vulkan backend. This is
caused by not properly handling the GHOST_kWindowStateFullScreen case.

Previously, even if the window state was set to fullscreen, nCmdShow
would default to SW_SHOWNORMAL or SW_SHOWNOACTIVATE. With this fix,
nCmdShow is explicitly set to SW_SHOWMAXIMIZED when the window is in
fullscreen state, preventing the flicker.

Pull Request: https://projects.blender.org/blender/blender/pulls/141518
2025-07-07 19:12:59 +02:00
Alaska
a6f92974ac Cycles: Allow Metal to print GPU Queue stats
When running Blender with `--debug-cycles` and the right
verbosity level, Cycles can output "GPU Queue Stats" to the terminal
at the end of rendering detailing how much time was spent in each kernel.

The Metal GPU backend did not support this specific way of gathering the
information. This commit fixes that by implementing support to the Metal
GPU backend.

Note: This kind of information could already be gathered for the Metal
GPU backend using the `CYCLES_METAL_PROFILING` environment variable,
and this is still the recommended way of gathering that information for
Metal. This change is just to add some consistency between platforms.

Pull Request: https://projects.blender.org/blender/blender/pulls/137592
2025-07-07 16:16:37 +02:00
Jeroen Bakker
b617c6d825 Merge branch 'blender-v4.5-release' 2025-07-07 11:20:46 +02:00
Jeroen Bakker
f40e6e8a60 Fix: Vulkan: Use feature struct
Detected an incorrect structure type. A property struct was used to
store feature data. This could lead to incorrect values for enabling
descriptorBufferPushDescriptor, what isn't used.
2025-07-07 11:14:09 +02:00
Campbell Barton
97612fd8ef Cleanup: add missing license header
Add license header, removed in !139923.
2025-07-05 08:50:25 +10:00
Harley Acheson
7580da6bd2 UI: Removal of Win32 Platform-Specific Cursor Files
We are now able to make antialiased mouse cursors at any size directly
from SVG sources. Therefore there is no need for the platform-specific
"cur" versions of these cursors. This removes the work required in
duplicating the cursors in this format. Otherwise the results should be
identical.

Pull Request: https://projects.blender.org/blender/blender/pulls/141309
2025-07-05 00:39:50 +02:00
Campbell Barton
c2c8f54a52 Merge branch 'blender-v4.5-release' 2025-07-04 09:19:25 +10:00
Jorn Visser
94f4df8ec4 Fix #141339: Mantaflow: Clear Python errors when grids aren't available
Adding a Flow to a Mantaflow domain could sometimes cause a crash. This
was because the grids are allocated lazily, and as such, getting them
through `PyObject_GetAttrString` will fail when they are not yet
available. As the resulting Python errors were not cleared, Python could
be left in a bad state, leading to crashes. This is avoided by clearing
these errors before returning from `callPythonFunction` when such an
error is raised.

Ref !141364
2025-07-03 23:17:25 +00:00
Jonas Holzman
95abfc00a5 Merge branch 'blender-v4.5-release' 2025-07-03 00:07:52 +02:00
Jonas Holzman
b0ffd4cb07 Fix: macOS: Support multi-monitor window positioning
This commit brings multi-monitor window positioning support to the macOS
GHOST backend. This fixes a plethora of issues with macOS window
creation and positioning, such as:

 * Windows not being properly restored when loading a file with Load UI
 * Users default startup windows not being properly restored on multiple
   screens
 * Temporary windows (Settings, Render, Playblast, etc..) wrongly
   appearing in unexpected places / other screens
 * Duplicating an area into a new window (AKA popping out an editor) not
   working on non-primary screens.
 * etc..

Internally, this makes all macOS windows coordinates be relative to the
user primary monitor, instead of being local to the currently focused
one. I have tested this to properly work using all sorts of multiple
screen arrangements, and can also confirm that restoring windows from
screens that do not exist anymore / are now out of bounds (due to being
unplugged or re-arranged) also works properly, in which case they get
snapped back to the closest available screen similarly to other backends.

This fixes issue #126410 and implements behavior described in TODO task #69819.

Pull Request: https://projects.blender.org/blender/blender/pulls/141159
2025-07-03 00:05:52 +02:00
Campbell Barton
3d15acee1f GHOST/Wayland: correct tablet serial argument for setting cursors
While the previous logic tended to work as it would use the serial
for the last active table event - follow the spec and and always pass
in the serial for the proximity_in event.
2025-07-02 23:13:29 +10:00
Campbell Barton
53a5eef579 Cleanup: minor tweaks to ghost cursor internals
- Use the typed enum for wayland cursor ID's.
- Return an std::optional<...> for cursor access,
  with std::nullopt when the cursor doesn't have an equivalent value
  from ghost.
- Add "stub" calls to `update_cursor_scale` where removed as part of
  !140366 but will be needed when custom cursors support updating
  based on output scale.
2025-07-02 21:34:27 +10:00
Sergey Sharybin
9ace788faf Merge branch 'blender-v4.5-release' 2025-07-02 10:42:01 +02:00
Michael Jones
681eed7e4d Fix #135659: Some types of motion are incorrect at low step counts with MetalRT
Following #136253, this PR enables decomposed MetalRT motion
interpolation on macOS 15.6. The bounding box issue is fixed
in the latest macOS 15.6 beta (24G5054d).

Pull Request: https://projects.blender.org/blender/blender/pulls/141207
2025-07-02 10:41:42 +02:00
Hans Goudey
1f92fd7577 Refactor: Use AttrType instead of CustomData type in attribute API
Change `eCustomDataType` to `bke::AttrType` for uses of the attribute
API (the `AttributeAccessor` one anyway). I didn't touch any values that
might be saved in files; those should be handled on a case by case basis.

Part of #122398

Pull Request: https://projects.blender.org/blender/blender/pulls/141301
2025-07-01 22:14:26 +02:00
Sebastian Parborg
232b106e64 GHOST: Implement the cursor shape protocol and remove X11 cursors from the wayland backend
This makes the the cursor drawing be handled by the Wayland compositor
unless the cursor shape is not in the standard cursor shape set.
For custom cursor shape, Blender still manually draws and handles these.

Removal of the X11 cursors was done because:
1. Greatly simplifies the code (and compositors not supporting the cursor
    shape protocol will fallback to Blenders built in cursors).

2. On a lot of compositors the X11 cursor theme is not set per default,
       this would lead to us falling back to a default theme. This would
       in almost all cases not match the actual cursor theme of the user.
       The fallback theme would also look quite ugly and the cursor size
       would be inconsistent with the rest of the system.

Pull Request: https://projects.blender.org/blender/blender/pulls/140366
2025-07-01 15:16:44 +02:00
Thomas Dinges
61d51a5643 Cleanup: Make format 2025-07-01 15:14:37 +02:00
Thomas Dinges
b6b90d6835 Cleanup: make format 2025-07-01 15:12:26 +02:00
Sergey Sharybin
e01ca1fdae Merge branch 'blender-v4.5-release' 2025-07-01 14:25:40 +02:00
Michael Jones
03183c3328 Fix #135194: Deleting the last object in a scene leaves it visible in the viewport with MetalRT
TLAS wasn't being refreshed when empty.

This PR removes a spurious early-exit during BVH build that was preventing
the TLAS from being recreated when it was empty.

Pull Request: https://projects.blender.org/blender/blender/pulls/141215
2025-07-01 14:25:09 +02:00
Aras Pranckevicius
293cdac6ab Merge branch 'blender-v4.5-release' 2025-07-01 11:53:30 +03:00
Damien Picard
301274f398 I18n: Translate user preferences GPU device tooltips
GPU devices can only be selected in the user preferences if a suitable
device is available. This uses a dynamic enum and the items are not
always defined in RNA, so they need to be extracted manually using
`n_()`.

Also rephrase one message slightly to respect the style guide
("Don't" -> "Do not").

In addition, fix my mistake where an import was mixed up
(`pgettext_tip` was imported as `n_`).

Pull Request: https://projects.blender.org/blender/blender/pulls/141244
2025-07-01 10:47:10 +02:00
Campbell Barton
bfd3ff7e3d Cleanup: use const custom cursor arguments to GHOST
Also use int[2] for size & hot-spot arguments to avoid passing
around so many arguments.
2025-07-01 15:22:38 +10:00
Campbell Barton
5bdc6df9d1 Cleanup: de-duplicate doc-strings in GHOST
Move doc-strings to GHOST's "implementation" classes,
use `\copydoc` to reference them from classes in `intern`.

Doc-strings were copied between the classes, but had gotten out of sync
or only ever existed in one of the files.
2025-07-01 13:33:54 +10:00
Campbell Barton
7b02b813f8 GHOST/Wayland: support RGBA custom-cursors 2025-07-01 03:01:25 +00:00
Harley Acheson
ac457b9836 UI: SVG Icons as Internal Custom Mouse Cursors
This PR replaces our current custom mouse cursors (defined in
wm_cursors.cc using bitmaps and masks that we edit with a python
program) with SVG sources that are rasterized at the exact size when
needed. For Windows this would also replace the 29 platform-specific
"cur" files, although this PR does not actually remove those. For Linux
this creates the same kind of cursor as now (1bpp XBitMap) but at a
better size.

Pull Request: https://projects.blender.org/blender/blender/pulls/140990
2025-07-01 04:59:49 +02:00
Alaska
fe346a32ec Cycles: Disable HIP RT by default in Blender 4.5
At the moment there are two main usability issues that make it hard to
recommend to enable HIP RT by default:
- Dramatically increased memory usage during BVH construction on
  high poly meshes compared to BVH2 (#136174)
  - This issue can be fixed by using the "balanced" HIP RT BVH, but
  it requires a HIP RT update that won't make it into 4.5 (!136622)
- Many Blender and GPU driver crashes when modifying objects in the
  viewport. #140763, #140738, #139013, #138043

Pull Request: https://projects.blender.org/blender/blender/pulls/140794
2025-06-30 18:17:01 +02:00
Xavier Hallade
6e4c82e804 Merge branch 'blender-v4.5-release' 2025-06-30 16:40:46 +02:00
Xavier Hallade
7691e6520b Fix #141171: oneAPI: Rendering artifacts in barbershop scene
max_shaders was not updated when Embree was disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/141175
2025-06-30 16:39:53 +02:00
Campbell Barton
5e927eae1b Docs: corrections, clarifications to code-comments 2025-06-28 10:46:57 +10:00
Brecht Van Lommel
85890fb3b7 Merge branch 'blender-v4.5-release' 2025-06-28 00:06:31 +02:00
Brecht Van Lommel
9711efece7 Fix #141085: Cycles adaptive subdivision crash with zero length edges
As produced by booleans in the reported blend file.

Pull Request: https://projects.blender.org/blender/blender/pulls/141105
2025-06-28 00:03:45 +02:00
Julian Eisel
4b2d60a2c3 Ghost: Make special user directory query thread safe
Similar to e0ff7731e0.

Noticed a data race when working on blender/blender!130543, which calls
this function from a thread. Make this thread safe by avoiding returning
of static memory, instead use an optional `std::string`.

Pull Request: https://projects.blender.org/blender/blender/pulls/141083
2025-06-27 15:16:35 +02:00
Jeroen Bakker
e058e4f8ca Merge branch 'blender-v4.5-release' 2025-06-27 11:28:54 +02:00
Jeroen Bakker
a74b663bf9 Cleanup: Vulkan: Enable extensions (2)
Missing part of the cleanup done by 225449b96d
2025-06-27 11:26:24 +02:00
Jeroen Bakker
f957d132e7 Merge branch 'blender-v4.5-release' 2025-06-27 10:51:30 +02:00
Jeroen Bakker
225449b96d Cleanup: Vulkan: Enable extensions
When the list of extensions is constructed for `vkCreateDevice` it
uses a function that retrieves all extensions just to iterate to
check a specific extension is supported. However there is already a
list cached that is that is the subset of the desired extensions that
are supported by the device.

This cleanup will use that list instead of requiring all supported
extensions.

Pull Request: https://projects.blender.org/blender/blender/pulls/141074
2025-06-27 10:50:58 +02:00
Jeroen Bakker
fc8a617687 Merge branch 'blender-v4.5-release' 2025-06-27 08:59:25 +02:00