Commit Graph

13820 Commits

Author SHA1 Message Date
Pierrick Bouvier a3d915310b Build: Fix some excessive Visual Studio compile times
While investigating Blender compilation time for windows-arm64, we
identified two compilation units that were taking a long time to compile
(~1h each). This affects windows-x64 builds as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/117534
2024-01-28 12:12:52 +01:00
Brecht Van Lommel 38647b6dc2 Fix: suspicious time-stamp console warnings on macOS
Use the correct current time API function that matches NSEvent timestamp.
2024-01-27 00:22:49 +01:00
Sergey Sharybin 6f681105ec Cycles: Skip denoising during bake when pass does not support denoising
This changes fixes the slowdown when baking data passes like Normal with
the denoiser enabled on scene settings.

When baking to 4K textures denoising could take considerable amount of
time, which is better be avoided.

Pull Request: https://projects.blender.org/blender/blender/pulls/117483
2024-01-25 15:56:20 +01:00
Alaska ddc0aceefd Cycles UI: Hide HIP-RT settings on Linux
Hide the HIP-RT setting on Linux since it's not supported there yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/117492
2024-01-25 15:16:13 +01:00
Brecht Van Lommel 8087dd9e96 Cleanup: Cycles: use one fewer object struct member for motion data 2024-01-24 20:17:13 +01:00
Brecht Van Lommel 5b6f2ef5a2 Cleanup: Cycles: rename some legacy names to new ones 2024-01-24 20:17:13 +01:00
Brecht Van Lommel b689027b3a Fix #114028: Cycles displace splits faces with smooth and flat faces
Cycles can use a per face flag to determine if a face is smooth or flat,
and there is no need to use corner normals in such cases. So revert to
not doing that as before, which also saves a bit of memory.

There is a pre-existing issue where faces are split by sharp edges and
autosmooth, which is not solved by this. It's only fixing the regression.
2024-01-24 19:55:31 +01:00
Stefan Werner d16d2bbd3a Cycles: Adding OIDN support for CUDA and OptiX devices
Small changes to turn on support and to build OIDN with the CUDA backend.

Co-authored-by: Werner, Stefan <stefan.werner@intel.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115828
2024-01-24 08:19:39 +01:00
Hans Goudey 99f9084bee Cleanup: Replace some CLAMP macros with C++ functions
Pull Request: https://projects.blender.org/blender/blender/pulls/117460
2024-01-23 21:10:33 +01:00
salipourto dd7a7791d7 Cycles: Remove and update deprecated compiler options for HIP
Pull Request: https://projects.blender.org/blender/blender/pulls/117428
2024-01-23 20:28:39 +01:00
Stefan Werner 4f58cffb4e Cycles: Use default CUDA context instead of creating a new one
This allows for Cycles and OIDN to share the same context.

Co-authored-by: Werner, Stefan <stefan.werner@intel.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/117230
2024-01-23 15:31:45 +01:00
Lukas Stockner b5a9c98e04 Fix #117081: Wrong Roughness when baking Principled BSDF
The pre-4.0 Principled BSDF had a special diffuse BSDF that contained
the roughness value from the node. Since 4.0, the regular Diffuse BSDF is used,
so we need to ignore it when determining the roughness value for baking.
2024-01-23 01:20:12 +01:00
Hans Goudey 0618de49ad Cleanup: Replace MIN/MAX macros with C++ functions
Use `std::min` and `std::max` instead. Though keep MIN2 and MAX2
just for C code that hasn't been moved to C++ yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/117384
2024-01-22 15:58:18 +01:00
Campbell Barton 5b59be81ba Cleanup: spelling in comments 2024-01-22 12:44:56 +11:00
Aras Pranckevicius a705259b4b Cleanup: move imbuf .h files to .hh 2024-01-19 20:29:38 +01:00
Brecht Van Lommel cb787a458b Build: use C++17 for CUDA kernels when supported
This helps with compatibility with recent clang versions as host compiler.

Pull Request: https://projects.blender.org/blender/blender/pulls/117311
2024-01-19 15:19:33 +01:00
ESASHIKA Kaoru c0bc49f035 GHOST: Support for Additional 3Dconnextion Devices
Add support for additional 3Dconnextion devices, specifically the Space
Mouse Pro Wireless when connected directly and for the wireless
connection.

Pull Request: https://projects.blender.org/blender/blender/pulls/116393
2024-01-18 17:48:35 +01:00
Hans Goudey da6b45f9b8 Cleanup: Make format 2024-01-16 10:56:55 -05:00
Eugene Kuznetsov 10dfa07e36 Linux: Use huge pages in jemalloc to speed up allocations
Enable huge pages for jemalloc. This requests the Linux kernel to use
huge (2 MB) pages for large allocations. This has the effect of speeding
up first accesses to those allocations, and possibly also speeds up future
accesses by reducing TLB faults.

By default, 4 KB pages are used unless the user enables huge pages through
a kernel parameter or an obscure sysfs setting.

For Cycles benchmarks, this gives about a 5% CPU rendering performance
improvement. It likely also improves performance in other areas of Blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/116663
2024-01-16 16:37:40 +01:00
Harley Acheson 0f8c8e475a UI: Improved Default GetWindowUnderCursor Behavior
For default GetWindowUnderCursor (when there is not a platform-specific
version), search windows in reverse order. This is because in most
cases with overlapping windows the one that is on top was created after
those that are below it.

Pull Request: https://projects.blender.org/blender/blender/pulls/111489
2024-01-15 20:27:47 +01:00
sjfricke c9c01724b9 Vulkan: Add shaderClipDistance feature
Various GLSL shaders use gl_ClipDistance and without the feature
enabled validation layers errors are triggered

Pull Request: https://projects.blender.org/blender/blender/pulls/116530
2024-01-15 15:02:19 +01:00
Philipp Oeser 4da32e9334 Fix #106425: Mantaflow guiding with domains is broken
Caused by e968b4197b / 67e23b4b29

Since culprit commits, we are not running `MANTA::initGuiding` /
`fluid_alloc_guiding` if guiding is meant to be pulled from other
domains (it does work with effectors though). This is because atm. only
the `FLUID_DOMAIN_ACTIVE_GUIDE` flag sets `mUsingGuiding` to true
(activated in `update_obstacleflags`, so only for effectors).

So to fix this, we have to ensure that `MANTA::initGuiding` runs (also
if guiding is pulled from domains), but also make sure we dont run into
the crashes from T102257.

It seems that the real reason we were getting crashes in T102257 is that
67e23b4b29 made it so that resetting the cache (including a call to
`fluid_modifier_reset_ex`) in `fluid_modifier_processDomain` happens
**after** `FluidDomainSettings.active_fields` have been updated (this
happens in `update_flowsflags` & `update_obstacleflags`).
But `fluid_modifier_reset_ex` also resets
`FluidDomainSettings.active_fields`. If we then update pointers later in
`fluid_modifier_processDomain`, we never get anything in the guiding
related pointers for the new `mCurrentID` (specifically `mPhiGuideIn`
will be a nullptr). This is the real reason `initGuiding()` runs a
second time (it does once for `fluid_modifier_init` then again as a
consequence of the call to `manta_guiding`).

