Commit Graph

130473 Commits

Author SHA1 Message Date
Bastien Montagne 9c2330d821 Assets: Cleanup/deduplicate usages of RNA enum for asset lib types.
The same data was essentially defined twice.

Pull Request: https://projects.blender.org/blender/blender/pulls/115353
2023-11-24 15:25:25 +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
Jason Fielder 18f7d158fe GPU: cleanup texture view usage flags
Texture usage flag `GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW`
was originally implemented and used too conservatively for many
cases in which the underlying API flags were not required.

Renaming to `GPU_TEXTURE_USAGE_FORMAT_VIEW` to reflect
the only essential use case for when a texture view is initialized with
a different texture format to the source texture. Texture views can
still be created without this flag when mip range or base level is
adjusted,

This flag is still required by stencil views and internally by the Metal
backend for certain feature support such as SRGB render toggling.

Patch also includes some small changes to the Metal backend to
adapt to this new compatibility and correctly capture all texture view
use-cases.

Related to #115269

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/115300
2023-11-24 15:21:00 +01:00
Bastien Montagne e14c9552c3 Liboverride: Refactor 'refresh' tagging and handling.
Move tagging from `flush_editors_id_update` to `deg::id_tag_update`.

Since ID relationships cannot always be trusted when tagging for update
happens (can happen e.g. during liboverride apply itself, when deleting
IDs, and so on), embedded IDs are simply tagged here too, instead of
directly tagging their owner ID.

Propagation from embedded to owner ID then happens when checking and
'consuming' the `LIB_TAG_LIBOVERRIDE_AUTOREFRESH` ID tag, in
`BKE_lib_override_library_main_operations_create`.

Pull Request: https://projects.blender.org/blender/blender/pulls/115319
2023-11-24 14:51:30 +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
Clément Foucault ab7505c7ce EEVEE-Next: Disable distant light if world contains absorption
This restrict the usage of distant light if the world shader
contains absorption phenomenon.

Why this is needed is described in #114062.

At the same time, this removes the parameter for enabling
volume light as this is now an auto-detected optimization.

This also contains a few small cleanups.

Pull Request: https://projects.blender.org/blender/blender/pulls/115284
2023-11-24 13:51:07 +01:00
Jeroen Bakker 736f446eed Vulkan: Pipeline Cache
This PR adds the default vulkan pipeline cache to when creating
pipelines.

Pipeline caching reuses pipelines that have already been created.
Pipeline creation can be somewhat costly - it has to compile the
shaders at creation time for example.

The cache is recreated at each run of Blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/115346
2023-11-24 13:28:09 +01:00
Jeroen Bakker c0cb39e41b Vulkan: Enable Tests Not Relying on a Context
Some test cases inside the vulkan backend don't rely on an initialized
Vulkan Context and can always be run.

This PR enables those test cases when `WITH_GTEST` and
`WITH_VULKAN_BACKEND` is on. Allowing some tests to run on the
buildbot.

Pull Request: https://projects.blender.org/blender/blender/pulls/114574
2023-11-24 13:27:41 +01:00
Christoph Lendenfeld bb10004377 FIx: memory leak when inserting keys
The issue was that RNA_path_from_ID_to_property
returns a char * that the caller is expected to free.
But the code was storing it in a std::string
2023-11-24 13:07:09 +01:00
Christoph Lendenfeld 30b0c5b225 Fix: Inserting keys no longer sets the FCurve channel color
When pressing `I` in the viewport, the colors of the FCurve channels were no longer set correctly.

Caused by #113504

Fix by removing the flag that determined that in the first place,
and read straight from the user preferences. Then move the code
that sets the mode on the FCurve into the function that actually creates it.

For 99% of cases the code went to the user preference flag `AUTOKEY_FLAG_XYZ2RGB`
and if that was set, the `INSERTKEY_XYZ2RGB` would be set. The only case where this
was not from the user preferences was from custom keying sets.
There was an override flag for FCurve colors on custom keying sets.
I removed that with this patch since the use case is not apparent
and custom keying sets are hardly used.

Pull Request: https://projects.blender.org/blender/blender/pulls/115297
2023-11-24 13:05:10 +01:00
Christoph Lendenfeld fc0ede2799 Refactor: Move insert_key_rna from editors to animrig
No functional changes.

The function is useful for autokeying as well, which is why
it is being moved out of the editors.

