Commit Graph

127013 Commits

Author SHA1 Message Date
Jeroen Bakker 53396816e4 Vulkan: Make Polyline Shaders Vulkan Compatible
Splitting interface stages based on the interpolation of its
attributes.

Then naming convention that have been used:

* use `interp` as instance name when using smooth interpolation
* use `interp_noperspective` when using no perpective interpolation
* use `interp_flat` when using flat interpolation

The same suffix will be added to the struct names.
The naming convention will be added to the GLSL code style and
applied to other shaders as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/111210
2023-08-17 11:31:10 +02:00
Bastien Montagne a99cccaff8 Fix (unreported) WM 'foreach_id' code skipping `unpinned_scene` pointer.
Previous code would not process that ID pointer in case the
`workspace_hook` pointer was null.
2023-08-17 10:57:58 +02:00
Jeroen Bakker 826ebccb42 Cleanup: Make format 2023-08-17 10:53:53 +02:00
Jeroen Bakker 074f10470c Vulkan: Add Workaround for Mixed Interpolation Attributes
shaderc generates an error when a struct containing an int type
isn't qualified as flat. We work around this issue by changing the
interpolation mode to flat during code generation.

Pull Request: https://projects.blender.org/blender/blender/pulls/111211
2023-08-17 10:53:05 +02:00
Christoph Lendenfeld bb8766ef01 Animation: Match Slope slider
It blends selected keys to the slope of neighboring ones.
It is used to push the segment closer to the values of the next or previous pose.

Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/110567
2023-08-17 10:28:46 +02:00
Sybren A. Stüvel 0e2875ede9 Prevent crash when color management is turned off
Prevent a segmentation fault when the viewport is set to 'Material Preview'
mode, drawing textures, and Blender built with `WITH_OPENCOLORIO=OFF`.

Most `IMB_colormanagement_...` functions assume that the `colorspace`
pointer can be `nullptr`, but the internal function
`colormanage_ensure_srgb_scene_linear_info()` does not, causing a crash.

Since this check can be done in multiple places, I picked one that seems
consistent with the rest of the code.

Pull Request: https://projects.blender.org/blender/blender/pulls/111144
2023-08-17 10:21:09 +02:00
Jeroen Bakker f44447a628 Vulkan: Use Correct Interpolation Qualifier in Stage Interfaces
This PR cleans up the Stage Interface code generation and use the
correct interpolation qualifier. This is a cleanup/fix before we can
start converting shaders stage interfaces to be compatible with vulkan.

Ref: #111138 for more information about vulkan compatibility
Pull Request: https://projects.blender.org/blender/blender/pulls/111207
2023-08-17 09:40:34 +02:00
Jeroen Bakker 6f9c3b1bd5 Vulkan: Report Incompatible Shaders
A difference was detected between stage interfaces between OpenGL and Vulkan
that are not compatible with our current API.

**OpenGL**

In OpenGL an stage interface struct can have different interpolation qualifiers
per attribute.

```glsl
struct MyStageInterface {
    smooth vec4 color;
    flat int face_flag;
};
layout(..) MyStageInterface interp;
```

**Vulkan**

In vulkan the interpolation qualifier isn't supported on attribute
level and needs to be added to the struct.

```glsl
struct MyStageInterface {
    vec4 color;
};
struct MyStageInterface_flat {
    int face_flag;
};
layout(..) smooth MyStageInterface interp;
layout(..) flat MyStageInterface_flat interp_flat;
```

This patch reports shaders that are incompatible with Vulkan so they can be
patched. Report is only done in debug mode and when using the vulkan backend.
After all shaders are patched an error will be raised so developers will
known immediately when incompatibility are created.

Making the shaders compatible and adding the error will be done in future
patches.

**Python**

Via Python gpu module (gpu.types.GPUShaderCreateInfo) it isn't possible
to construct an incompatible shader as instance names cannot be set
via the API. So this isn't a breaking change.