This patch proposes to move the resetting process from 67e23b4b29
**above** the refreshing of the `FluidDomainSettings.active_fields`,
this way these field stay intact, we do get the first run of
`initGuiding()` from `fluid_modifier_init`, manta pointers get updated
with intact fields afterwards (so we then get a valid `mPhiGuideIn`),
which then prevents the second run from `manta_guiding` to actually call
the python script again.

The fix from e968b4197b is then not needed and reverted in this patch.

This should be good for LTS I think.

Pull Request: https://projects.blender.org/blender/blender/pulls/117067
2024-01-15 12:31:44 +01:00
Damien Picard 3bd41cf9bc I18n: Go over TIP_ and IFACE_ usages, change to RPT_ when relevant
The previous commit introduced a new `RPT_()` macro to translate
strings which are not tooltips or regular interface elements, but
longer reports or statuses.

This commit uses the new macro to translate many strings all over the
UI.

Most of it is a simple replace from `TIP_()` or `IFACE_()` to
`RPT_()`, but there are some additional changes:
- A few translations inside `BKE_report()` are removed altogether
  because they are already handled by the translation system.
- Messages inside `UI_but_disable()` are no longer translated
  manually, but they are handled by a new regex in the translation
  system.

Pull Request: https://projects.blender.org/blender/blender/pulls/116804

Pull Request: https://projects.blender.org/blender/blender/pulls/116804
2024-01-12 13:37:32 +01:00
Campbell Barton 3aa3743b6e Fix hang on startup under Wayland & LIBDECOR with the VULKAN backend
Create a dummy buffer so LIBDECOR initializes the window configuration.
2024-01-12 11:31:10 +11:00
Hans Goudey 6438d0ad1f Cleanup: Grammar in comments 2024-01-11 11:01:50 -05:00
salipourto b358b89faa Fix #116810: Cycles HIP OpenImageDenoise device not available
Fixed the order of setting device id and querying OIDN.
This check needs info.id to be set.

Pull Request: https://projects.blender.org/blender/blender/pulls/117006
2024-01-11 15:28:43 +01:00
Jacques Lucke a94146b82c Cleanup: move BKE_pointcloud.h to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/116990
2024-01-11 10:54:47 +01:00
Campbell Barton 7a4f7a1d51 Cleanup: spelling in comments, comment blocks 2024-01-11 16:46:46 +11:00
Alaska 1f4cf2676f Cycles UI: Fix missing CPU settings under certain conditions
Fixes an issue where CPU specific render settings (e.g. path guiding)
would be hidden when GPU Compute has been selected for rendering,
but a GPU hasn't been selected in preferences.

Pull Request: https://projects.blender.org/blender/blender/pulls/116123
2024-01-10 19:52:06 +01:00
Brecht Van Lommel b0d919181d Fix #116792: Cycles render issue velocity attribute and motion steps > 1
In this case the object transform can use more motion steps, but the
geometry needs to have its motion steps fixed since the velocity
attribute completely overrides them.
2024-01-10 19:19:23 +01:00
Brecht Van Lommel dda8d0920a Fix #116211: Cycles light linking incorrect with transparent objects 2024-01-10 18:06:28 +01:00
Jacques Lucke 522f9c9834 Volumes: improve tree access token api
There was one functional issue with the previous API which was its
use in `VolumeGrid<T>::grid_for_write(tree_token)`. The issue was
that the tree token had to be received before the grid is accessed.
However, this `grid_for_write` method might create a copy of the
`VolumeGridData` internally and if it does, the passed in `tree_token`
corresponds to the wrong tree.

The solution is to output the token as part of the method. This has two
additional benefits:
* The API is more safe, because one can't pass an r-value into the methods
  anymore. This generally shouldn't be done, because the token should
  live at least as long as the OpenVDB tree is used and shouldn't be freed
  immediatly.
* The API is a bit simpler, because it's not necessary to call the
  `VolumeGrid.tree_access_token()` method anymore.
2024-01-10 15:20:29 +01:00
Campbell Barton 89ad66fbbd Fix #1092563: invalid event timestamps on X11 after 49 days uptime
Regression from [0] based on the incorrect assumption that X11's
Time was a uint64. Despite the `Time` type being 8 bytes,
the value wraps at UINT32_MAX.

Details:

- GHOST_SystemX11::m_start_time now uses CLOCK_MONOTONIC instead of
  gettimeofday(..) since event times should always increase.
- Event timestamps now accumulate uint32 rollover.

[0]: efef709ec7
2024-01-09 12:05:31 +11:00
Hans Goudey 468e0f873f Cleanup: Fix spelling mistakes in recent spelling fix commit
0ba83fde1f
2024-01-08 12:52:54 -05:00
Sergey Sharybin 4d2f012049 Fix #115862: Shadow linking causes error on GPU
When a mesh light is shadow-linked to something with a specific
shader network it was possible that the emission_sd_storage was
not bit enough for sampling.

The shade_dedicate_light kernel only evaluates emission of either
light or mesh emitter and then resumes the regular path tracer.
There is no need to store closures.

This change makes it so a smaller storage is used, and also
passes flag to the shader evaluation function indicating that
closures are not to be stored.

Pull Request: https://projects.blender.org/blender/blender/pulls/116907
2024-01-08 18:03:23 +01:00
Campbell Barton 214f942258 Fix crash reading an empty clipboard under Wayland 2024-01-08 23:32:30 +11:00
Brecht Van Lommel 0e4da8d55f Fix macOS ARM build failing with make lite
OpenImageIO headers have a dependency on Imath headers when not on x86_64.
2024-01-08 13:14:34 +01:00
Campbell Barton 617f7b76df Cleanup: comment block formatting 2024-01-08 11:31:43 +11:00
Campbell Barton 0ba83fde1f Cleanup: spelling in comments 2024-01-08 11:24:37 +11:00
Hans Goudey e90d844dd7 Cleanup: Grammar in comments
"it's own" -> "its own" again. Start new sentences properly.
2024-01-06 09:02:56 -05:00
Hans Goudey d6cfd7d1f4 Cleanup: Remove unnecessary keywords from C++ headers
- Remove unnecessary `struct`
- Use `using` instead of `typedef`
- Remove `void` from `(void)` as function arguments
2024-01-04 15:07:48 -05:00
Michael Jones 31001b67fd Cycles: Enable floating point atomic support in Metal
Utilises native floating point atomic operations if available. Supported in Metal 3.0+ onwards.
Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/116786
2024-01-04 17:08:29 +01:00
Brecht Van Lommel ac70bc3611 Fix: temporarily disable Cycles patch map assert to avoid failing test
After recent 4.1 libraries update update for macOS ARM.
2024-01-04 04:06:19 +01:00
Brecht Van Lommel 364beee159 Tests: add option to build one binary per GTest file
Bundling many tests in a single binary reduces build time and disk space
usage, but is less convenient for running individual tests command line
as filter flags need to be used.

This adds WITH_TESTS_SINGLE_BINARY to generate one executable file per
source file. Note that enabling this option requires a significant amount
of disk space.

Due to refactoring, the resulting ctest names are a bit different than
before. The number of tests is also a bit different depending if this
option is used, as one uses gtests discovery and the other is organized
purely by filename, which isn't always 1:1.

Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/114604
2024-01-03 18:35:50 +01:00
bsavery d2e91fb0d7 Cycles: add ROCm 6 compatibility for HIP
ROCm 6 brings some changes to the HIP API. This pull request is meant to be
backward and forward compatible.

