Commit Graph

103705 Commits

Author SHA1 Message Date
Clément Foucault
3973dc080e Fix: GPU: Fix shader builder option not building
This was caused by the recent change in DNA headers
making all extern data C++.
2023-09-04 19:04:44 +02:00
Jason Fielder
68c4e05427 GPU: Add support for rasterization order groups
Enables performance optimizations and new rendering
features through allowing colour attachments to be
tagged with a rasterization order group. This means that
all accesses to the same pixel location are guaranteed
to happen in submission order.

This lays the ground work for tile-based architecture
optimizations, enabling additional features for
deferred rendering which allow subsequent passes
which operate on pixel data to occur in order, while
memory remains on-tile.

This patch allows fragment outputs to be tagged
with a raster order group and also adds a new
FragmentTileIn parameter to a shader, which allows
speciication of incoming parameters from a previous
draw.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/111748
2023-09-04 18:45:40 +02:00
Jason Fielder
503bdbf777 GPU: Add clear color support to explicit FB LoadStore state
Enhance custom framebuffer binding state to allow
specification of clear color as part of the loadstore
state at framebuffer bind time.

This ensures all parameters controlling attachment
loading and storage behaviour can be explicitly
specified when binding a framebuffer.

This change enables optimizations which leverage
explicit framebuffer load store state to also specify
a clear color without prematurely triggering a
clear which may occur independently to
render work when using GPU_framebuffer_clear(..).

Authored by Apple: Michael Parkin-White.

Pull Request: https://projects.blender.org/blender/blender/pulls/111810
2023-09-04 18:30:54 +02:00
Julian Eisel
ba03948dd2 Cleanup: Move BKE preview image code to separate file
Previously, BKE level preview image code was in `BKE_icons.h` and `icons.hh`.
While these types are related, I always found this quite hard to navigate since
preview image stuff was just in the middle of icon functions. Plus, people
don't expect preview image functions in icon files, the relationship is not
obvious.

Instead, use focused files that make it easy to quickly navigate them
and see what they are dealing with.

Pull Request: https://projects.blender.org/blender/blender/pulls/111709
2023-09-04 18:02:16 +02:00
Colin Marmond
372b007a56 Fix #111508: Shader node previews crash when deleting common output
The node-tree does not necessarily contain an output node, so it has to
be checked, as well as the existence of the socket.

Pull Request: https://projects.blender.org/blender/blender/pulls/111604
2023-09-04 18:00:23 +02:00
Damien Picard
564bbdf6e7 I18n: disambiguate and extract a few messages
This commit disambiguates the following messages:

- Sequencer effect strip types: use "Sequence" context in relevant
  places, as that is already extracted as part of the
  `sequencer_prop_effect_types` enum, and more specific.
- "Language" (a natural or programming language)
- "Flat" (gender)
- "Smooth" (action or amount -- very partial disambiguation for now
  because this is all over the place)

It also extracts these messages:

- Newly created Freestyle data
  - LineStyle
  - LineSet
  - Modifiers
- "Registering panel class:" error message from RNA registration
- "Node must be run as tool" error message from tool geometry nodes

Ref #43295