Pull Request: https://projects.blender.org/blender/blender/pulls/111138
2023-08-17 08:59:03 +02:00
Campbell Barton b1b20bea7b Fix Shader::print_log not handling warnings
Severity::Error was checked twice.
2023-08-17 16:53:08 +10:00
Campbell Barton 0a04a6d1a1 Cleanup: quiet GCC's -Wsuggest-attribute=format warning 2023-08-17 16:52:45 +10:00
Jeroen Bakker bbe4f6cf74 Fix: Compilation Error When Compiling with Vulkan
This PR fixes an compilation error where sstream used to be included
on a higher level, but has been removed and we need to include them
where they are actually used.

This wasn't detected as most developers don't have the vulkan backend
active.

Pull Request: https://projects.blender.org/blender/blender/pulls/111203
2023-08-17 08:24:29 +02:00
Campbell Barton 8b840eb896 Cleanup: quiet redefined warning in GLOG 2023-08-17 16:09:58 +10:00
Campbell Barton 8d26dda40c Fix #111186: Crash backtrace missing on Linux
Regression in [0] which caused `execinfo.h` not to be detected by CMake.

Setting a default variable for other platforms prevented the new
variable from being set.

[0]: f197b1a1f1
2023-08-17 13:45:11 +10:00
Campbell Barton 5478798526 Cleanup: use lowercase cmake commands
The `Find*.cmake` modules originally used uppercase commands to match
CMake's own conventions. Since then CMake uses lower-case and even
within our own find modules, using all uppercase wasn't done
consistently. Opt for lowercase everywhere.
2023-08-17 13:15:56 +10:00
Campbell Barton ae4cb60ea3 Authors Script: support excluding authors via GLOB expressions
Exclude `* <*@apple.com>` developers,
update canonical authors.

No changes to the generated output.
2023-08-17 12:43:11 +10:00
Campbell Barton 08b77bfd44 CMake: resolve undefined PROJECT_VERSION warning for quadriflow/lemon
While it seems harmless, LEMON_VERSION wasn't set by our CMake files.
2023-08-17 11:54:01 +10:00
Campbell Barton af16faf5d7 CMake: quiet AUDASPACE warning setting an old minimum_version
PR submitted upstream.
2023-08-17 11:53:59 +10:00
Campbell Barton cfc9473c3f CMake: always define BROTLI_LIBRARIES
Previously FREETYPE_LIBRARIES would sometimes contain
BROTLI libraries, since some configurations set them separately,
declare them separately under all configurations to avoid
changes to one platform breaking others.

Also quiets uninitialized variable warning.
2023-08-17 11:53:58 +10:00
Campbell Barton c713c70781 CMake: quiet uninitialized warnings 2023-08-17 11:53:56 +10:00
Campbell Barton 3ce80d2168 CMake: remove reference to unused OPENIMAGEIO_DEFINITIONS 2023-08-17 11:53:55 +10:00
Campbell Barton 120fdf1f4b CMake: remove unknown variable _LEVEL_ZERO_INCLUDE_PARENT_DIR 2023-08-17 11:53:53 +10:00
Campbell Barton 72bdcb4e25 CMake: use more conventional checks that libraries were found
The method of checking the library was found cause an undefined
variable warning when it was found.
2023-08-17 11:53:52 +10:00
Campbell Barton 130af96e6b CMake: quiet case sensitivity warning for Boost_DIR
Quiets warning from CMake policy: CMP0144
2023-08-17 11:53:50 +10:00
Campbell Barton a7c1a57957 CMake: correct WITH_X11_XF86VMODE include path 2023-08-17 11:53:49 +10:00
Harley Acheson d102536b1a Fix #93685: Allow Outliner Drag to Other Windows
Allow dragging items from Outliner to other windows. Disables EdgePan
operator when entering new window. Canceling the drop redraws target
area and resets all modal cursors. But this does not fix incorrect
mouse cursor during operations on the remote target window.

Pull Request: https://projects.blender.org/blender/blender/pulls/105196
2023-08-17 00:48:32 +02:00
Aaron Carlisle 3a99e8898c PyAPI Docs: Update Sphinx and theme
Updates sphinx and the them to the latest versions

This commit also removes 'babel' from the list of requirements, babel is only important for internationalization.
2023-08-16 17:50:37 -04:00
Aaron Carlisle 3ea7117ed1 PyAPI Docs: Fix generation after recent node RNA changes
This commit allows both `rna_enum_` and `rna_node_`to be used for enum prefixes

This also fixes one enum by adding `rna_` to the prefix.

