Commit Graph

13860 Commits

Author SHA1 Message Date
Campbell Barton
1f44a74947 Fix inverted table wheel on wayland
The tablet wheel direction matches the mouse wheel which also needed
to be inverted.
2024-04-15 11:39:04 +10:00
Campbell Barton
1e6716a903 Fix inverted mouse wheel on wayland after recent changes
Recent change from [0] inverted mouse wheel direction.

[0]: c9a79f9a3c.
2024-04-15 11:06:47 +10:00
dupoxy
1079f0918e Cleanup: use function style cast in MAKE_ID macro
Ref: !120630
2024-04-14 23:08:45 +10:00
Campbell Barton
b405bb3268 GHOST/Wayland: constrain new window size on startup with XDG-decor
On KDE, running "blender -w" (windowed with borders) created window
which was too big: the window contents matched the screen-size
causing the window decorations be outside the screen-bounds.

Un-maximizing the default startup file would also move window to the
same over-sized location.

Resolve by clamping the size of new windows to the requested bounds.
2024-04-14 22:19:24 +10:00
Jacques Lucke
0a192c5da4 Cleanup: fix compilation
Missing from e27889dc12.
2024-04-14 10:50:54 +02:00
Campbell Barton
c9a79f9a3c WM: handle multiple wheel events from GHOST
Scrolling the mouse wheel fast can generate multiple click-steps
which were ignored by window manager events.

This meant scrolling fast with a trackpad (with "Multi-touch gestures"
disabled) for e.g. would zoom less than the gesture made more slowly.
2024-04-14 17:55:20 +10:00
Campbell Barton
c4745a24b2 GHOST/Wayland: bump xdg_toplevel_listener version from 1 to 6 2024-04-14 17:55:17 +10:00
Campbell Barton
cc9edd2d35 GHOST/Wayland: bump zxdg_output_manager_v1 version from 2 to 3 2024-04-14 17:55:15 +10:00
Campbell Barton
dcec5ce635 GHOST/Wayland: bump wl_compositor_interface version from 3 to 6 2024-04-14 17:55:14 +10:00
Campbell Barton
6689053e43 GHOST/Wayland: bump wl_output_listener version from 2 to 4 2024-04-14 17:55:13 +10:00
Campbell Barton
8d86fb43a4 GHOST/Wayland: bump wl_seat_interface version from 5 to 9
This ensures callbacks are called to detect "natural" scroll direction
on the touch-pad, see: #107676.
2024-04-14 17:55:11 +10:00
Campbell Barton
98cb5da6d1 GHOST/Wayland: add an interface version clamping macro
This macro makes it convenient to define a supported version range for
an interface.

Uncommenting USE_VERBOSE_OLD_IFACE_PRINT prints when newer versions
of an interface are supported by the compositor which Blender could
be updated to support.

This makes it more convenient to bump interface versions as they
become available so bumping multiple versions at once doesn't
cause unexpected changes in behavior as happened with #120587.
2024-04-14 17:55:10 +10:00
Campbell Barton
df87770ca1 GHOST/Wayland: resolve mouse wheel being treated like touchpad scroll
Resolves the issue reported in #120587, which occurred when bumping the
supported version of the seat API to 9.

Smooth scrolling values were set in without calling the discrete step
callback. Resolve by calculating discrete values from the:
wl_pointer_listener::axis_value120 handler.

The functional changes from this commit only apply once the version
of the seat API is increased - which isn't part of this commit.
2024-04-14 17:55:09 +10:00
Campbell Barton
e27889dc12 Cleanup: use const references for GWL_RegistryHandler parameters 2024-04-14 17:54:59 +10:00
Campbell Barton
dce8668b1f GHOST/Wayland: use discrete zoom steps with multi-touch disabled
This matches behavior on macOS as well as the property description.

On Wayland, smooth scrolling doesn't use the touchpad API,
so disabling multi-touch gestures doesn't change the behavior as it
does on macOS.

Resolve by converting vertical touch scrolling to mouse-wheel events.
2024-04-14 14:56:30 +10:00
Campbell Barton
f12d20a819 Cleanup: always reset discrete mouse-wheel
A correctness issue, this didn't cause any bugs.
2024-04-14 14:23:36 +10:00
Campbell Barton
a70d6d79dd Cleanup: various non-functional C++ changes 2024-04-14 12:24:17 +10:00
Campbell Barton
6e3eaae299 Cleanup: spelling in comments 2024-04-14 12:13:55 +10:00
Campbell Barton
bf3ca83df9 Cleanup: use C-style comments for descriptive text in GHOST/Cocoa 2024-04-14 09:40:19 +10:00
Clément Foucault
d1d90ecbec Cleanup: MEM: Remove outdated comment 2024-04-12 18:01:26 +02:00
Clément Foucault
60a3d85b88 MEM: Make MEM_cnew return aligned memory
Now made it so that `MEM_cnew()` can be used for types with any
alignment.