Pull Request: https://projects.blender.org/blender/blender/pulls/111146
2023-09-04 16:16:26 +02:00
Bastien Montagne
9e129abcf2 Fix #111905: Filewrite: Do not write ShapeKeys of unused geometry.
This is more of a temp hack than a proper fix, proper solution would be
to make shapekeys actual embedded IDs (which they are, in all aspects
but actual implementation), and to address long-standing design tasks
about handling of unused data on file save (see #61209 and #87490).

But for now, simply do not write ShapeKeys IDs if they have no owner, or
their owner has no user (and is therefore also not written to disk).
2023-09-04 16:14:23 +02:00
Bastien Montagne
ad60d40ed3 Cleanup: Move 'uneditable' info message about item renaming in Outliner to INFO.
These are not actually warnings, but merely info for the user.

NOTE: A good chunk of these messages are aguably useless actually,
saying 'you cannot rename this' does not add any info for the user...

Better/more informative wording (or removal) of some of these messages
is left for later.
2023-09-04 16:14:23 +02:00
Julian Eisel
4c8847ec4f Cleanup: Remove extern "C" from DNA headers
`extern "C"` did not actually have an effect here since it only impacts
name mangling of functions, not structs (or other class types). Now this
can get in the way when we add C++ blocks with functions , e.g.
templates are not allowed in code with C-linkage.

Most of these were added in ad4b7741db, even though it was known that
this doesn't have any impact. Reason was because developers thought they
would have to add that to all direct and indirect includes to be able to
use a header in C++ (a common misconception). Now with most files
compiled in C++, it's obvious that this isn't the case.

Pull Request: https://projects.blender.org/blender/blender/pulls/111926
2023-09-04 15:59:40 +02:00
Jason Fielder
fa9e3e38d7 Metal: Compute bind state cleanup and debugging
Removes old unused bind state parameters from
prior to the addition of explicit resource location support.

Patch also ensures compute state is reset between each
encoder and adds a debug option to dispatch each
compute command within its own encoder for debugging
synchronization issues.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/111753
2023-09-04 15:29:09 +02:00
Jason Fielder
c375e9725f GPU: Add support for memoryless textures
Memoryless textures are only used as intermediate attachments
during rasterization, but do not have any backing storage. This is
particularly useful if a virutal framebuffer is needed, or, there is
a situation where a depth buffer is only needed within the pass
itself and the results are discarded once the pass completes.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/111749
2023-09-04 15:27:50 +02:00
Jason Fielder
109bc2d416 GPU: Add imageStoreFast for increased write performance
imageStoreFast provides a variant of imageStore which does
not perform any bounds checking, reducing shader divergence,
register pressure and increasing performance through fewer
instructions.

However, this should only be used for cases where the writing
coordinate is guaranteed to fall within the texture.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/111750
2023-09-04 15:15:55 +02:00
Jason Fielder
5cf7089e43 GPU: Ensure usage of gpu_Layer is specified
Some shaders using gl_Layer/gpu_Layer were missing
the correct usage bit in the shader create info. Shaders
also need to inherit feature usage bits from included
additional_info.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/111751
2023-09-04 15:06:20 +02:00
Jason Fielder
5fb952a1a6 EEVEE Next: Resolve out of bounds reads in shadows
Resource IDs and tile shfits often meant buffers were
accessed outside of their valid range. Patch ensures
resource IDs are unpacked and shift ranges are
shifted into the positive range to avoid inconsistent
behaviour with negative modulo operations.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/111808
2023-09-04 15:03:54 +02:00
Alexander Gavrilov
dee29f4e81 Armature: apply new DualQuat scale handling to constraints and crazyspace.
The f12e9f32b5 patch introduced a new improved method of blending
dual quaternion transformations to handle combined scale and rotation
better. However, the changes were not complete:

* The new math ignored crazyspace computations, which need to compute
  a complete transformation matrix. As an optimization, the new method
  avoided fully computing the scale component, so the matrix would
  have no scale or shear.
* The Armature constraint is supposed to behave identically to the
  modifier, and it was not updated. The constraint also requires
  computing a complete matrix.

This change extracts the new math into a utility function, change
the optimization to be controlled by a parameter, and use the new
function in the constraint.

Pull Request: https://projects.blender.org/blender/blender/pulls/111759
2023-09-04 14:49:28 +02:00
Philipp Oeser
6cb96aea7c Fix: Outliner missing update adding asset nodegroups
Blender File view was not listing the new group under "Node Groups"
after import (this is not covered by ED_node_tree_propagate_change() -
and probably shouldnt).

Added the dedicated notifier for this case in the operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/111924
2023-09-04 12:46:22 +02:00
Philipp Oeser
30e3caaf82 Fix #111779: drop asset shading group to GN editor still imports
Dropbox poll function was not sufficiently checking compatibility, so we
could end up calling
`WM_drag_get_local_ID_or_import_from_asset`. The asset might not
actually be used because of further checks later (so it would end up as
an orphan which would go away after save/reload), but still the import
should be avoided.

This fixes the case for dropping a shader nodegroup to the Geometry
Nodes Editor by getting asset metadata (and checking if the nodetree
type matches editor) in the dropbox poll function.

Will check on other possible cases of drag-drop to incompatible editors
next.

Pull Request: https://projects.blender.org/blender/blender/pulls/111921
2023-09-04 12:43:56 +02:00
Clément Foucault
938d43c317 Fix: EEVEE-Next: Fix LUT translation unit hanging debug build 2023-09-04 11:43:02 +02:00
Sybren A. Stüvel
136b311196 Fix #111789: Anim, bone collections not created when linking armature
Linking the armature ID directly, instead of the object containing the
armature, did not run the versioning code to create bone collections
from armature layers and bone groups.

Bone groups cannot be versioned into bone collections in this case, as
they only exist on the Object.

Bone layers are now properly versioned.
2023-09-04 10:49:10 +02:00
Clément Foucault
102bdfaed7 Fix: EEVEE-Next: Ambiguous cast compilation error 2023-09-04 09:46:45 +02:00
Clément Foucault
30de3d7c1a EEVEE-Next: Move LUT to C++ and eevee-next folder 2023-09-03 17:22:31 +02:00
Clément Foucault
8fe1ec100b BLI: Math: Allow vector of 1 component 2023-09-03 16:43:45 +02:00
Clément Foucault
760aa0e917 Cleanup: EEVEE-Next: Rename LookUpTable to Precompute 2023-09-03 16:42:53 +02:00
Clément Foucault
ad71a04de0 EEVEE-Next: Fix G1_V term used to compute the GGX pdf
Thanks goes to @weizhen for spotting the mistake.
2023-09-03 16:42:53 +02:00
Clément Foucault
2aebfb596e Cleanup: EEVEE-Next: Rename G1 to G1_V to avoid confusion 2023-09-03 16:42:53 +02:00
Clément Foucault
2637bbf016 EEVEE-Next: Add LUT test
This avoid the generation code to become desync with
the precomputed tabled.

This is also a good way to test any changes to them.
2023-09-03 16:42:53 +02:00
Clément Foucault
7b54fce723 EEVEE-Next: Port LUT generation code
This ports the LUT using compute shader.
All LUT are computed by the same compute shader
to avoid boiler plate code to add new LUTs.

As for the generation code itself it is mostly the
same except for the use of `hammersley_2d` instead of
regular grid sampling. Regular grid did not improve
anything and was a bit more cumbersome.

This also bumps the number of samples very high
for more precision.

The new utility class for computing the LUT has
methods to write the content to a PFM image file
or as C++ array header.
2023-09-03 16:42:53 +02:00
Jacques Lucke
7d2c854261 Geometry Nodes: generalize modifier simulation cache storage names
The main goal here is to rename things in a way that makes sense for
simulation baking, but also for the upcoming bake node.

This also removes some versioning code from 3.6 which initialized the
default bake path. Baked data from back then can't be loaded anymore
anyway, and the way the default path is generated is different now as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/111845
2023-09-03 16:14:11 +02:00
Jacques Lucke
7f00cfeab4 Cleanup: move bake items code to separate namespace 2023-09-03 13:37:50 +02:00
Campbell Barton
e8c812a307 Cleanup: spelling in comments, update dictionary 2023-09-03 21:35:07 +10:00
Jacques Lucke
d1c2b45836 Geometry Nodes: rename bdata to blob
Blob stands for "binary large object" and is a known term. I used to use the term `bdata`
to mean "binary data", mainly because I didn't think of a better name. Blob is a much
better name as it captures the intend of those files much better.

This change breaks existing bakes, because I rename the folder from `bdata` to `blobs`.
I think that is ok, because I also just broke bakes two days ago in a larger refactor
(e92c59bc9b).

Pull Request: https://projects.blender.org/blender/blender/pulls/111822
2023-09-03 12:33:59 +02:00
Campbell Barton
3082037743 Cleanup: spelling in comments 2023-09-03 16:15:01 +10:00
Pratik Borhade
3d798e8486 Cleanup: Remove unused parameter
`relbase` is unsed after 1c0a1ae801
2023-09-03 10:22:20 +05:30
Clément Foucault
5ad7d81549 Cleanup: EEVEE-Next: Fix compilation warning and errors on Metal 2023-09-02 23:17:36 +02:00
Germano Cavalcante
7b0b2e4a5d Fix conditional logic in 'synced_selection' check
The conditional `(selected ? 0 : bm->totvert)` should be evaluated first.
2023-09-02 14:51:02 -03:00
Lukas Tönne
79a6a6977a Fix #111721: Node interface root panel flag missing
The file in question does not have the default (internal) root panel
flag for allowing child panels. This was probably saved before the flag
was added. A simple versioning snippet takes care of this case.

Pull Request: https://projects.blender.org/blender/blender/pulls/111828
2023-09-02 15:58:19 +02:00
Lukas Tönne
7ddf1820ff Fix #111763: Incorrect string copy function for default_attribute_name
`default_attribute_name` is an allocated string, unlike most other strings in `bNodeSocket`.

Pull Request: https://projects.blender.org/blender/blender/pulls/111823
2023-09-02 14:07:54 +02:00
Bastien Montagne
2698dbd6a4 Also pass relevant filedata to versioning code in linking code.
Folloup to bfdfde18e1, forgot to add this for the linking/appending code
path (similar change to what was done for the main blendfile readfile code).
2023-09-02 12:55:25 +02:00
Philipp Oeser
b0d5f3dc22 Fix #111711: bone collection visibility cannot be overridden
Since the switch from bone layers to bone collections in
998136f7a7, visibility could not be
overridden anymore. Moreso, layer visibility could also be toggled even in linked
state in 3.6 [those changes get lost on file reload, but it was still
useful and expected behavior].

Both are now restored.

Pull Request: https://projects.blender.org/blender/blender/pulls/111775
2023-09-02 10:38:23 +02:00
Pratik Borhade
1c0a1ae801 Fix #109561: Overwrite existing imagepath based on relativepath property
Update the filepath of an image when it already exists in the main
storage. This is useful when `relative_path` property is changed and we
attempt to open the same image file again.

Also remove `is_relative_path` parameter. Not required anymore because
`range->filepath` is correctly set to absolute/relative. This is also
passed in `BKE_image_load_exists_ex` to set path to non-exiting image.

Pull Request: https://projects.blender.org/blender/blender/pulls/109815
2023-09-02 07:19:54 +02:00
Harley Acheson
a7ad0ad8fb UI: Theme Versioning for Enum Highlighting
Theme versioning to ListItem InnerSel required for highlighting
the selected Enum value from #111074.

Pull Request: https://projects.blender.org/blender/blender/pulls/111819
2023-09-02 05:33:13 +02:00
Hans Goudey
78495acaa0 Fix: Crash dragging node interface panels at root level
Similar to 32ca4caaac
2023-09-01 23:07:51 -04:00
Hans Goudey
840769d855 Cleanup: Small C++ changes to two tree view uses
- Use `this->` to access class methods.
- Follow style guide for class definition order.
- Avoid unnecessary namespace redefinition.
- Make data struct local to node interface file.
2023-09-01 23:07:51 -04:00
Hans Goudey
da0c7ca0c2 Cleanup: Correct outdated tree view item comment 2023-09-01 23:07:51 -04:00
Harley Acheson
afa71adbb1 UI: Improved Enum Title Determination
Show Enum titles if there is a non-blank label before on the same row.

Pull Request: https://projects.blender.org/blender/blender/pulls/111818
2023-09-02 05:03:56 +02:00
Vitor Boschi
f662d8acb0 PyAPI: Better error msg when re-using internal node id
Give a better error message when the user tries to register a node
having the same id as an internal one.
Before:
`RuntimeError: Error: Registering node class: 'NodeDummy', bl_idname 'NodeGroupInput' could not be unregistered`

After:
`RuntimeError: Error: Registering node class: 'NodeDummy', bl_idname 'NodeGroupInput' is an internal node`

This is a followup to #111615

Authored-By: @vitorboschi (Vitor Boschi)

Pull Request: https://projects.blender.org/blender/blender/pulls/111799
2023-09-02 04:41:07 +02:00
Iliya Katueshenock
4b899588eb Fix: Vert to corner topology map assert for mesh with no faces
Fix of mistake from 226359ec48. `reverse_indices_in_groups` is
used in other one function (`build_vert_to_corner_indices`), so handling of
empty corners array should be moved into itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/111815
2023-09-02 03:55:42 +02:00
Hans Goudey
fa34992def Cleanup: Remove unnecessary includes from C++ data structure headers
The hash tables and vector blenlib headers were pulling many more
headers than they actually need, including the C base math header,
our C string API header, and the StringRef header. All of this
potentially slows down compilation and polutes autocomplete
with unrelated information.

Also remove the `ListBase` constructor for `Vector`. It wasn't used
much, and making it easy to use `ListBase` isn't worth it for the
same reasons mentioned above.

It turns out a lot of files depended on indirect includes of
`BLI_string.h` and `BLI_listbase.h`, so those are fixed here.

Pull Request: https://projects.blender.org/blender/blender/pulls/111801
2023-09-01 21:37:11 +02:00
Harley Acheson
9f4b28bba8 UI: Highlight Selected Enum
Highlight the currently-selected item in enum, and some other, lists.

Pull Request: https://projects.blender.org/blender/blender/pulls/111074
2023-09-01 21:33:03 +02:00
Hans Goudey
e160a4ceca Fix: Memory leak with node interface forward compatibility
The runtime pointers are allocated when reading sockets,
they have to be freed when the legacy sockets are freed.
2023-09-01 15:30:19 -04:00