Together these changes fix the API documentation generation.
2023-08-16 17:37:41 -04:00
Germano Cavalcante fc39963b31 Cleanup: Deduplicate code
By unifying the return, we don't need to duplicate the `CoTaskMemFree`
call.

Ref 84718feb4b.
2023-08-16 18:29:12 -03:00
Harley Acheson 0e977a38bc Cleanup: Make format
Formatting changes resulting from Make Format
2023-08-16 14:15:54 -07:00
Guillermo Venegas 84718feb4b Fix potential leaks using SHGetKnownFolderPath
Documentation for `SHGetKnownFolderPath` remarks that the `PWSTR`
parameter should always be freed with `CoTaskMemFree`  even if it
succeeds or not.

Pull Request: https://projects.blender.org/blender/blender/pulls/111128
2023-08-16 23:10:00 +02:00
Harley Acheson 0c7496f74d UI: Increase Color Picker Size
Increase the Color Picker Size by 33%

Pull Request: https://projects.blender.org/blender/blender/pulls/111153
2023-08-16 22:59:14 +02:00
RedMser f1e7fe5492 UI: Windows "Quick Access" items to File Browser System List
On the Windows platform add any Explorer "Quick Access" items to the
bottom of the File Browser "System" List in the sidebar.

Co-authored-by: Harley Acheson <harley.acheson@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/108431
2023-08-16 22:36:06 +02:00
guishe c69f526fdb Windows: Propagate errors in make.bat
Propagate errors out of make.bat so any calling processes can use the
exit code to determine failure during build/update.

Pull Request: https://projects.blender.org/blender/blender/pulls/108727
2023-08-16 19:29:47 +02:00
Brecht Van Lommel 59fb9341cf Build: keep SDL haptics disabled on macOS x86_64
Not yet available for the current minimum of macOS 10.15.
2023-08-16 19:11:41 +02:00
Pablo Vazquez eef2b61e91 Theme: Set 3D Viewport background to single color
The default vignette effect introduces issues reported several times
on various hardware configurations.

It would still be nice to figure out the issue and fix it in the
vignette effect code. For now, simply use single-color in the
default theme.

As agreed during the 2023-08-15 User Interface Module meeting.

Fixes #93627
Closes #106699
2023-08-16 18:45:21 +02:00
Brecht Van Lommel b0424a7cbd Fix #111180: crash adding AOV/light output node with shader node previews
Only happened when the experimental option is enabled.
2023-08-16 18:43:23 +02:00
Brecht Van Lommel 51fd4af648 Build: fix OpenVDB Metal patch not applying cleanly 2023-08-16 18:43:23 +02:00
Bastien Montagne f1e64781a8 Core: foreach_id: Tweak handling of scene collection in LayerCollection.
Unfortunately, relying only on the 'embedded' flag of the collection ID
pointer to detect the LayerCollection of a Scene embedded collection is
not enough, since this info may not always be available.

So add an extra explicit 'is_master' to the recursive code processing
all LayerCollections ID pointerrs, and double-check with an assert that
this info is coherent with the Collection's embedded flag, when
possible.
2023-08-16 18:23:15 +02:00
Pablo Vazquez 952371e63b Fix typo in blender_theme_as_c.py 2023-08-16 17:55:39 +02:00
Bastien Montagne 28305c2c73 Refactor: Properly formalize special versioning done after most of readfile code.
In a few cases (IPO conversion, Proxy conversion, ...), versioning
implies creating or removing IDs, and/or needs access to the whole Main
data-base.

So far this was done ad-hoc by adding some code at the end of
`setup_app_data`.

This commit formalizes this process by adding a BLO call
(`BLO_read_do_version_after_setup`) that will encapsulate all such
complex versioning code.

NOTE: This commit does not address the existing issue that this
versioning code is never performmed when linking new data (outside of
the 'opening a blendfile' context). This topic would require its own
design task.

NOTE: This commit does not fix the few current evil cases of ID creation in
regular versioning code. This will be addressed separately.

Although this commit does modifies slightly some logic in this specific
versioning process, no behavioral changes are expected here.