Pull Request: https://projects.blender.org/blender/blender/pulls/115349
2023-11-24 12:56:46 +01:00
Pratik Borhade 754c168ed3 Fix: Compiler warning about unused variable
Caused by 3dc119a440
2023-11-24 17:25:04 +05:30
Jacques Lucke 20eaac747f Fix #115277: cannot create group interface for custom sockets
The problem here was that `RNA_parameter_set_lookup` was used incorrectly.
Instead of passing in the `PointerRNA`, one can pass in the value directly. If one
wanted to pass the `PointerRNA`, one would have to use `PARM_RNAPTR`, but
that's not necessary here.

Pull Request: https://projects.blender.org/blender/blender/pulls/115347
2023-11-24 12:46:55 +01:00
Bastien Montagne 43c801ed92 Cleanup: typo in `rna_enum_asset_library_type_items` name. 2023-11-24 11:47:38 +01:00
Iliya Katueshenock 86fb922f54 Cleanup: BLI: add assertion for uninitialized boolean in IndexMask.from_predicate
Not properly initialized booleans cause problems due to the branchless increment.

Pull Request: https://projects.blender.org/blender/blender/pulls/115338
2023-11-24 10:30:18 +01:00
Jacques Lucke cbe0cf0bb0 Geometry Nodes: add two inputs in Index Switch by default
Having this node with only a single input is not useful.
2023-11-24 09:57:38 +01:00
Jacques Lucke 8eaf89cc41 Geometry Nodes: set soft min/max in Index Switch node 2023-11-24 09:54:12 +01:00
Jacques Lucke ea98c39c50 Cleanup: remove debug print 2023-11-24 09:52:50 +01:00
Pratik Borhade 3f6d1d098c NLA: Console warnings about missing channel_index property
channel_index was renamed to track_index in f9b9ec3b26. Commit missed
one change in `ANIM_channel_draw_widgets`, hence the error in console
when mouse is over NLA editor.

Pull Request: https://projects.blender.org/blender/blender/pulls/115332
2023-11-24 07:24:44 +01:00
Jeroen Bakker 9aac9254cc Cleanup: Make format 2023-11-24 07:20:52 +01:00
Ray Molenkamp 23430f4db8 CMake: Disable vcpkg for msbuild based builds
vcpkg somewhat forcefully injects itself into the build system
causing some work stations to use the vcpkg headers/libs rather than
the headers from our lib folder,we added some mitigation against this
in 34b3a9583a but still the occasional
user with build issues showed up, this should nip that in the bud once
and for all.
2023-11-23 17:19:06 -07:00
Harley Acheson fe50189193 Refactor: Text Editor Formatted Output
Simplification of formatted text output in the Text Editor, removing
duplication and redundancies. Removes 35 lines.

Pull Request: https://projects.blender.org/blender/blender/pulls/110174
2023-11-24 00:42:32 +01:00
Harley Acheson b4b898063e Cleanup: Make format
Formatting changes resulting from Make Format
2023-11-23 15:09:36 -08:00
Clément Foucault 2ece99891b Fix: EEVEE-Next: Metal shader compilation error
`vertex` is the name of the function entry point and is
defined as a macro. Renaming fixes the issue.
2023-11-23 23:53:23 +01:00
Harley Acheson 6ae5e1ade8 Core: Allow Optional Use of Harfbuzz and FriBiDi
Harfbuzz and FriBiDi are included in our external libraries for all
platforms. This PR adds the glue to make them available as optional
build components (off by default).

Pull Request: https://projects.blender.org/blender/blender/pulls/114947
2023-11-23 23:35:03 +01:00
Harley Acheson 694104f8aa Fix: Failing bf_io_wavefront_obj_tests test
BLF needs to initialized to properly set up Freetype, caching, etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/115318
2023-11-23 21:49:28 +01:00
Miguel Pozo 13139f593e Fix: EEVEE-Next: Add transparency blending back
The flag was incorrectly removed in 440f39f2e5
2023-11-23 20:22:34 +01:00
Miguel Pozo 1d2a27d49e Fix: EEVEE-Next: Motion Vectors for non float4 position buffers
Use a compute shader to copy non float4 position vertex buffers into the
`geometry_steps` buffer.

Fix #113730
Fix #114775
Fix #114144

Pull Request: https://projects.blender.org/blender/blender/pulls/115309
2023-11-23 19:49:56 +01:00
Harley Acheson 604ee2d036 VFont: Use BLF for font & glyph loading
Load VFont curves using BLF API rather than local FreeType calls.

