Commit Graph

13492 Commits

Author SHA1 Message Date
Stefan Werner
8a6f7640d6 Cycles: Make OIDN on GPU use the existing SYCL queue
There's already a queue from the Cycles rendering device, so let OIDN use the same instead of creating a new one.

Co-authored-by: Werner, Stefan <stefan.werner@intel.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115650
2023-12-07 14:16:21 +01:00
Werner, Stefan
3e7b8381cc Cleanup: Removed redundant code in OIDN integration
There was an unused mutex, memory limits can be left at their defaults.
2023-12-07 14:13:49 +01:00
Campbell Barton
e8f60d4de2 Cleanup: replace unordered_map for cursor lookups with an array 2023-12-07 17:50:43 +11:00
Campbell Barton
488ba5cd9a Fix #115811: Wayland picker cursor isn't displayed
Themes that didn't define "color-picker" showed the default cursor.

Resolve by checking if the theme contains a cursor,
not just that the name is known.
2023-12-07 17:08:06 +11:00
Campbell Barton
96e41bfd19 GHOST/Wayland: update cursor names
Update names to better support Adwaita & Breeze cursor themes.
2023-12-07 17:08:03 +11:00
Campbell Barton
b570efb0a9 Cleanup: reference a const wl_cursor from Wayland 2023-12-07 17:08:01 +11:00
Campbell Barton
ae8f971491 Cleanup: remove GHOST_System::getMilliSeconds
Each GHOST implementation defines it's own getMilliSeconds()
so there is no need to define this in GHOST_System.
2023-12-07 17:07:59 +11:00
Campbell Barton
c0964dcd8d GHOST/Wayland: skip more involved timestamp conversion where possible
When the result of getMilliSeconds & wayland time-stamps match,
bypass more involved logic which attempts to maintain a delta and
return the time-stamp with an offset (to account for 32bit rollover).
2023-12-07 15:25:25 +11:00
Campbell Barton
57a1e9207f GHOST/Wayland: use monotonic timer for getMilliSeconds
This is closer to Wayland's own time-stamps, using this also allows for
optimizations calculating time-stamps from events.
2023-12-07 15:24:55 +11:00
Campbell Barton
edc503356a Cleanup: tweak error checks for time access for GHOST/X11
Prefer checking the known success value instead of an exact error
since badly behaving systems could use different error values.
2023-12-07 15:24:54 +11:00
Campbell Barton
497600e49e Cleanup: spelling in comments, strings 2023-12-07 12:45:27 +11:00
Campbell Barton
9d9764c1c9 Cleanup: remove redundant define checks
Also reformat checks to quiet warnings so they don't read as empty
define checks.
2023-12-07 10:39:03 +11:00
Campbell Barton
9898602e9d Cleanup: clarify #ifndef checks in trailing #endif comments 2023-12-07 10:38:54 +11:00
Brecht Van Lommel
e06561a27a Build: replace Blender specific DEBUG by standard NDEBUG
NDEBUG is part of the C standard and disables asserts. Only this will
now be used to decide if asserts are enabled.

DEBUG was a Blender specific define, that has now been removed.

_DEBUG is a Visual Studio define for builds in Debug configuration.
Blender defines this for all platforms. This is still used in a few
places in the draw code, and in external libraries Bullet and Mantaflow.

Pull Request: https://projects.blender.org/blender/blender/pulls/115774
2023-12-06 16:05:14 +01:00
Campbell Barton
86146c79f8 Cleanup: update comment, reference issue number
The bug referenced from [0] wasn't correct (should have been #40009).
Updated code-comment.

[0]: efef709ec7
2023-12-06 19:49:19 +11:00
Campbell Barton
efef709ec7 GHOST/X11: Support X11 time-stamps
Resolves #114835 on X11.
2023-12-06 19:33:50 +11:00
Campbell Barton
8580718168 GHOST/SDL: use SDL timestamps for events
Resolves #114835 on Haiku.
2023-12-06 17:46:23 +11:00
Campbell Barton
20fd012adb Valgrind: suppress warnings with MemPool & MEM_* trailing padding
Suppress false positive Valgrind warnings which flooded the output.

- BLI_mempool alloc/free & iteration.
- Set alignment padding bytes at the end of MEM_* allocations
  as "defined" since this causes many false positive warnings
  in blend file writing and MEMFILE comparisons.
