Commit Graph

115955 Commits

Author SHA1 Message Date
Jason Fielder
9130a60d3d MTLCommandBufferState for coordinating GPU workload submission and render pass coordination.
MTLFrameBuffer has been implemented to support creation of RenderCommandEncoders, along with supporting functionality in the Metal Context.

Optimisation stubs for GPU_framebuffer_bind_ext has been added, which enables specific assignment of attachment load-store ops at the bind level, rather than on a framebuffer object as a whole.

Begin and end frame markers are used to encapsulate frame boundaries for explicit workload submission. This is required for explicit APIs where implicit flushing of work does not occur.

Ref T96261

Reviewed By: fclem

Maniphest Tasks: T96261

Differential Revision: https://developer.blender.org/D15027
2022-06-27 11:45:49 +02:00
Campbell Barton
7b6b740ace Cleanup: spelling in comments 2022-06-27 17:29:57 +10:00
Campbell Barton
e1c0d18598 Cleanup: remove redundant has key checks 2022-06-27 17:25:07 +10:00
Campbell Barton
1cf05f17eb UI: define category for the dope-sheet properties panel
Caused warning on startup, missing from [0].

[0]: 57816a6435c3a6efc98c575ec0a02ad0dd07622c
2022-06-27 17:25:07 +10:00
Antonio Vazquez
10a2c50733 Fix T99178: Console warning using search (F3) in grease pencil draw mode
The preview data was not available in this context and need to be checked to avoid the warning.
2022-06-27 09:13:40 +02:00
Campbell Barton
3a8fa77c1f GHOST/Wayland: Add a build time option for DBUS, disable by default
Add WITH_GHOST_WAYLAND_DBUS option, so Blender can be built without
DBUS support. Currently it's only used to access the cursor theme.
Without this the "default" cursors are used instead.

Disabling this since it adds an additional dependency for a minor gain
in functionality, with the benefit of removing a library requirement.

There is also a problem where Blender hangs on startup for ~5 seconds
when DBUS isn't running. Eventually it would be good to be able to avoid
this problem without a build option.
2022-06-27 16:49:21 +10:00
Campbell Barton
2b6c633b63 GHOST/Wayland: set the minimum window size with libdecor 2022-06-27 16:09:23 +10:00
Campbell Barton
0e88c2fc59 GHOST/Wayland: split pointer/tablet state into separate structs
For Wayland the mouse & tablet are separate devices with their
own location, button-pressed state and focused window.
Split internal state storage so they're separate.

Also track mouse button press/release state without needing focused
windows.
2022-06-27 15:58:07 +10:00
Joseph Eagar
30273b86c7 Fix T98673: Color attribute fill API didn't support editmode 2022-06-26 17:11:03 -07:00
Joseph Eagar
4c3b984b3d Fix T99100: Undo/redo bugs with paint and gravity
You can now push multiple sculpt undo nodes
of different types.  This is necassary to handle
paint tools that have gravity enabled.
2022-06-26 16:15:40 -07:00
Chris Blackbourn
77f10fceb2 Cleanup (UV): Remove unused variable do_aspect 2022-06-27 11:13:06 +12:00
Chris Blackbourn
81c5b759d6 Fix T99182: Hard code screen_scale for circle drawing in 3D 2022-06-27 10:59:29 +12:00
Hans Goudey
a646a4b47e Curves: Port string to curves node to the new data-block
Use the conversion implemented in 5606942c63bf81afa16.
2022-06-25 19:09:57 -05:00
Hans Goudey
be692cc4fe Cleanup: Clang tidy 2022-06-25 19:05:31 -05:00
Jacques Lucke
ef8bb8c0d5 Functions: improve span buffer reuse in procedure execution
This potentially overallocates buffers so that they are usable
for more data types, which allows buffers to be reused more
easily. That leads to fewer separate allocations and improved
cache usage (in one of my test files the number of separate
allocations went down from 1826 to 1555).
2022-06-25 19:41:44 +02:00
Jacques Lucke
22fc0cbd69 BLI: improve support for trivial virtual arrays
This commits reduces the number of function calls through function
pointers in `blender::Any` when the stored type is trivial.

Furthermore, this implements marks some classes as trivial, which
we know are trivial but the compiler does not (the standard currently
says that any class with a virtual destructor is non-trivial). Under some
circumstances we know that final child classes are trivial though.
This allows for some optimizations.

Also see https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1077r0.html.
2022-06-25 19:27:33 +02:00
Jacques Lucke
3237c6dbe8 Fix: crash when converting zero legacy curves
The issue was that the "radius" lookup below fails, because there is no
curve data. Arguably, it should be possible to add attributes even when
there is no data. However, the rules for that are a bit loose currently.
A simple fix is to just not run the conversion code when there is nothing
to convert.
2022-06-25 19:17:08 +02:00
Jacques Lucke
b513c89e84 Functions: avoid using Map for small values
This leads to a 5-10% performance improvement in my benchmark
that runs a procedure many times on a single element.
2022-06-25 18:53:26 +02:00
Hans Goudey
ba1e97f1c6 Geometry Nodes: Field on Domain Node
As described in T98943, this commit adds a node that can
evaluate a field on a separate domain in a larger field context.
This is potentially useful in many cases, to avoid relying on
a separate capture attribute node, which can make it easier
to build reusable fields that don't need geometry inputs.