Fixes #120407.

Pull Request: https://projects.blender.org/blender/blender/pulls/120569
2024-04-12 17:52:27 +02:00
Hans Goudey
30c3f8eafb Revert "Fix #107676 detection of "natural" touchpad scrolling on Wayland"
This reverts commit af88ff0484.

That commit broke scrolling (at least in some cases).
Reverting the commit resolves #120587
2024-04-12 11:47:03 -04:00
Sergey Sharybin
a4b36cd0d5 Guarded allocator: Ensure alignment and size of MemHead
Ensure that the MemHead and MemHeadAligned are such that memory
allocation followed with the head offset keeps the allocation
aligned to at least MEM_MIN_CPP_ALIGNMENT.

Pull Request: https://projects.blender.org/blender/blender/pulls/120582
2024-04-12 17:22:46 +02:00
Sergey Sharybin
fac451e513 Cleanup: Convert guarded allocator to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/120577
2024-04-12 16:44:49 +02:00
Campbell Barton
af88ff0484 Fix #107676 detection of "natural" touchpad scrolling on Wayland
The callback to set the relative direction wasn't running because
it required GHOST to request version 9 of the wl_seat_interface.

Natural touchpad events now work for KDE 6 and recent versions
of WLROOTS based compositors, GNOME 46 is uses wl_seat_interface
version 8 which still wont work.
2024-04-13 00:18:21 +10:00
Campbell Barton
72e6191c89 PyAPI: include a filepath in preset pre_cb/post_cb callbacks
This is needed so the presets path can be stored in the theme,
so it's possible to keep track of the current theme.

Needed for fixing #120289.
2024-04-12 13:21:42 +10: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
Sergey Sharybin
56cbde568b Fix #120046: Broken render on AMD Metal GPUs
This is a regression since fdc2962beb

The size of state can not be different between CPU and GPU.

This change replaces compile-time condition with a kernel feature
check, which solves the render regression on AMD Metal. It also
minimizes the state size on other GPUs when Light Tree is disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/120476
2024-04-11 10:51:45 +02:00
Campbell Barton
09ee8d97e6 Cleanup: use C-style comments for descriptive text 2024-04-11 17:44:27 +10:00
Alaska
eff4fe24cf Cycles: Properly default to Metal-RT off unless GPU is a M3 or newer
Ever since commit [1], `use_metalrt_by_default` will be True
if the GPU being used is not a M1 or M2 based system.
The intention of this was to enable MetalRT by default for
M3 and newer devices that have hardware for ray traversal.

However the side effect of this change was that all AMD GPUs would
have `use_metalrt_by_default` set to True. Which appears to be the
main culprit causing crashes on older AMD GPUs in #120126.
Since these GPUs don't support MetalRT.

This commit fixes this issue by only setting
`use_metalrt_by_default` to True if the GPU is not M1 or M2 based,
and the GPU is Apple Silicon based. Which equates to M3 or newer.
Which is the original intent of this code.

This resolves the issue where AMD GPUs were being told to use MetalRT
by default, when they shouldn't be.

[1] 322a2f7b12

Pull Request: https://projects.blender.org/blender/blender/pulls/120299
2024-04-09 16:19:24 +02:00
Campbell Barton
e01525cf2c Cleanup: remove redundant variables & assignments
Co-authored-by: Sean Kim <SeanCTKim@protonmail.com>
2024-04-09 13:52:41 +10:00
Campbell Barton
6b14b67a29 Cleanup: spelling in comments 2024-04-08 16:23:25 +10:00
Campbell Barton
01187dfc8e GHOST: add missing check for end full-screen failing 2024-04-08 12:03:01 +10:00
Sergey Sharybin
958bc91867 Fix #120308: GP3 objects with geonodes renders original data from CLI
The issue was caused by the special code in Cycles which clears object
caches when it thinks they are not needed. We should not free caches of
grease pencils because it is needed later by a separate render engine.