- Set MEM_* allocations as undefined when `--debug-memory`
  is passed in to account for debug initialization.
- Initialize pad bytes in TextLine allocations.
2023-12-05 17:12:32 +11:00
Brecht Van Lommel
a1804f35f7 Shaders: change default IOR from 1.45 to 1.5
To match OpenPBR and Standard Surface. Most IOR real values are in a range
of 1.3 to 1.6, might as well use the more round and common number.

Pull Request: https://projects.blender.org/blender/blender/pulls/115770
2023-12-04 21:12:29 +01:00
Jesse Yurkovich
0f67cb9c2f Cleanup: Fully remove legacy displacement_method property
The commit[1] to unify the displacement method for both EEVEE and Cycles
left this, now unused, property in place.

[1] a001cf9f2b

Pull Request: https://projects.blender.org/blender/blender/pulls/115738
2023-12-04 19:09:12 +01:00
Campbell Barton
be2d940203 Fix error in recent GHOST/Wayland thread priority function
Invalid type for testing was left in making the priority change a noop.
2023-12-04 12:47:15 +11:00
Campbell Barton
ad07654ed8 GHOST/Wayland: use minimum priority for helper threads
Wayland threads for event handling & cursor animation shouldn't take
priority over application logic. Set them to minimum priority.
2023-12-04 12:28:43 +11:00
Campbell Barton
3a7c618b87 GHOST/Wayland: animated cursor support
Previously only the first frame of an animated sequence was shown,
now animated cursors are played back as expected
(typically the wait cursor).
2023-12-04 12:28:41 +11:00
Campbell Barton
d7492d3b58 Cleanup: minor simplification to internal Wayland cursor API
Avoid passing the 'seat' when the `image` to display can be passed
instead.
2023-12-04 12:28:40 +11:00
Campbell Barton
04cbe2880b Fix error updating the tablets cursor scale on Wayland 2023-12-04 12:28:38 +11:00
Campbell Barton
8bb6d0ffe0 Unbreak building with Vulkan & WITH_GHOST_X11=OFF
Missing from 5b7175c982.
2023-12-02 15:37:10 +11:00
Campbell Barton
5b7175c982 GHOST: remove X11 include when WITH_GHOST_X11=11 2023-12-02 15:27:51 +11:00
Campbell Barton
95f620fd3d Unbreak build with Vulkan+Wayland+X11
GHOST_ContextVK includes `X.h` which defines "None",
rename to "Unset" to avoid naming conflict.
2023-12-02 15:27:22 +11:00
Campbell Barton
4a735b1d05 GHOST/Wayland: use time-stamps from Wayland input
Resolve double-click events not being registered when there was
a delay between event handling.

Address #40009.
2023-12-02 14:58:49 +11:00
Campbell Barton
35295829e4 GHOST/Wayland: improve tablet event handling
Defer creating events until the "frame" callback runs to ensure
the tablet state has been fully updated before the events are created.

This also avoids redundant motion events which are now only sent
when the motion/pressure or tilt callbacks run.
2023-12-02 14:58:49 +11:00
Campbell Barton
32c5ea6262 Cleanup: format 2023-12-02 14:56:12 +11:00
Harley Acheson
1d7ddcc46e Cleanup: Make format
Formatting changes resulting from Make Format
2023-12-01 10:29:59 -08:00
Campbell Barton
36351f3796 Fix missing NULL check from fix for #113059 on Wayland/LIBDECOR
Add missing null check from [0].

[0]: e6c200e94c
2023-12-01 22:07:38 +11:00
Campbell Barton
e6c200e94c Fix #113059: file selector shrinks on each display under KDE
Postpone binding the buffer to the surface ensures the XDG window
is created at the correct size.
2023-12-01 14:08:01 +11:00
Campbell Barton
aba3fad33c Revert "Fix #113059: file selector shrinks on each display under KDE"
This reverts commit 85e2dd66a0.

Remove the hack in favor of a different fix.
2023-12-01 14:08:00 +11:00
Bastien Montagne
050d48edfc BLI_fileops: Harmonize 'rename' behaviors accross platforms.
This commit aim at making the behaviors of `BLI_rename` and
`BLI_rename_overwrite` more consistent and coherent across all
supported platforms.

* `BLI_rename` now only succeeds in case the target `to` path does not
  exists (similar to Windows `rename` behavior).