Internally, the node just evaluates the input field in the larger
field context and then uses the generic domain interpolation,
so the code is simple. One future optimization might be using
the input selection to only evaluate part of the input field, but
then the selection has to be interpolated as well, and that might
not always be worth it.

Differential Revision: https://developer.blender.org/D15289
2022-06-25 11:23:19 -05:00
Hans Goudey
5606942c63 Curves: Skip CurveEval in legacy curve conversion
Currently when converting from the legacy curve type to the new type,
which happens during evaluation of every legacy curve object, the
`CurveEval` type is used as an intermediate step. This involves
copying all data twice, and allocating a bunch of temporary arrays.
It's also another use of `CurveEval` that has to be removed before
we remove the type.

The main user difference besides the subtlety described below
will be improved performance.

**Invalid Handles and Types**
One important note is that there are two cases (that I know of)
where handles and handle types can be invalid in the old curve
type. The first is animation, where animated handle positions don't
necessary respect the types. The second is control points with a
single aligned handle that didn't necessarily align with the other.

In master (partially on purpose) the code corrects the first situation
(which caused T98965). But it doesn't correct the second situation.
It's trivial to correct for the second case with this patch (because of the
eager calculation decided on in D14464), but this patch makes the choice
not to correct for //either//.

Though not correcting the handle types puts curves in an invalid state,
it also adds flexibility by allowing that option. Users must understand
that any deformation may correct invalid handles.

Fixes T98965

Differential Revision: https://developer.blender.org/D15290
2022-06-25 11:11:59 -05:00
Jacques Lucke
2967726a29 Cleanup: add missing override 2022-06-25 18:10:22 +02:00
Jacques Lucke
2a8afc142f BLI: improve check for common virtual array implementations
This reduces the amount of code, and improves performance a bit by
doing more with less virtual method calls.

Differential Revision: https://developer.blender.org/D15293
2022-06-25 17:28:49 +02:00
Johnny Matthews
9a0a4b0c0d Geometry Nodes: Add Points Node
This node takes a point count,a vector field, and float field and creates
a pointcloud with n points at the positions indicated in the vector
field with the radii specified in the float field.The node is placed in
the "Point" menu.

Differential Revision: https://developer.blender.org/D13920
Maniphest Task: https://developer.blender.org/T93044
2022-06-25 08:47:31 -05:00
Hans Goudey
12bde317f4 Fix T98949: Deleting vertex group in geometry nodes affects others
The vertex group indices stored in the weights need to be accounted for
when the vertex group list on the mesh changes.
2022-06-24 16:39:58 -05:00
Hans Goudey
35d2a22846 Cleanup: Remove unused argument 2022-06-24 16:16:43 -05:00
Hans Goudey
fca94c5e0d Fix: Incorrect dirty normal tag after mesh translation
Mistake in 54182e4925de4ee. The dirty flag was always cleared,
but we only want to clear it after translating a mesh if it normals
were already non-dirty.
2022-06-24 15:48:48 -05:00
Hans Goudey
f6290cd2a4 Cleanup: Remove unnecessary includes 2022-06-24 15:47:24 -05:00
Brecht Van Lommel
35da733e6b Fix T99058: geometry nodes ignore if subdivision surface modifier is disabled
It was looking up the last modifier in the stack, ignoring visibility, instead
of mesh->runtime.subsurf_runtime_data set by the modifier evaluation and used by
the drawing code.
2022-06-24 19:57:28 +02:00
Brecht Van Lommel
9b6e86ace1 Cycles: stop Metal rendering on command buffer error
If there is an error we should stop rendering, instead of finishing with a
wrong render result or reporting a wrong benchmark time.

Ref T96519

Differential Revision: https://developer.blender.org/D15287
2022-06-24 16:51:56 +02:00
Christian Rauch
29755e1df8 GHOST/Wayland: support client-side window decorations
This implements client-side window decorations for moving and resizing
windows and HiDPI support.

This functionality depends on the external project 'libdecor' that is
currently a build option: WITH_GHOST_WAYLAND_LIBDECOR.

Reviewed by: brecht, campbellbarton

Ref D7989
2022-06-25 00:10:39 +10:00
Dalai Felinto
f1d191120f Fix T99130: Spline factor gets messed up if one hair is too short
In the cases where length is zero, we simply equally distribute the
value based on the control point/curve index.

Differential Revision: https://developer.blender.org/D15285
2022-06-24 15:36:31 +02:00
Campbell Barton
ad8add5f0c Fix T98427: Crash adding quick effects smoke from Python
Manta flow used the `__main__` namespace which it was executed in,
this caused a bug when calculating fluid from Python, which clears
it's `__main__` name-space after execution.
This caused Manta-flows name space to be cleared too.

Resolve this by creating a separate name-space for manta-flow.

Reviewed by: SonnyCampbell_Unity