That is Blender could be compiled with either ROCM 6 or 5 and run on either.
The main change is the hipMemoryType enum, which we check based on the
runtime version to use the correct enum values.

Without this, HIP will not work on Windows with upcoming 23.40 driver.

Pull Request: https://projects.blender.org/blender/blender/pulls/116713
2024-01-03 18:16:07 +01:00
Sergey Sharybin d86d86f729 Fix heap buffer overflow in Cycles IES parser
The IES parser in Cycles would lead to heap buffer overflow error
when non-supported or invalid data is provided to it.

The error was caused by the way how stirng is copied to vector
skipping the last null-terminator. Later C-style string utilities
are used for parsing, and they expect the data to be null-terminated.

It is unclear why data needs to be stored as vector: storing it as
string simplifies initialization.

Easiest to reproduce the issue is to use Blender build with address
sanitizer enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/116752
2024-01-03 18:00:41 +01:00
Brecht Van Lommel f63accd3b6 Cleanup: move CMake test utility functions into testing.cmake
Combining functions from macros.cmake and Modules/GTestTesting.cmake.
It was unusual to have Blender specific code in the Modules folder.

Pull Request: https://projects.blender.org/blender/blender/pulls/116719
2024-01-03 14:49:11 +01:00
Brecht Van Lommel d377ef2543 Clang Format: bump to version 17
Along with the 4.1 libraries upgrade, we are bumping the clang-format
version from 8-12 to 17. This affects quite a few files.

If not already the case, you may consider pointing your IDE to the
clang-format binary bundled with the Blender precompiled libraries.
2024-01-03 13:38:14 +01:00
Brecht Van Lommel 4ce14a639f Revert "Cleanup: move CMake test utility functions into testing.cmake"
This breaks execution of some Windows tests.

This reverts commit 4190a61020.
2024-01-02 19:06:39 +01:00
Sergey Sharybin 4657d541c8 Fix use-after-free in Cocoa GHOST system creation
The use-after-free is triggered when the GHOST system is created
multiple timers during the application timelife which happens in
the integration tests.

The solution is to release the application delegate and set it
to nil when the GHOST system is being destroyed. This ensures that
all subsequent GHOST systems properly initialize application
delegate, and that there is no application delegate which points
to a freed system.

The original issue was noticed by a flackey behavior of the
bf_gpu_tests test which was failing at random. The issue could
be reliably reproduced by running this test with ASAN enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/116717
2024-01-02 17:19:54 +01:00
Alaska 9b3699db67 Fix: Cycles invalid normals in various situations
Fix issues related to NaN normals in some situations by trying
to detect when these cases might occur and just reverting back
to default normals.

As a side effect of these changes, OSL now behaves correctly
when given a non-normalized normal.

Pull Request: https://projects.blender.org/blender/blender/pulls/114960
2024-01-02 16:24:04 +01:00
Brecht Van Lommel 4190a61020 Cleanup: move CMake test utility functions into testing.cmake
Combining functions from macros.cmake and Modules/GTestTesting.cmake.
It was unusual to have Blender specific code in the Modules folder.
2024-01-02 15:34:52 +01:00
Alaska f0fcd553df Fix #116695: Cycles light tree crash with certain light visibility settings
Fixes an issue where triangles (and possibly lights) would not be added
to the light tree if the only visibility option it has enabled is volumetric
scattering.

This would lead to an assert during forward sampling because the light
would be treated as if it was in the light tree, and a light index
outside the light tree array would be sampled, which would trigger
the assert.

Pull Request: https://projects.blender.org/blender/blender/pulls/116703
2024-01-02 13:53:56 +01:00
Harley Acheson 355654487e Fix #116618: Win32 Use Null for Background Window Brush
Using a non-null background brush does remove an initial white flash
while the program is loading and before we start painting. But this
results in some extra and unnecessary redraws. Default WM_ERASEBKGND
behaviour is to do nothing if this is brush is null, so if non-null we
get erased and must redraw. Suppressing WM_ERASEBKGND will not give us
that initial paint, so no benefit in keeping the brush added in #115968.

Pull Request: https://projects.blender.org/blender/blender/pulls/116642
2023-12-29 23:12:10 +01:00
Hans Goudey 7d44065f73 Cleanup: Revert replacement of GSQueue with std::queue
There are some tragic design flaws with the Microsoft STL
implementation of `std::dequeue`. Unless we implement our
own similar data structure or use an implementation from
another library, the change isn't worth it.

This reverts commit b26cd6a4b9.
This reverts commit cc11ba33d9.
This reverts commit c929d75054.
This reverts commit bd3d5a750d.
2023-12-27 12:34:49 -05:00
Hans Goudey 06eda2a484 Cleanup: Remove most indirect includes of BKE_customdata.hh
Some common headers were including this. Separating the includes
will ideally lead to better conceptual separation between CustomData
and the attribute API too. Mostly the change is adding the file to
places where it was included indirectly before. But some code is
shuffled around to hopefully better places as well.
2023-12-26 23:59:44 -05:00
Hans Goudey b26cd6a4b9 Cleanup: Remove unused GSQueue container
GSQueue dates back over 21 years, past the initial git commit. Nowadays
we generally prefer to use data structures from the C++ standard library
or our own C++ data structures. Previous commits replaced this container
with `std::queue` in a few areas. Now it is unused and can be removed.
2023-12-26 23:26:32 -05:00
Nikita Sirgienko 3cadec1892 Cycles: Log number of scheduled tiles
Pull Request: https://projects.blender.org/blender/blender/pulls/116379
2023-12-21 09:39:16 +01:00
Hans Goudey 7132c7a53c Cleanup: Replace MVertTri type with C++ vector
Similar to 7c69c8827b. Remove more unused includes.
2023-12-20 20:59:11 -05:00
Hans Goudey edf8a776ac Cleanup: Use forward declarations to replace includes of BKE_attribute.hh
Remove most includes of this header inside other headers, to remove unnecessary
indirect includes which can have a impact on compile times. In the future we may
want more dedicated "_fwd.hh" headers, but until then, this sticks with the
solution in existing code.

Unfortunately it isn't yet possible to remove the include from `BKE_geometry_set.hh`.
2023-12-20 13:25:28 -05:00
Hans Goudey 19001c9e6c Cleanup: Move attribute domain enum to C++ header, use enum class
Each value is now out of the global namespace, so they can be shorter
and easier to read. Most of this commit just adds the necessary casting
and namespace specification. `enum class` can be forward declared since
it has a specified size. We will make use of that in the next commit.
2023-12-20 13:25:28 -05:00
Jacques Lucke a72e7a220d Volumes: refactor volume grid storage
This refactors how volume grids are stored with the following new goals in mind:
* Get a **stand-alone volume grid** data structure that can be used by geometry nodes.
  Previously, the `VolumeGrid` data structure was tightly coupled with the `Volume` data block.
* Support **implicit sharing of grids and trees**. Previously, it was possible to share data
  when multiple `Volume` data blocks loaded grids from the same `.vdb` files but this was
  not flexible enough.
* Get a safe API for **lazy-loading and unloading** of grids without requiring explicit calls
  to some "load" function all the time.