* `BLI_rename_overwrite` allows to replace an existing target `to` file
  or (empty) directory (similar to Unix `rename` behavior).

NOTE: In case the target is open by some process on the system, trying
to overwrite it will still fail on Windows, while it should succeed on
Unix-like systems.

The main change for Windows is the usage of `MoveFileExW`
instead of `_wrename`, which allows for 'native support' of file
overwrite (using the `MOVEFILE_REPLACE_EXISTING` flag). Directories
still need to be explicitly removed though.

The main change for *nix systems is the use of `renamex_np` (OSX) or
`renameat2` (most Linux systems) to allow forbidding renaming to an
already existing target in an 'atomic' way.

NOTE: While this commit aims at avoiding the TOC/TOU problem as
much as possible by using available system's primitives for most
common cases, there are some situations where race conditions
(filesystem changes between checks on FS state, and actual rename
operation) remain possible.

Pull Request: https://projects.blender.org/blender/blender/pulls/115096
2023-11-30 22:35:00 +01:00
Campbell Barton
a226b14984 Fix #114609: compose key sequences includes continuation keys on Wayland
Suppress characters typed while composing.
2023-11-30 16:42:42 +11:00
Campbell Barton
dfbda79cbd Cleanup: declare pointers const where possible 2023-11-30 16:42:40 +11:00
Campbell Barton
3b5031f1cb Cleanup: use 'r_' prefix for output arguments, order last
Also clarify some naming.
2023-11-30 10:42:18 +11:00
Hans Goudey
13c145ac02 Cleanup: Grammar in a few comments 2023-11-29 12:39:33 -05:00
Campbell Barton
278e37f8ce Cleanup: use default initializers for members of GWL_Seat 2023-11-29 16:05:30 +11:00
Campbell Barton
258a083066 Fix #115160: Keyboard layout sometimes ignored on Wayland
When using multiple keyboard layouts, the first layout would always
be used for internal keyboard layout queries.

This meant for e.g. with English layouts QWERTY & DVORAK both active
Control-C always used the QWERTY location for C even when DVORAK was
active.

Resolve by detecting layout changes & run xkb_state_update_mask
on all xkb_state's so internal queries always use the active layout.

Based on !115161, extended to detect layout changes & account for all
internal states.

Co-authored-by: Eugene Kuznetsov <eugene.kuznetsov@amd.com>
2023-11-29 15:18:42 +11:00
Campbell Barton
85e2dd66a0 Fix #113059: file selector shrinks on each display under KDE
Under KDE the initial window size includes the window decorations.
Add a workaround to enforce the requested window size for new windows
under KDE.
2023-11-29 15:18:40 +11:00
Ray molenkamp
94817f64b9 Cleanup: CMake: Modernize bf_intern_utfconv dependencies
- Remove any bf_intern_utfconv paths from INC
- Add a dependency though LIB when missing
- an empty target is created for non windows builds, so we don't have to
if(WIN32) this all over the place

context: https://devtalk.blender.org/t/cmake-cleanup/30260
Pull Request: https://projects.blender.org/blender/blender/pulls/115373
2023-11-28 01:11:15 +01:00
Brecht Van Lommel
1c50dd8bb8 Revert "Fix: Cycles: inconsistent normal checks when sampling and evaluating BSDF"
While this code is suspect, better to go back to the old state for now,
as there is no simple fix that doesn't introduce other issues.

Fix #115022
Fix #115414

This reverts commit 063a9e8964.
2023-11-27 17:01:59 +01:00
Brecht Van Lommel
3475ddce46 Fix #115424: Cycles object space normal map wrong with backfaces 2023-11-27 17:01:59 +01:00
Alaska
59a1148ac0 Fix #115206: Sheen renders incorrectly when viewed head on
Fixes an issue where the sheen would render incorrectly when
the normal of the surface is parallel to the incoming direction.

Co-authored-by: Lukas Stockner <lukas.stockner@freenet.de>

Pull Request: https://projects.blender.org/blender/blender/pulls/115286
2023-11-27 11:34:02 +01:00
Campbell Barton
f000b94a64 Cleanup: declare functions with overrides in GHOST_ContextVK 2023-11-27 10:59:54 +11:00
Campbell Barton
1eff48a838 Cleanup: spelling in code 2023-11-27 10:55:39 +11:00
Campbell Barton
27c660707d Cleanup: spelling in comments, variables 2023-11-27 09:54:36 +11:00