Pull Request: https://projects.blender.org/blender/blender/pulls/111147
2023-08-16 16:21:59 +02:00
Falk David b14a0ee57e Cleanup: GPv3: Refactor usage of `TreeNode`
Some functionality of `Layer`s and `LayerGroup`s can be shared. This is why the `TreeNode` class exists. It encapsulates all the common methods both `Layer`s and `LayerGroup`s should have.

Up until now, the usage of `TreeNode` was not consistent and often the layers would just access the base c-struct directly.

This refactor makes it so that all of the functions affecting only the `TreeNode` are moved to the `TreeNode` class and only implemented there.

For example, renaming a layer is really just renaming the node. Therefor there shouldn't even be a `rename_layer` and `rename_layer_group` function. These were combined into a `rename_node` function.

Pull Request: https://projects.blender.org/blender/blender/pulls/111177
2023-08-16 16:18:26 +02:00
Bastien Montagne dd647677b6 Fix (unreported) Scene foreach_id callback skipping some NULL ID pointers.
Not sure how bad that was in practice, was likely harmless. But
foreach_id logic should never decide to not process an ID pointer
because its value is NULL. Callback code is expected to handle NULL
pointers appropriately.
2023-08-16 15:04:33 +02:00
Pratik Borhade 338e4ef090 Fix: GPv3 layer renaming when name is unchanged
When old and new names of layers/groups are same, garbage string is
displayed. This is because `oldname` char pointer is referenced to
`node.name`. After function execution, `oldname` memory is freed in
`interface_handler` (see `after.rename_orig`), thus displays garbage
string.
Fix is to copy the content of `oldname` instead of referencing it.

Pull Request: https://projects.blender.org/blender/blender/pulls/111173
2023-08-16 14:48:46 +02:00
Omar Emara 85a3f61150 BLI: Add 2D transformation matrix decomposition
This patch adds support for 2D transformation matrix decomposition into
translation, rotation, and scale.

Pull Request: https://projects.blender.org/blender/blender/pulls/111178
2023-08-16 14:47:14 +02:00
Brecht Van Lommel 1594f7fb95 Build: update SDL to 2.28.2
Older versions don't build with Xcode 14.3.

Ref #109244

Pull Request: https://projects.blender.org/blender/blender/pulls/110975
2023-08-16 14:39:11 +02:00
bsavery c6f5915bc8 Cycles: enable HIP for integrated graphics of Ryzen 7000 CPUs
Specifically the gfx1036 architecture, for AMD Zen4 APUs.

Pull Request: https://projects.blender.org/blender/blender/pulls/110907
2023-08-16 14:35:09 +02:00
Aras Pranckevicius 2f060706a4 Cleanup: fewer BLI_color.hh et al includes
Include counts of some headers while making full blender build:
- BLI_color.hh 1771 -> 1718
- BLI_math_color.h 1828 -> 1783
- BLI_math_vector.hh 496 -> 405
- BLI_index_mask.hh 1341 -> 1267
- BLI_task.hh 958 -> 903
- BLI_generic_virtual_array.hh 509 -> 435
- IMB_colormanagement.h 437 -> 130
- GPU_texture.h 806 -> 780
- FN_multi_function.hh 331 -> 257

Note: DNA_node_tree_interface_types.h needs color include only
for the currently unused (but soon to be used) socket_color function.
Future step is to figure out how to include
DNA_node_tree_interface_types.h less.

Pull Request: #111113
2023-08-16 14:48:53 +03:00
Campbell Barton 92c4756d02 Fix replacement of "Blender Foundation" in recent header change
The recent change to header copyrights [0] unintentionally changed
"Blender Foundation" to "Blender Authors" for the WIN32 file path
which blender is installed into.

Revert lines changed that aren't related to copyright text.

[0]: e955c94ed3
2023-08-16 21:21:55 +10:00
Campbell Barton cede822bdc AUTHORS: regenerate to remove duplicates
Using the same `git_data_canonical_authors` module for
credits & authors exposed more duplicates,
regenerate AUTHORS from the updated data.
2023-08-16 21:00:56 +10:00
Campbell Barton 63fa5b92e7 Authors Script: add script to generate individual contributors
Add the script used generate individual contributors for AUTHORS,
add "make authors" utility that updates the AUTHORS file in-place.
2023-08-16 21:00:20 +10:00