* Get a safe API for **caching grids from files** that is not coupled to the `Volume` data block.
* Get a **tiered API** for different levels of `openvdb` involvement:
  * No `OpenVDB`: Since `WITH_OPENVDB` is optional, it's helpful to have parts of the API that
    still work in this case. This makes it possible to write high level code for volumes that does
    not require `#ifdef WITH_OPENVDB` checks everywhere. This is in `BKE_volume_grid_fwd.hh`.
  * Shallow `OpenVDB`: Code using this API requires `WITH_OPENVDB` checks. However, care
  is taken to not include the expensive parts of `OpenVDB` and to use forward declarations as
  much as possible. This is in `BKE_volume_grid.hh` and uses `openvdb_fwd.hh`.
  * "Full" `OpenVDB`: This API requires more heavy `OpenVDB` includes. Fortunately, it turned
  out to be not necessary for the common API. So this is only used for task specific APIs.

At the core of the new API is the `VolumeGridData` type. It's a wrapper around an
`openvdb::Grid` and adds some features on top like implicit sharing, lazy-loading and unloading.
Then there are `GVolumeGrid` and `VolumeGrid` which are containers for a volume grid.
Semantically, each `VolumeGrid` has its own independent grid, but this is cheap due to implicit
sharing. At highest level we currently have the `Volume` data-block which contains a list of
`VolumeGrid`.

```mermaid
flowchart LR
  Volume --> VolumeGrid --> VolumeGridData --> openvdb::Grid
```

The loading of `.vdb` files is abstracted away behind the volume file cache API. This API makes
it easy to load and reuse entire files and individual grids from disk. It also supports caching
simplify levels for grids on disk.

An important new concept are the "tree access tokens". Whenever some code wants to work
with an openvdb tree, it has to retrieve an access token from the corresponding `VolumeGridData`.
This access token has to be kept alive for as long as the code works with the grid data. The same
token is valid for read and write access. The purpose of these access tokens is to make it possible
to detect when some code is currently working with the openvdb tree. This allows freeing it if it's
possible to reload it later on (e.g. from disk). It's possible to free a tree that is referenced by
multiple owners, but only no one is actively working with. In some sense, this is similar to the
existing `ImageUser` concept.

The most important new files to read are `BKE_volume_grid.hh` and `BKE_volume_grid_file_cache.hh`.
Most other changes are updates to existing code to use the new API.

Pull Request: https://projects.blender.org/blender/blender/pulls/116315
2023-12-20 15:32:52 +01:00
Hans Goudey 8dd8f932e2 Cleanup: Rename Mesh loop_data to corner_data
Related to #110434, efbee2d606, 7c69c8827b
2023-12-19 20:39:05 -05:00
Hans Goudey efbee2d606 Mesh: Rename totvert, totedge, and totloop fields
Use the standard "elements_num" naming, and use the "corner" name rather
than the old "loop" name: `verts_num`, `edges_num`, and `corners_num`.
This matches the existing `faces_num` field which was already renamed.

Pull Request: https://projects.blender.org/blender/blender/pulls/116350
2023-12-20 02:21:48 +01:00
Harley Acheson 6007838bb2 UI: Set Initial Background Color Darker
With the popularity of dark themes, and the fact that our default theme
is dark, make the initial background color (before the program fully
loads) a darker shade of grey. {0.25f, 0.25f, 0.25f} versus current
{0.55f, 0.55f, 0.55f}. Also set Windows class background brush to the
same color to remove a potential flash.

Pull Request: https://projects.blender.org/blender/blender/pulls/115968
2023-12-20 01:36:11 +01:00
Hans Goudey 7c69c8827b Mesh: Rename MLoopTri variable names, and functions
Make the naming consistent with the recent change from "loop" to
"corner". Avoid the need for a special type for these triangles by
conveying the semantics in the naming instead.

- `looptris` -> `corner_tris`
- `lt` -> `tri` (or `corner_tri` when there is less context)
- `looptri_index` -> `tri_index` (or `corner_tri_index`)
- `lt->tri[0]` -> `tri[0]`
- `Span<MLoopTri>` -> `Span<int3>`
- `looptri_faces` -> `tri_faces` (or `corner_tri_faces`)

If we followed the naming pattern of "corner_verts" and "edge_verts"
exactly, we'd probably use "tri_corners" instead. But that sounds much
worse and less intuitive to me.

I've found that by using standard vector types for this sort of data,
the commonalities with other areas become much clearer, and code ends
up being naturally more data oriented. Besides that, the consistency
is nice, and we get to mostly remove use of `DNA_meshdata_types.h`.

Pull Request: https://projects.blender.org/blender/blender/pulls/116238
2023-12-19 14:57:49 +01:00
Campbell Barton a3130280b8 GHOST/Wayland: note that GNOME's IME also give us bad time-stamps 2023-12-19 15:55:43 +11:00
Campbell Barton c9a298d60f Fix assert under Wayland when IME text input completed without a window
Remove null IME checks for to resolve an assertion and allow for the
window be set at any time before the event has been generated,
or generate the events even when there is no window.

Reported by Lukas Toenne who ran into this while debugging.
2023-12-19 15:23:38 +11:00
Campbell Barton 482ba7806d Cleanup: spelling correction: "adjacent" & spelling in comments 2023-12-19 09:54:53 +11:00
Hoshinova f7e8021b2a Fix #116256: Unintentional override of node type property in API
Rename new noise node type to avoid conflict with node type.

Pull Request: https://projects.blender.org/blender/blender/pulls/116278
2023-12-18 10:35:20 +01:00
Campbell Barton 29b5919ad1 Cleanup: order GHOST_WindowWayland new/delete before other methods 2023-12-18 10:53:07 +11:00
Campbell Barton 17aca68146 Cleanup: tweaks to Wayland scale updating for new windows
- Remove redundant lock.
- Use a variable to skip resizing instead of faking unchanged values.
2023-12-18 10:46:40 +11:00
Campbell Barton 004420af8f Fix error setting the initial window size with LIBDECOR on Wayland
Error in [0] with whole-number scaling.

[0]: f845a3992c
2023-12-18 10:42:48 +11:00
Campbell Barton f845a3992c Fix #109194: window decorations mismatch on startup under Wayland
Workaround for multiple monitors with different scaling causing
the window frame not to match the window contents on startup with GNOME.
2023-12-17 17:24:56 +11:00
Campbell Barton 1455315111 Fix window updates with threaded event handling with LIBDECOR on Wayland
Under GNOME resizing a window often caused the window contents could be
a different size to the window-frame, resizing was also slow.

This occurred with LIBDECOR on Wayland when a window configure event
was called from a non-main thread.

Resolve by postponing the commit-configuration call until the main event
can handle it (matching XDG behavior).

A workaround using malloc_usable_size is currently needed.
While relying on the malloc size is not so portable and worth avoiding,
it resolves noticeable glitches and allows other workarounds to be
removed.

Any application that supports threaded event handing with LIBDECOR
will need a way to postpone applying the configuration.
Even once LIBDECOR supports this properly, a workaround is necessary
until support older versions of LIBDECOR can be dropped.
2023-12-17 16:26:27 +11:00
Campbell Barton 4d965615fc Cleanup: various C++ changes (use ELEM & string copy macros) 2023-12-17 16:25:10 +11:00
Hans Goudey 912c4c60d8 Mesh: Add viewport normals simplify option
Before #108014, toggling "Auto Smooth" was an easy way to disable
evaluation of custom normals and face corner normals for faster
viewport playback performance. Now that corner normals are calculated
automatically as necessary, it's helpful to still have a way to disable
expensive normal computation for faster playback.