Pull Request: https://projects.blender.org/blender/blender/pulls/120315
2024-04-05 18:13:12 +02:00
Sergey Sharybin
f6bff96ac5 Fix #120119: Area lamp artifacts in Cycles with light trees
This is a regression in 4.1, caused by 36e603c430.

For unbiased MIS weight in light tree, we should use sd->N for
mis_origin_n, since sc->N is not available in NEE.

The change also makes it so we do not sample lights below sd->N even
when bump map correction is disabled. This diverges from the original
idea of giving full control to artists, but ensures the internal math
is happy.

Pull Request: https://projects.blender.org/blender/blender/pulls/120216
2024-04-05 10:11:33 +02:00
Harley Acheson
b32effdaa8 GHOST/WIN32: Remove Initial UpdateWindow
We call UpdateWindow very early in our window creation, before we get
an openGl surface and before our message queue is ready. This results
in WM_ACTIVATE, WM_SIZE, WM_MOVE, and WM_PAINT messages sent to us
at a time when GetMessageTime() returns zero. This makes our event
message times have a gap between the fourth and fifth messages, equal
to the time since system start. There is no downside to not calling
this at this time.

Pull Request: https://projects.blender.org/blender/blender/pulls/117965
2024-04-05 00:34:23 +02:00
Xavier Hallade
cbc7962a73 Cycles: Tune kernel sizes for oneAPI device
This brings a 1-3% performance improvement depending on the scenes, on
the Arc A770.
2024-04-04 16:04:13 +02:00
Campbell Barton
7e9f7320e4 Cleanup: spelling in comments & comment blocks 2024-04-04 11:26:28 +11:00
Campbell Barton
4d84a45e7e Cleanup: simplify CLG logging append function
- Remove redundant length calculation.
- Remove else-after-break.
2024-04-04 10:55:11 +11:00
Campbell Barton
52ce8d408f Cleanup: use const arguments & variables 2024-04-04 10:55:10 +11:00
Xavier Hallade
891d71a4d4 Cycles: Drop noinline keyword for oneAPI device
fdc2962beb indirectly introduced a change
in inlining (light_tree_pdf started getting inlined) that led to a 5-10%
drop in performance for most scenes.
Dropping the noinline keyword for oneAPI device recovers it.
It however brings another performance regression to MNEE and Raytrace
kernels, that we'll look into separately.
2024-04-02 18:29:35 +02:00
Campbell Barton
97d93c7e33 GHOST/Wayland: pass in null when the cursor theme isn't set
While an empty string resolves to the default theme, it's not following
the API specification for wl_cursor_theme_load as it's written.

Checking on wayland internals this looks only to add an unnecessary
theme lookup on an empty string which falls back to the default.

Noticed when investigating #105895 although it seems unlikely
that this chagne would resolve the issue.
2024-04-02 15:11:05 +11:00
Campbell Barton
2be407fc82 Cleanup: spelling in comments 2024-04-01 16:47:57 +11:00
Hoshinova
c78c6b0bdf Fix #119797: Noise Texture Precision Issues
The Perlin noise algorithms suffer from precision issues when a coordinate
is greater than about 250000.

To fix this the Perlin noise texture is repeated every 100000 on each axis.
This causes discontinuities every 100000, however at such scales this
usually shouldn't be noticeable.

Pull Request: https://projects.blender.org/blender/blender/pulls/119884
2024-03-29 16:12:23 +01:00
Brecht Van Lommel
bd1f4343c3 Build: Improve OSL library dependency handling in Cycles
Might fix some missing symbols when the OSL library gets updated.

Pull Request: https://projects.blender.org/blender/blender/pulls/119391
2024-03-29 15:24:30 +01:00
Hans Goudey
bf04da96f3 Fix: Missing change in declaration from previous commit 2024-03-28 19:01:32 -04:00
Hans Goudey
82b88f130a Cleanup: Use const for evaluated cage meshes and related data
Also access the evaluated deform mesh with a function rather than
directly from object runtime data. The goal is to make it easier to use
implicit sharing for these meshes and to improve overall const
correctness.
2024-03-28 18:57:57 -04:00
Campbell Barton
686605a6dd Cleanup: declare arrays as const where possible 2024-03-28 22:57:57 +11:00
Campbell Barton
b2e00d1285 Cleanup: use const pointer arguments 2024-03-28 20:57:50 +11:00
Brecht Van Lommel
53e9fb6b78 Fix #117566: Cycles persistent data not updated by device preferences
Pull Request: https://projects.blender.org/blender/blender/pulls/119970
2024-03-27 18:55:46 +01:00