Ref D15269
2022-06-24 23:28:55 +10:00
Campbell Barton
2580d2bab5 PyAPI: Expose event.type_prev, value_prev
Before [0] mouse-motion events left the 'event.value' un-changed,
so a mouse-move would be set to PRESS/RELEASE based on previous events.

Support accessing the previous event value directly
to address feedback from T99102.

Note that the previous cursor location is already exposed.

[0]: 52af3b20d45ea525a0ce66b2613ac132c9032a3f
2022-06-24 23:19:44 +10:00
Campbell Barton
77eadbede4 Fix T99037: bpy.ops.transform.rotate fails in background mode
This reverts commit c503c5f756aab850e8afe2513b2dc7b645cf84af,
alternate fix for T82244.

Scripts that run in background mode expected rotation to be usable,
defaulting to the 3D viewport when there is no active windowing data.

Also resolves T88610.
2022-06-24 22:16:47 +10:00
Jeroen Bakker
585d81ba2b Workbench: Increase render tests fail threshold for hair.
When running the render test cases on MacOS/Intel the hair render
test fail. Most likely due to the dense geometry and the low
resolution of the test image.

This patch increases the fail threshold so these tests will pass.
Note that I haven't been able to test whether this is also the case
for Linux/Windows. If that is the case we should remove the platform
specific test.
2022-06-24 14:09:15 +02:00
Jeroen Bakker
f748a81f25 Test/Eevee: Increase failure threshold for image tests.
Makes the current test cases pass on NVIDIA 1080Ti/515.
The tests still fail on other platforms (AMD, Intel). Some are actual failures.
Other require platform specific reference images.

Original patch provided by Brecht van Lommel.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D15264
2022-06-24 13:45:29 +02:00
Jeroen Bakker
7927ac2fbe Fix T99129: Eevee Hair Info Length not working (old particle hair).
When using the old particle hair with the hair info length it wasn't
working with AMD GPUs. The reason was that the drw_curves uniform buffer
wasn't initialized what made the shader select the incorrect length.
2022-06-24 13:03:29 +02:00
Dalai Felinto
79973494ec Cleanup: Fix building warnings on gcc 9.4.0
Solution by Jacques Lucke
2022-06-24 11:25:12 +02:00
Richard Antalik
e08c932482 Fix T98925: Editor panels are broken
Commit 277fa2f441f4 added channels region to unintended editors if sequencer was
used in area. This caused issues with some editors having 2 tool regions and
non functioning side panel.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D15253
2022-06-24 10:23:31 +02:00
Campbell Barton
3323cd9c9a GHOST/Wayland: support for cursor warp with hidden/wrapped grab enabled
As grab already uses it's own virtual coordinates, cursor warping can
be used when grab is enabled.

Currently nothing depends on this however it could be useful in future.
2022-06-24 14:38:17 +10:00
Campbell Barton
11f38f59e2 Cleanup: remove unused function WM_cursor_compatible_xy 2022-06-24 14:00:36 +10:00
Campbell Barton
4c4e8cc926 Fix T99021: Walk-mode doesn't work in Wayland
Walk mode implemented it's own grab which relied on WM_cursor_warp
to work (which isn't implemented for wayland).

Resolve this by using WM_cursor_grab_{enable/disable}.

Besides fixing Wayland this removes the need for workarounds:

- Ensure the event received were after the event generated from warping.
- Alternate logic that reset the "center" when using tablets.
- Checking the cursor location was scaled by native-pixels on macOS.

There is a minor change in behavior: on completion the cursor is left
at the location walk-mode began instead of the center of the region.
2022-06-24 13:58:21 +10:00
Campbell Barton
70648683a2 Cleanup: add C++ compatible WL_ARRAY_FOR_EACH macro 2022-06-24 10:22:46 +10:00
Campbell Barton
cc09661c4e Cleanup: remove unused cursor struct members in GHOST/Wayland 2022-06-24 09:59:37 +10:00
Campbell Barton
b3a713fffa Cleanup: use const arguments for GHOST/Wayland 2022-06-24 09:58:27 +10:00
Campbell Barton
9b5dda3b07 GHOST: use GHOST_ASSERT for non-release builds
GHOST_ASSERT now matches BLI_assert, which is only ignored for release
builds. Otherwise it prints or asserts when WITH_ASSERT_ABORT is enabled.
2022-06-24 09:00:19 +10:00
Campbell Barton
93de6b912f Docs: correct GHOST_TimerProcPtr time doc-string 2022-06-24 08:46:18 +10:00
Campbell Barton
4919403c29 Fix outdated pressure/tilt for tablet motions events under GHOST/Wayland
Accumulate tablet data before generating an event using the 'frame'
callback.
2022-06-24 08:19:08 +10:00
Jörg Müller
41a0411d79 Fix T99083: audio bad in command-line video player (blender -a)
There was a wrong sample size computation in PulseAudioDevice.
The sample format is switched to float32 for the command-line player.
2022-06-23 21:32:34 +02:00
Hans Goudey
b0fe0e6a30 Cleanup: Make function static 2022-06-23 13:03:31 -05:00