This commit adds a "Normals" scene simplify setting. To avoid a bunch
of complexity, it just influences which normals are requested from the
object by viewport rendering. In my tests, skipping calculating at
least doubled viewport FPS in a few test files with a large mesh with
custom normals. This works well because normals are cached and lazily
calculated.

Pull Request: https://projects.blender.org/blender/blender/pulls/113975
2023-12-16 00:18:41 +01:00
Aras Pranckevicius 5eb5712329 ffmpeg: restore compatibility with pre-5.0 versions
Only do threaded sws_scale_frame when using ffmpeg 5.0 or later.
On earlier versions continue using the single threaded path.

Pull Request: https://projects.blender.org/blender/blender/pulls/116226
2023-12-15 19:29:57 +01:00
Campbell Barton 9097f1c62d Cleanup: unhyphenate track-pad & thumb-stick
Both are typically written without hyphenation, add to local dictionary.
2023-12-15 22:57:34 +11:00
Campbell Barton bc51f541c2 GHOST/Wayland: correct internal error in size initialization
Missing from 9479b49bd3
2023-12-15 17:05:15 +11:00
Campbell Barton 5197dd2a7a Cleanup: use local variable, replace pointer with reference 2023-12-14 23:12:57 +11:00
rajveermalviya 40a89c0984 GHOST/X11: Enable desktop sample capability
The functionality was added [0] but the flag wasn't enabled.

Ref: !116178