Pull Request: https://projects.blender.org/blender/blender/pulls/110187
2023-11-23 18:12:04 +01:00
Miguel Pozo f97580f665 GPU: Assert no UINT push constants are used 2023-11-23 17:46:50 +01:00
Christoph Lendenfeld f06fd85d97 Anim: Restrict range of fcurve_to_keylist
# Issue
Having a lot of keys in your scene can dramatically slow down the Dope Sheet.
That is because everytime the Dope Sheet is redrawn,
the Keylists have to be recomputed.
In the case of the summary channel, that means going through
all keyframes of all the `FCurves` and adding them to the keylist.
That eats up 95% of the time it takes to draw a frame.

# This PR
It's not a perfect solution, rather it solves the performance issue
for the case when you are not displaying all keys.
Instead of going through all the keys, only add the
keys visible in the view to the keylist.
This speeds up the Dope Sheet significantly
depending on the zoom level.

This also improves the responsiveness when selecting and transforming keyframes.

# Performance changes

The function measured is `ED_channel_list_flush`
which is responsible for building the keylists and drawing them.
The test setup contains 62 bones with all
10 channels keyed (location, rot quaternion, scale) on 6000 frames.
So 3.720.000 keys. The heavier the dataset the bigger the performance impact.

The data was recorded with only the Dope Sheet open, and 3 channels visible
* Summary
* Object
* Action

The more channels are visible, the greater the performance gain. This can be seen in the video.

| visible range | before | after |
| - | - | - |
| 200f | 250ms | 10ms |
| 400f | 250ms | 18ms |
| 3000f | 250ms | 130ms |
| 6000f | 250ms | 250ms |

Pull Request: https://projects.blender.org/blender/blender/pulls/114854
2023-11-23 16:37:32 +01:00
Antonio Vazquez 9d8283d113 GPv3: Hide Others operator
This operators hide all materials except the active one.

There is a parameter to hide only active as it was in GPv2.

Related to #114997

Pull Request: https://projects.blender.org/blender/blender/pulls/115038
2023-11-23 16:03:30 +01:00
Miguel Pozo ae1e2951c7 Fix #115144: isect_data_setup compiler error
Rename `isect_data_setup` functions to avoid shader compiler errors.

Pull Request: https://projects.blender.org/blender/blender/pulls/115175
2023-11-23 16:02:10 +01:00
Miguel Pozo cb9584b561 Fix #114482: EEVEE-Next: Wrong Texture Coordinates
Fix Texture Coordinates in World material and screen_coordinates
when using overscan.

Pull Request: https://projects.blender.org/blender/blender/pulls/115057
2023-11-23 15:58:08 +01:00
Miguel Pozo 3197881ca3 Fix #114302: EEVEE Next: Curves material compilation errors
Add missing includes and remove the attributes_lib from shaders
that don't need them.

Pull Request: https://projects.blender.org/blender/blender/pulls/114598
2023-11-23 15:47:56 +01:00
Antonio Vazquez 1d6a617aa2 GPv3: Lock and Unlock all materials operators
This is the conversion of existing operators in GPv2.

Related to #114997

Pull Request: https://projects.blender.org/blender/blender/pulls/115041
2023-11-23 15:36:05 +01:00
Nate Rupsis f9b9ec3b26 Cleanup: internally renaming NLA Channels to NLA Tracks
After renaming "NLA Channels" to "NLA Tracks" user facing, doing a cleanup pass to internally rename things.

Pull Request: https://projects.blender.org/blender/blender/pulls/115011
2023-11-23 15:33:40 +01:00
Antonio Vazquez eb935bf32d GPv3: Lock Unused Materials operator
Conversion of GPv2 operator.

Related to #114997

Pull Request: https://projects.blender.org/blender/blender/pulls/115272
2023-11-23 15:31:47 +01:00
Bastien Montagne 8fc2b63468 Fix (unreported) Scene Collection runtime data not cleared on write. 2023-11-23 15:07:40 +01:00
Bastien Montagne a1507baead Collection: Revert moving `owner_id` to runtime data.
While it may have been working from a practical PoV (not certain though,
since some bug would prevent clearing runtime data when writing embedded
Scene collection in current code), this is semantically wrong.

The owner of an embedded ID is a critical piece of information in
Blender data structure and ID management code. Having it written in
.blend files is also a potential good source of data for investigating
issues.

Further more, this handling of `owner` ID data is somewhat generic now
in ID management, so if this data should be considered runtime, then the
change should also be made in NodeTree and Key IDs.

