Commit Graph

13518 Commits

Author SHA1 Message Date
Brecht Van Lommel
25e74f0115 Fix (harmless) uninitialized variable usage in Cycles Metal device 2023-12-11 14:46:19 +01:00
Brecht Van Lommel
cf1505d2a5 Fix Cycles division by zero with zero length curves 2023-12-11 14:46:19 +01:00
Brecht Van Lommel
f9d69da432 Build: remove Cycles build options to disable RTTI
This was required for OSL, which used to be compiled entirely without
RTTI for LLVM. However OSL now only compiles a private part of its code
without RTTI, so this no longer necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/116035
2023-12-11 14:42:51 +01:00
Hans Goudey
8157f33911 Cleanup: Move opensubdiv C-API headers to C++
All the relevant code is C++ now, so we don't need to complicate things
with the trip through C anymore. We will still need some wrappers, since
opensubdiv is an optional dependency though. The goal is to make it
simpler to remove the unnecessary/costly abstraction levels between
Blender mesh data and the opensubdiv code.
2023-12-11 07:50:29 -05:00
Brecht Van Lommel
6cdb43195e Refactor: replace NanoVDB kernel side implementation by own code
The NanoVDB headers are not compatible with Metal due to missing address
space qualifiers. We currently have a big patch for NanoVDB header
files, which is difficult to update for OpenVDB 11. Instead extract a
few hundred lines of code from NanoVDB to do just what we need.

Pull Request: https://projects.blender.org/blender/blender/pulls/115992
2023-12-10 19:37:36 +01:00
Brecht Van Lommel
8ba474dc4f Refactor: replace NanoVDB SampleFromVoxels by own code
This makes the GPU tricubic implementation more efficient. The dense
grid code implemented this in terms of trilinear lookups that are
hardware accelerated, but for NanoVDB this just causes unnecessary voxel
reads. Instead match the CPU code.

Pull Request: https://projects.blender.org/blender/blender/pulls/115992
2023-12-10 19:37:36 +01:00
Brecht Van Lommel
bbb7e7a6d5 Cycles: update to work with OpenVDB 11
Ref #113157
2023-12-10 19:36:40 +01:00
Brecht Van Lommel
798a0b301e Cycles: update OSL to work with version 1.13.5
This keeps compatibility with older stable versions, but not
older unreleased versions in the 1.13.x series.

Ref #113157

Pull Request: https://projects.blender.org/blender/blender/pulls/116004
2023-12-10 17:08:47 +01:00
Campbell Barton
ffc84da541 Cleanup: use const variables & arguments, remove unused assignments 2023-12-10 21:24:37 +11:00
Campbell Barton
f02ebe7e2b Cleanup: correct assert to avoid null pointer deference 2023-12-10 17:34:41 +11:00
Campbell Barton
cbf1eac789 Cleanup: avoid pass-by-value on vector argument for ContextVK
Also use const arguments & values.
2023-12-10 17:33:02 +11:00
Campbell Barton
64c4b3428f Cleanup: remove redundant "contains" checks before erasing items 2023-12-10 17:14:46 +11:00
Campbell Barton
52a7555a84 Cleanup: match header/source argument naming 2023-12-10 17:14:06 +11:00
Campbell Barton
ff47eb3e37 Cleanup: minor style tweaks, surround ELEM by parenthesis 2023-12-10 17:12:53 +11:00
Campbell Barton
ded36920d7 Cleanup: spelling in comments 2023-12-10 16:33:54 +11:00
Campbell Barton
3c7b753279 Cleanup: minor changes to read_file_as_buffer logic
Assign the `chunk_first` once instead of checking & assigning
each iteration.
2023-12-10 15:53:43 +11:00
Campbell Barton
af4160de3a Cleanup: avoid redundant read(..) call in read_file_as_buffer 2023-12-10 15:22:07 +11:00
Campbell Barton
5d5fd5d676 Cleanup: make read_file_as_buffer into a generic utility function
Also use a (void *) data argument, matching `read(..)`.
2023-12-10 15:21:45 +11:00
Campbell Barton
3069d59215 GHOST/Wayland: correct fix for #106040
The previous fix for #106040 worked with GNOME, it relied on
matching GNOME's internal limits - which isn't fool proof
and could fail in the future.

Resolve by adding a `read` wrapper that reads the requested number of
bytes (when available).
2023-12-10 14:54:31 +11:00
Brecht Van Lommel
dd9eecaac0 Fix Cycles versioning error after displacement_method removal 2023-12-10 01:35:29 +01:00
Campbell Barton
2c85561fc3 Fix invalid cursor move time-stamp on WIN32 2023-12-09 16:41:56 +11:00
Harley Acheson
0137e5494a Fix #40009: Win32 Use Message Time for Events not Current Time
When creating Blender events in Win32 message processing we are using
the current time as timestamp. This isn't set until we collect them, so
this might be inaccurate at times of high load. This PR changes to using
the time the message was delivered.

Pull Request: https://projects.blender.org/blender/blender/pulls/115872
2023-12-08 18:59:31 +01:00
Jeroen Bakker
65e58fe574 CMake: Fix Compiling Shader Builder on macOS
Due to changes in the build environment shader_builder wasn't able to
compile on macOs. This patch reverts several recent changes to CMake files.

* dbb2844ed9
* 94817f64b9
* 1b6cd937ff

The idea is that in the near future shader_builder will run on the buildbot as
part of any regular build to ensure that changes to the CMake doesn't break
shader_builder and we only detect it after a few days.

Pull Request: https://projects.blender.org/blender/blender/pulls/115929
2023-12-08 15:47:14 +01:00
Campbell Barton
eb7d5d0972 Fix #115933: Assert with invalid time-stamp on X11 with XIM input
Regression in [0] caused XIM generated key events to assert.

[0]: efef709ec7
2023-12-09 01:18:52 +11:00
Campbell Barton
55c5692364 Cleanup: remove unused variable, invalid comment & typo 2023-12-08 23:03:22 +11:00
Campbell Barton
77695da84b Cleanup: minor formatting tweaks 2023-12-08 16:22:14 +11:00
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