[0]: e5a0d11c4e
2023-12-14 22:33:46 +11:00
Campbell Barton 9479b49bd3 GHOST/Wayland: remove workaround when resizing windows with LIBDECOR
This was an attempt to fix a crash resizing windows #107797
(which I can't reproduce), however it didn't fix the issue and meant
that a window would sometimes not reach the desired size,
the maximized window for e.g. would sometimes remain the un-maximized
size.
2023-12-14 21:25:53 +11:00
Campbell Barton f79da9f245 Cleanup: remove libdecor workaround for fractional scale
Since the preferred fractional scale callback runs,
remove a workaround that guessed the fractional scale from the output.

While it could be kept, it added unnecessary complexity.
2023-12-14 21:02:43 +11:00
Campbell Barton a7bcee8833 Fix crash with change to window initialization order
Recent re-ordering change [0] on Wayland window initialization crashed
WLROOTS based compositors, resolve by keeping the updates and only
postponing the state change.

[0]: 39f378da37
2023-12-14 17:27:17 +11:00
Campbell Barton 39f378da37 Fix incorrectly sized maximized windows on Wayland + KDE
Starting blender with --window-maximized wouldn't always size the
windows properly, similar to the fix for LIBDECOR, move setting the
window state last.
2023-12-14 17:04:29 +11:00
Campbell Barton ba33dba2b6 Fix window frames not following blender window with fractional scaling
With fractional scale under GNOME, the window frames didn't match
the window contents. This was caused by updates needed to call
libdecor_frame_get_xdg_toplevel initializing the LIBDECOR window
before the window scale, internal buffer - etc were set.

Resolve by accessing moving the window state assignment last.
2023-12-14 16:52:28 +11:00
Campbell Barton a1bee22eca Cleanup: duplicate assert left in by mistake 2023-12-14 13:58:12 +11:00
Campbell Barton 3e635c3eed GHOST/Wayland: set windows scale on creation when it's known
When the final buffer scale is known, set the window scaling on startup.

This avoids scaling immediately after creating the window which
flickers. It also resolves an paper-cut with KDE where fractional
scaling caused the window to be placed on the screen center,
then the size increased pushing the window contents off the bottom right
hand portion of the screen.
2023-12-14 13:53:18 +11:00
Campbell Barton 42e7d9fc3c GHOST/Wayland: unbreak build without threaded event handling 2023-12-14 13:53:17 +11:00
Campbell Barton 4f609a4f96 Cleanup: typo in internal ghost/wayland prefix 2023-12-14 13:53:16 +11:00
Campbell Barton 944e0483a6 Cleanup: clarify naming for MLoopTri
The term `looptri` was used ambiguously for both single & arrays.
The term `tri` was also used, causing `tri->tri`.

Use terms:

- `looptris` for an array or when dealing with multiple items.
- `looptri` is used when dealing with a single item.
- `lt` for a single MLoopTri variables & arguments.

This was already a convention but not followed closely.
2023-12-14 12:32:11 +11:00
Brecht Van Lommel ac753fe9ae Fix: Cycles assert with CPU denoiser 2023-12-13 22:27:46 +01:00
rajveermalviya 639de68aaa Fix eyedropper outside blender on mac
Support for picking colors from outside of the blender window on macOS

Pull Request: https://projects.blender.org/blender/blender/pulls/115187
2023-12-13 22:02:56 +01:00
Stefan Werner fd8bb41224 Cycles: Enable HIP devices for OpenImageDenoise
This enables the HIP backend of OpenImageDenoise on supported devices.

Co-authored-by: Werner, Stefan <stefan.werner@intel.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115854
2023-12-13 21:38:19 +01:00
Campbell Barton a56d0c700c Fix GHOST/Wayland handling of out-of-order time-stamps
From what I can tell time-stamps are supposed to be monotonic
however with LIBDECOR & GNOME click events after resizing the window
can cause this to happen.

Resolve by only considering the value wrapped when the new time-stamps
wrapped difference is less than the unwrapped difference.
Also skip wrapping when the current offset is closer to the current time
than it would be with the offset applied.
2023-12-13 14:58:58 +11:00
Campbell Barton 6e0037e54d Fix #115878: build error with LIBDECOR & WITH_GHOST_WAYLAND_DYNLOAD=OFF
There were two problems here:

- libdecor_frame_get_content_* is not available in LIBDECOR v0.1.0.
- These functions aren't exposed by <libdecor.h>,
  they're only exposed by `libdecor-plugin.h`
  (intended for plug-ins that implement window decorations).

Resolve by storing the last applied size from LIBDECOR for reuse.
2023-12-13 10:17:07 +11:00
Campbell Barton 46a9530a75 Cleanup: move internal Wayland cursor API's into their own doxy section
Also resolve building when USE_EVENT_BACKGROUND_THREAD is disabled.
2023-12-13 09:59:06 +11:00
Weizhen Huang 858349d821 Fix #113728: fireflies in Principled Hair Huang with MIS
The function `has_surface_transparent()` needs to be implemented in
order for hair with elliptical cross-sections to work correctly with MIS.

Pull Request: https://projects.blender.org/blender/blender/pulls/116088
2023-12-12 13:30:53 +01:00
Brecht Van Lommel a43f847d54 Cleanup: compiler warning 2023-12-12 13:27:36 +01:00
Brecht Van Lommel d015e98ee6 Fix Cycles ASAN error with boolean kernel arguments 2023-12-12 13:27:36 +01:00
Campbell Barton dc2d7a4707 License headers: conform copyright to SPDX 2023-12-12 13:03:26 +11:00
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
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
Campbell Barton 343b48663b Cleanup: format 2023-11-27 09:30:52 +11:00
Ray Molenkamp 1b6cd937ff Cleanup: CMake: Modernize bf_imbuf dependencies
Pretty straightforward

- Remove any bf_imbuf paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115425
2023-11-25 23:37:24 +01:00
Ray Molenkamp b683bcc46c Cleanup: CMake: Modernize bf_intern_clog dependencies
Pretty straightforward

- Remove any bf_intern_clog paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115323
2023-11-24 17:12:24 +01:00
Jeroen Bakker ec772ed2f1 Vulkan: Timeline Semaphores
This change adds timeline semaphores to track submissions. The previous
implementation used a fence.

Timeline semaphores can be tracked in more detail as it is an counter.
For each submission the counter can be stored locally and when waiting
for completion the counter can be retrieved again and checked if is
known to be succeeded by a higher value.

The timeline semaphore is stored next to the queue and can also be used
to synchronize between multiple contexts.

Pull Request: https://projects.blender.org/blender/blender/pulls/115357
2023-11-24 15:23:46 +01:00
Jeroen Bakker d09d93febf Vulkan: Store Vertex, Index and Storage Buffers on Device Memory
Currently all buffer types were stored in host memory, which is visible to the GPU as well.
This is typically slow as the data would be transferred over the PCI bus when used.

Most of the time Index and Vertex buffers are written once and read many times so it makes
more sense to locate them on the GPU. Storage buffers typically require quick access as they
are created for shading/compute purposes.

This PR will try to store vertex buffers, index buffers and storage buffers on device memory
to improve the performance.

Uniform buffers are still located on host memory as they can be uploaded during binding process.
This can (will) reset the graphics pipeline triggering draw calls using unattached resources.

In future this could be optimized further as in:
* using different pools for allocating specific buffers, with a fallback when buffers cannot be
  stored on the GPU anymore.
* store uniform buffers in device memory

Pull Request: https://projects.blender.org/blender/blender/pulls/115343
2023-11-24 13:52:48 +01:00
Werner, Stefan b12a87b28a Revert "Cycles: Added quality parameter for OIDN"
This reverts commit 2e2291dd83.
2023-11-23 13:50:00 +01:00
Stefan Werner 2e2291dd83 Cycles: Added quality parameter for OIDN
OpenImageDenoise has two modes, high quality and balanced. This now exposes the modes as user parameters, with viewport denoising defaulting to balanced and final frame rendering set to high quality.

Ref #115045

Co-authored-by: Werner, Stefan <stefan.werner@intel.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115265
2023-11-23 12:35:30 +01:00
Brecht Van Lommel b9227da2db Cleanup: rename sse2 specific functions to avoid accidentally using them
Ref #115098

Pull Request: https://projects.blender.org/blender/blender/pulls/115098
2023-11-22 19:45:58 +01:00
Leon Marz 6ec0e0104a Fix build error on architectures without SSE or sse2neon
As color_srgb_to_linear is only defined for them.

Pull Request: https://projects.blender.org/blender/blender/pulls/115098
2023-11-22 19:45:53 +01:00
Leon Marz ea1de499b3 Fix: Increase thread stack size for musl libc
Manually set the stack size to 2mb, same as with Apple

Co-authored-by: Damian Kurek <starfire24680@gmail.com>

Pull Request: https://projects.blender.org/blender/blender/pulls/115094
2023-11-22 19:37:13 +01:00
Sergey Sharybin 6207b83194 Revert "CMake: Give kernel compilation targets access to console"
The side effect which wasn't that obvious from the documentation
is that tasks in the console pool are executed sequentially. This
made the compile-gpu step to take a long time, because the parallel
compilation got disabled.

That was unintended change, so reverting the change.

Instead, for the buildbot, increase the time limit for the step.

This reverts commit 4b891b4afe.
2023-11-22 15:18:12 +01:00
Clément Foucault a001cf9f2b EEVEE-Next: Displacement Option
This add the displacement option to EEVEE materials.
This unifies the option for Cycles and EEVEE.

The displacement only option is not matching cycles
and not particularly useful. So we decided to not
support it and revert to displacement + bump.

Pull Request: https://projects.blender.org/blender/blender/pulls/113979
2023-11-21 19:55:38 +01:00
Brecht Van Lommel fa64573434 Cycles: clearer message when denoising in build without OpenImageDenoise
Fix #115200
2023-11-21 18:57:00 +01:00
Brecht Van Lommel 8845dba79d Fix Cycles rare assert in ensure_valid_specular_reflection
When the incoming direction is exactly orthogonal to the normal

Ref #115071
2023-11-21 18:39:56 +01:00
Jeroen Bakker 27fdfb6538 Vulkan: Memory Statistics
This PR shows the memory footprint in the statusbar when activated.
Only memory allocated on the VRAM is counted. Memory allocated on host
memory is not counted.

![image](/attachments/33cedc89-9ada-4c0a-9a94-6c1b3e22b64b)

Pull Request: https://projects.blender.org/blender/blender/pulls/115184
2023-11-20 14:08:19 +01:00
Stefan Werner 02b5e27f89 Cycles: Add Intel GPU support for OpenImageDenoise
OpenImageDenoise V2 comes with GPU support for various backends. This adds a new class, OIDNDenoiserGPU, in order to add this functionality into the existing Cycles post processing pipeline without having to change it much. OptiX and OIDN CPU denoising remain as they are. Rendering on a supported Intel GPU will automatically select the GPU denoiser.

Device support is initially limited to the oneAPI devices that are supported by Cycles, but can be extended.

Ref #115045

Co-authored-by: Stefan Werner <stefan.werner@intel.com>
Co-authored-by: Ray Molenkamp <github@lazydodo.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/108314
2023-11-20 11:12:41 +01:00
Jesse Yurkovich 9eba3902c9 Fix: Allow Win32 clipboard to properly handle large images
The current code ran afoul of various arithmetic overflow conditions
when attempting to either Copy out or Paste in large images that would
overflow either the naive `w * h * 4` expression or the size of what the
DibV5 header allowed (DWORD, uint32_t).

Pull Request: https://projects.blender.org/blender/blender/pulls/115018
2023-11-18 22:46:41 +01:00
Hoshinova 0b11c591ec Nodes: Merge Musgrave node into Noise node
This path merges the Musgrave and Noise Texture nodes into a single
combined Noise Texture node. The reasoning is that both nodes
intrinsically do the same thing, which is the layering of Perlin noise
derivatives to produce fractal noise. So the patch de-duplicates code
and unifies the use of fractal noise for the end use.

Since the Noise node had a Distortion input and a Color output, while
the Musgrave node did not, those are now available to the Musgrave types
as new functionalities.

The Dimension input of the Musgrave node is analogous to the Roughness
input of the Noise node, so both inputs were unified to follow the same
behavior of the Roughness input, which is arguable more intuitive to
control. Similarly, the Detail input was slightly different across both
nodes, since the Noise node evaluated one extra layer of noise. This was
also unified to follow the behavior of the Noise node.

The patch, coincidentally fixes an unreported bug causing repeated
output for certain noise types and another floating precision bug
#112180.

The versioning code implemented with this patch ensures backward
compatibility for both the Musgrave and Noise Texture nodes. When
opening older Blender files in Blender 4.1 the output of both nodes are
guaranteed to always be exactly identical to that of Blender files
created before the nodes were merged in all cases.

Forward compatibility with Blender 4.0 is implemented by #114236.
Forward compatibility with Blender 3.6 LTS is implemented by #115015.

Pull Request: #111187
2023-11-18 09:40:44 +01:00
Patrick Mours 697114c4b6 Fix #113325: Zero-sized curve leads to OptiX error
Empty hair geometry in Cycles may still report having one curve, even when
there are no actual segments in that curve. This caused an attempt to build
an acceleration structure with zero primitives, which due to other setup
OptiX rejected with an error. Fix that by checking the number of segments
rather than the number of curves in the hair geometry, since the former will
always be zero for empty geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/115044
2023-11-17 17:20:57 +01:00
Germano Cavalcante 952d74ebbb Fix #114867: 'i' key in Turkish layout is marked as 'EVT_QUOTEKEY'
Different from most layouts. The Turkish keyboard layout treats the `i` as the lowercase `İ` and the `ı` as the lowercase `I`.

So we have 2 different types of i: `ı` and `İ`. And two different I key positions on the keyboard.

This key with a different position is mapped as special and returns the corresponding `event->type` of the US keyboard `"` (`EVT_QUOTEKEY`).

The apparently most appropriate event for this key would be `EVT_IKEY`.

This type of change needs to be treated with care, as it may alter other shortcuts that are already common to Turkish users.

Pull Request: https://projects.blender.org/blender/blender/pulls/114917
2023-11-15 15:45:45 +01:00
Michael Jones 0334ca0617 Cycles: Fix #114919: Disable MetalRT-by-default if macOS < 14.0
This PR fixes the issue of Cycles renders ending in compilation failure on base M3 machines which are still on their factory installed OS, older than14.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/114920
2023-11-15 15:39:27 +01:00
Clément Foucault 3ead36a8ba GHOST: Cleanup: Remove GHOST_OPENGL_ALPHA
This is never define and has no use in current blender.

If we want to keep this functionality, we should
at the very least rename it to `GHOST_WINDOW_ALPHA`.

Pull Request: https://projects.blender.org/blender/blender/pulls/114815
2023-11-14 20:24:55 +01:00
Jeroen Bakker 4ecd6abf78 Vulkan: Make Anisotropy Sampling Optional
Anisotropy samplers are optional in Vulkan. This change will disable
anisotropy samplers when the feature isn't available on the device.

The support for anisotropy samplers is around 90% so would not expect
any compatibility issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/114833
2023-11-14 12:24:46 +01:00
Hans Goudey cda624032d Merge branch 'blender-v4.0-release' 2023-11-10 09:19:03 +01:00
Campbell Barton 4e6bca79cd Cleanup: quiet unused variable warnings in CMake
OpenMP_LIBRARIES was used when it wasn't defined.
2023-11-10 09:15:49 +11:00
Michael Jones c30c6b2d4e Cycles: Fix Metal API validation error when Metal motion blur workaround is applied
Following #114544: When running with Metal API validation enabled, allocating a zero-sized buffer results in validation errors. This silences that.

Pull Request: https://projects.blender.org/blender/blender/pulls/114680
2023-11-09 22:23:37 +01:00
Xavier Hallade e317831a82 Cycles: oneAPI: adjust reported device capabilities
It notably adds driver version as it can be helpful when triaging
end-user issues.
2023-11-09 21:46:27 +01:00
Brecht Van Lommel 7b26c3d517 Merge branch 'blender-v4.0-release' into main 2023-11-09 18:24:05 +01:00
salipourto 13171183fa Fix Cycles HIP RT issues with deformation motion blur
The first problem was triangles with motion blur were all grouped into
one category without separating the ones with and without triangle
motion steps.

The second problem was HIP RT uses the generic motion triangle
intersection function and this function checks prim_visibility buffer.
HIP RT doesn't provide the buffer per primitive but passes it to HIP RT
core per instance.

The buffer name was changed to prim_visibility from visibility to be
the same as what Cycles uses but when the motion triangle intersection
function is called from HIP RT kernels, the instance id is passed to
the function instead of primitive id.

Pull Request: https://projects.blender.org/blender/blender/pulls/114555
2023-11-09 18:22:59 +01:00
Campbell Barton 690d427045 Merge branch 'blender-v4.0-release' 2023-11-09 17:01:03 +11:00
Campbell Barton 391b5ac93c Fix uninitialized pending actions for Windows under Wayland
A windows pending actions wasn't cleared for new windows.
Although I'm not aware of user visible bugs, this prevents
unpredictable updates for new windows.
2023-11-09 16:57:06 +11:00
Campbell Barton 58ea0e051f Cleanup: spelling in comments 2023-11-09 09:54:28 +11:00
Campbell Barton 6bba008325 Cleanup: format 2023-11-09 09:34:49 +11:00
Werner, Stefan b414187efb Build: Update OpenImageDenoise to 2.1.0
Major new feature in v2 is GPU support. This is not enabled yet,
this commit only changes the library version without enabling new
functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/112143
2023-11-08 10:12:05 +01:00
Michael Jones 051ce95628 Cycles: Use Metal Program Scope Global Built-ins on macOS >= 14.0
This PR simplifies the kernel entrypoints by using [Metal Program Scope Global Built-ins](https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf) when available (macOS >= 14.0).

Pull Request: https://projects.blender.org/blender/blender/pulls/114535
2023-11-07 11:20:16 +01:00
Campbell Barton aaf05c2497 Cleanup: various C++ changes (use nullptr, function style casts) 2023-11-07 11:35:16 +11:00
Brecht Van Lommel adb41fe6b2 Merge branch 'blender-v4.0-release' into main 2023-11-06 19:13:18 +01:00
Brecht Van Lommel fe9e28c086 Fix build error on macOS x86, after Metal motion blur workaround
Ref #114544
2023-11-06 18:50:25 +01:00
Michael Jones 4f52ab0b49 Cycles: Workaround MetalRT TLAS build hanging in some motion blur scenes
This PR works around an issue where zero-filled motion TLAS instance descriptors can cause unexpected hangs during downstream TLAS builds on M3. Instead of zeroing the descriptor we insert an explicit "null" BLAS, achieving the same result.

Pull Request: https://projects.blender.org/blender/blender/pulls/114544
2023-11-06 17:30:48 +01:00
Miguel Pozo 6d0b5e2ace EEVEE-Next: New shadow settings
Remove `Material > Shadow Mode` and use `Object > Shadow Ray Visibility`
and `Material > Transparent Shadows` instead.

The versioning system auto-updates objects/materials in EEVEE
scenes so their behavior is as close as possible to the previous one.

Update Cycles to use the native `use_transparent_shadow` property.

Note:
Material changes don't set any `recalc` flag on the objects that use
them, so the EEVEE Next shadow maps don't update when changing
settings/nodes.
Fixing this issue is required for 4.1, but it's out of the scope of this PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/113980
2023-11-06 15:45:00 +01:00
Campbell Barton 2b508f7ae3 Cleanup: cmake indentation 2023-11-04 16:41:18 +11:00
Campbell Barton 134393e846 Cleanup: spelling in comments 2023-11-04 14:08:13 +11:00
Brecht Van Lommel 14f470cdae Merge branch 'blender-v4.0-release' into main 2023-11-02 19:02:35 +01:00
Brecht Van Lommel 49c3dc9d7f Fix 114336: Cycles crash switching render pass in the viewport 2023-11-02 17:24:54 +01:00
Xavier Hallade 1161455084 Build: upgrade Intel Graphics Compiler on Linux
In order to speedup compilation, we upgrade IGC to 1.0.14828.26 along
with ocloc and the associated dependencies.
We also bump min-driver version accordingly to 26918.

Ref !114341
2023-11-02 22:27:38 +11:00
Sergey Sharybin 317ee3b6ea Merge branch 'blender-v4.0-release' 2023-10-31 17:29:41 +01:00
Sergey Sharybin 4b891b4afe CMake: Give kernel compilation targets access to console
Done by passing USES_TERMINAL to the add_custom_command().

This allows to see sub-command messages early on, before they
are finished executing.

This should help buildbots to "see" that the kernels are still
being compiled and not kill the build because it did not output
anything in a long time.

Pull Request: https://projects.blender.org/blender/blender/pulls/114327
2023-10-31 17:29:03 +01:00
Campbell Barton 3d3b8ae736 Merge branch 'blender-v4.0-release' 2023-10-31 21:36:34 +11:00
Michael Jones f2bb4c617f Cycles: Apple M3 tuning including hardware raytracing
This PR adds tunings for the [newly announced](https://www.youtube.com/watch?v=ctkW3V0Mh-k) M3 family of chips. In particular, MetalRT will be enabled as the automatic default for intersection testing on M3 and beyond to take advantage of hardware raytracing. This will result in significant path-tracing speedups, as well as faster BVH builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/114296
2023-10-31 11:14:16 +01:00
Jeroen Bakker e7148fc28e Vulkan: Enable Optional Vulkan 12 Features
`shaderOutputLayer` and `shaderOutputViewportIndex` are optional in
Blender, but when used they should be activated on physical device level.
This wasn't the case and when used the validation layer reported an error.

This PR activates the features when creating the device if the features
are available.

Pull Request: https://projects.blender.org/blender/blender/pulls/114303
2023-10-31 08:37:31 +01:00
Lukas Stockner d15013b583 Merge branch 'blender-v4.0-release' 2023-10-31 05:48:58 +01:00
Alaska a15f9e49ec Shader: Only clamp undefined or unsupported inputs of Principled BSDF
Adjust clamping of inputs in the Principled BSDF to avoid errors and
inconsistencies between render engines, while trying to leave as many
inputs as possible unclamped for artisitc purposes.

Pull Request: https://projects.blender.org/blender/blender/pulls/112895
2023-10-31 03:14:04 +01:00
Brecht Van Lommel 39107b3133 Revert changes from main commits that were merged into blender-v4.0-release
The last good commit was 8474716abb.

After this commits from main were pushed to blender-v4.0-release. These are
being reverted.

Commits a4880576dc from to b26f176d1a that happend afterwards were meant for
4.0, and their contents is preserved.
2023-10-30 21:40:35 +01:00
Brecht Van Lommel 9b2deb37a0 Fix Cycles render not stopping on OpenImageDenoise error
Stop so that render farms do not save an image that failed to be denoised
properly and assume it is correct.
2023-10-30 18:08:34 +01:00
Sergey Sharybin ecb346d9df Merge branch 'blender-v4.0-release' 2023-10-30 12:49:40 +01:00
Sergey Sharybin 8474716abb Fix description of MetalRT option
Descriptions should not end with a full-stop.

Pull Request: https://projects.blender.org/blender/blender/pulls/114267
2023-10-30 12:48:04 +01:00
Michael Jones e9ad267151 Cycles: Remove MetalRT experimental status, and add "auto enable" option
_(NOTE: This is a clone of [PR 114067](https://projects.blender.org/blender/blender/pulls/114067), but targeting `blender-v4.0-release` as originally intended)_

This PR removes the "experimental" disclaimer from the MetalRT control now that the unit tests all render correctly with it enabled. As well as "Off" and "On", this adds a third "Auto" setting - a new default which can be used to pick the best option.

Pull Request: https://projects.blender.org/blender/blender/pulls/114232
2023-10-29 14:19:39 +01:00
Campbell Barton d31c61edee Cleanup: spelling in comments 2023-10-27 12:13:48 +11:00
Miguel Pozo 247491ef0f Merge branch 'blender-v4.0-release' 2023-10-25 18:58:22 +02:00
Michael Jones af9ffee152 Cycles: Metal: Fix occasional anim corruption (KernelData MD5 refresh bug)
This fixes an issue where animation frames occasionally get corrupted (e.g. when rendering "Pokedstudio" Blender 2.77 splash screen). This happens when the KernelData is refreshed but the MD5 isn't immediately regenerated which can cause the wrong PSO to be selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/114153
2023-10-25 17:47:13 +02:00
Campbell Barton 28394dd42e Merge branch 'blender-v4.0-release' 2023-10-25 21:20:28 +11:00
Campbell Barton 8e38cd9b8f Correct potential error in recent Wayland/LIBDECOR window size change
While the fix worked in my tests, the compositor is allowed to ignore
a requested window state change which could have entered an eternal
loop. Avoid this by limiting the while loop to 2x round-trips.
2023-10-25 21:17:31 +11:00
Campbell Barton ab1be3bd48 Merge branch 'blender-v4.0-release' 2023-10-25 20:47:41 +11:00
Campbell Barton dcaeed7522 Fix Wayland/LIBDECOR size on startup when maximized
Even though the window was maximized, the non-maximized size was used.
Since the display size was used the window would be slightly larger,
clipping the status bar in GNOME.
2023-10-25 20:42:27 +11:00
Campbell Barton 6ba74de1f2 Merge branch 'blender-v4.0-release' 2023-10-25 15:43:27 +11:00
Campbell Barton 16551f9201 Merge branch 'blender-v4.0-release' 2023-10-25 15:43:22 +11:00
Campbell Barton 3638aa5b77 Fix Wayland/LIBDECOR assuming a normal window state on startup
As the window state will have been initialized, read the current window
state instead of assuming normal so changes are properly detected.

Also note that the cause of #107314 has been fixed up-stream.
2023-10-25 11:21:17 +11:00
Michael Jones 4e3ee4f026 Cycles: Fix animation hangs/crashes in Metal due to leaking temp objects
This PR adds `@autoreleasepool` blocks around functions that have been observed to create hidden temporary NSObjects, and eventually cause command buffer failures. A couple of allocations needed to be tweaked in order to maintain correct retain/release behaviour. This PR also fixes the command buffer error text to show more useful information.
2023-10-24 23:20:16 +01:00
Michael Jones af629b8c20 Cycles: Remove MetalRT experimental status, and add "auto enable" option
This PR removes the "experimental" disclaimer from the MetalRT control now that the unit tests all render correctly with it enabled. As well as "Off" and "On", this adds a third "Auto" setting  - a new default which can be used to pick the best option.

Pull Request: https://projects.blender.org/blender/blender/pulls/114067
2023-10-24 14:33:47 +02:00
Campbell Barton 63dc379dcc Merge branch 'blender-v4.0-release' 2023-10-24 11:44:09 +11:00
Campbell Barton ca32ba33ae Fix #113961: Incorrect window size for new windows on Wayland
When the output wasn't fractionally scaled but the compositor supports
fractional scaling, new windows were smaller than requested.

Caused by [0] which was incorrectly calculating the non-fractional scale
used by LIBDECOR (which isn't accessible via it's API).

Resolve by only using fractional scaling logic when outputs
have a fractional component.

[0]: 3eda5a114f
2023-10-24 11:42:18 +11:00
Sebastian Parborg b77209e617 Merge branch 'blender-v4.0-release' 2023-10-23 15:03:43 +02:00