This commit partially reverts 44dd3308a5, in the future I'd like to
be involved in the review of changes affecting ID management.

NOTE: fix for embedded collection runtime data not being cleared on
write will be committed separately.
2023-11-23 15:07:40 +01:00
Pratik Borhade 3dc119a440 Fix #112767: Outliner unlink operation fails to unlink from scene
When in scene mode, operation searches the object in master collection
to unlink. But object can be in any collection. So iterate through all
collections present in scene to unlink the object

Pull Request: https://projects.blender.org/blender/blender/pulls/112955
2023-11-23 14:49:18 +01:00
Jure Triglav 319ff28b7b Initial exposure of compute dispatch and image store in Python API
Motivation: When discussing with @Jeroen-Bakker and @aras_p about how to
approach sorting when rendering Gaussian splats in Blender, we realised that
compute shaders could help there (and have many other use cases), and that also
due to Blender 4.0 being on OpenGL >= 4.3, we can now rely on compute shaders
existing.

This PR is an initial pass for that functionality. It comes with a Python example, which
runs a compute shader and saves the output to a texture, which is then rendered in the
viewport.

There is no exposed support for storage buffers yet, but I expect I'll be able to work on
them soon if this is accepted.

The newly added parts are:
1. `gpu.compute.dispatch()`
2. a way set the compute source to `GPUShaderCreateInfo`: `shader_info.compute_source()`
3. a way to set the image store for `GPUShaderCreateInfo`: `shader_info.image()`
4. a way to set the `local_group_size` for `GPUShaderCreateInfo`: `shader_info.local_group_size(x,y,z)`
5. a way to get `max_work_group_size` from capabilities: `gpu.capabilities.max_work_group_size_get(index)`
6. a way to get `max_work_group_count` from capabilities: `gpu.capabilities.max_work_group_count_get(index)`

Pull Request: https://projects.blender.org/blender/blender/pulls/114238
2023-11-23 14:23:26 +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
Christoph Lendenfeld 1905667967 Refactor: Rename eAutokey_Flag enum
No functional changes.

Rename the `eAutokey_Flag` to `eKeyInsert_Flag`
to indicate that it is not only used for auto keying.
Also rename the enum items to better reflect what they are used for.

Pull Request: https://projects.blender.org/blender/blender/pulls/115295
2023-11-23 12:09:23 +01:00
Jeroen Bakker 9cb2394d7a OpenGL: Mark Legacy Intel Drivers Unsupported
These drivers crash on startup caused by a driver bug. This include the
latest drivers for legacy Intel CPUs with a HD 4000/HD 5000 series GPU.

To be on the safe side all drivers with version 20.19.15.51* will be marked
unsupported as we don't have the platforms to identify the precise driver
versions that fail.

See #113124 for more information.

Pull Request: https://projects.blender.org/blender/blender/pulls/115228
2023-11-23 08:00:22 +01:00
Richard Antalik f4e28d4762 Fix #114982: Crash when rendering scene strips
Since b1526dd2c6, viewport renderer sets `G.is_rendering`, but VSE scene
rendering function used this to decide whether to do offscreen opengl
render or use render API. This logic was quite weak.

Use `SeqRenderData::for_render` instead of `G.is_rendering`, since it
explicitly defines whether strip rendering is invoked by F12 render job.

Since offscreen gl rendering rely on `BLI_thread_is_main()` being
true, use this to initialize `do_seq_gl` variable for clarity.

The use of render job path was further conditioned on `G.is_rendering`,
with exception of running headless, but this condition was incorrect.
This condition was reformulated as precondition, which if true, returns
`nullptr` instead of crashing.

Pull Request: https://projects.blender.org/blender/blender/pulls/115079
2023-11-23 04:29:09 +01:00
Germano Cavalcante a13696a242 Fix #115279: FModifier.type enum 'NULL' item was renamed to 'nullptr'
The 'NULL' identifier within the `FModifier.type` enum was acidently
renamed to 'nullptr' during the C to C++ source conversion in 3ece6876af.
2023-11-22 18:44:44 -03:00
Harley Acheson ff04d50eee Cleanup: Make format
Formatting changes resulting from running Make Format
2023-11-22 12:50:31 -08:00
Hans Goudey 876b624320 Cleanup: Correct offset indices slice assert
If the slice is empty, there doesn't have to be enough space for i
2023-11-22 15:48:42 -05:00