Commit Graph

117326 Commits

Author SHA1 Message Date
Brecht Van Lommel 6b9209ddfa Merge branch 'blender-v3.3-release' 2022-08-19 21:02:02 +02:00
Brecht Van Lommel 51b79e4775 Fix T96133: Cycles viewport render crash with NVIDIA GPUs on macOS 2022-08-19 20:40:44 +02:00
Brecht Van Lommel 4b62970dd3 Cleanup: replace CHECK_TYPE macro with static_assert
To avoid conflicts with BLI headers and simplify code.
2022-08-19 20:36:02 +02:00
Antonio Vazquez 6ef4267d5e Merge branch 'blender-v3.3-release' 2022-08-19 17:52:52 +02:00
Antonio Vazquez be5c296e52 Fix T100502: GPencil Primitive apply offset when using `Stroke` mode
The offset was applied in stroke mode and this was wrong.
2022-08-19 17:52:12 +02:00
Brecht Van Lommel 78e0c936c1 Merge branch 'blender-v3.3-release' 2022-08-19 17:32:55 +02:00
Brecht Van Lommel 8f9b812d79 Fix build error on i386 due to wrong use of float_t
Was supposed to be float, likely copy paste error from int32_t.
2022-08-19 17:29:02 +02:00
Brecht Van Lommel 0c8749788c Fix build error on mips64el architecture
Same as D12194, name "mips" conflicts on such systems.
2022-08-19 17:28:51 +02:00
Loren Osborn db46251209 Fix ubsan warnings about indexing into null pointers
Ref T99382

Differential Revision: https://developer.blender.org/D15390
2022-08-19 16:27:22 +02:00
Nathan Vegdahl a06c9b5ca8 Cycles: add Sobol-Burley sampling pattern
Based on the paper "Practical Hash-based Owen Scrambling" by Brent Burley,
2020, Journal of Computer Graphics Techniques.

It is distinct from the existing Sobol sampler in two important ways:
* It is Owen scrambled, which gives it a much better convergence rate in many
  situations.
* It uses padding for higher dimensions, rather than using higher Sobol
  dimensions directly. In practice this is advantagous because high-dimensional
  Sobol sequences have holes in their sampling patterns that don't resolve
  until an unreasonable number of samples are taken. (See Burley's paper for
  details.)

The pattern reduces noise in some benchmark scenes, however it is also slower,
particularly on the CPU. So for now Progressive Multi-Jittered sampling remains
the default.

Differential Revision: https://developer.blender.org/D15679
2022-08-19 16:27:22 +02:00
Jacques Lucke 35a41a49a8 Merge branch 'blender-v3.3-release' 2022-08-19 16:25:41 +02:00
Jacques Lucke 1608406600 Fix: nurbs basis cache not computed before it is used 2022-08-19 16:24:24 +02:00
Germano Cavalcante e4f1d71908 Fix T89399: Mouse wrapping causes erratic movement
As mentioned in T89399, "the source of this bug is that cursor wrap
moves the cursor, but when it later checks the mouse position it hasn't
yet been updated, so it re-wraps".

As far as I could see, this happens for two reasons:
1. During the first warp, there are already other mousemove events in the queue with an outdated position.
2. Sometimes Windows occasionally and inexplicably ignores `SetCursorPos()` or `SendInput()` events. (See [1])

The solution consists in checking if the cursor is inside the bounds right after wrapping.
If it's not inside, it indicates that the wrapping either didn't work or the event is out of date.
In these cases do not change the "accum" values.

1. f317d619cc/src/video/windows/SDL_windowsmouse.c (L255))

Maniphest Tasks: T89399

Differential Revision: https://developer.blender.org/D15707
2022-08-19 10:09:58 -03:00
Omar Emara d94aadf235 Fix: Crash when realtime compositor node is unlinked
The realtime compositor crashes when some nodes are unlinked.

This happens for GPU material nodes if it was compiled into its own
shader operation. Since it is unlinked, the shader operation will have
no inputs, a case that the current code didn't consider.

This patch fixes this by skipping code generation for inputs if no
inputs exist for the shader operation.
2022-08-19 15:03:14 +02:00
Campbell Barton 1eeb174e72 Cleanup: update comment about undo & smooth-view 2022-08-19 21:04:57 +10:00
Bastien Montagne 188f7585a1 Fix T100323: Outliner: Do not allow to delete objects from an override collection. 2022-08-19 12:42:52 +02:00
Campbell Barton ab3e9c47d8 Merge branch 'blender-v3.3-release' 2022-08-19 16:24:51 +10:00
Campbell Barton 5c9bea25d0 Fix crash accessing PyEval_GetFrame from Python's crash handler
Check the thread-state before accessing PyEval_GetFrame, since this is
a crash handler, the state of the Python interpreter isn't known.
2022-08-19 16:23:29 +10:00
Campbell Barton 9855264c8d UI: increase range of font size for text editor & console
Useful when using different DPI & UI scales.
2022-08-19 15:54:24 +10:00
Campbell Barton 0322802314 Cleanup: minor changes to BLF API
- Use upper-case for defines.
- Use u-prefix for unsigned types.
- Use snake case for struct members.
- Use const struct for unicode_blocks & arguments.
- Use doxy style comments for struct members.
- Add doxy sections for recently added code.
- Correct code-comments (outdated references).
- Remove 'e' prefix from struct UnicodeBlock/FaceDetails
  (normally used for enums).
2022-08-19 14:46:45 +10:00
Campbell Barton 1a3bc09e89 Cleanup: spelling in comments 2022-08-19 13:49:13 +10:00
Campbell Barton 2a15040777 Merge branch 'blender-v3.3-release' 2022-08-19 13:46:37 +10:00
Campbell Barton 97f9015ed0 Cleanup: unused argument warning 2022-08-19 13:41:49 +10:00
Jesse Yurkovich 0491ba09c2 Cleanup: Remove data duplication from BLI_any.hh support variables
Use `inline constexpr` instead of `static constexpr` to prevent these
variables from being duplicated in each translation unit that includes
the BLI_any.hh header.

Differential Revision: https://developer.blender.org/D15698
2022-08-18 19:40:46 -07:00
Chris Blackbourn cd516d76b6 Cleanup: replace uint cd_loop_uv_offset with int
See https://wiki.blender.org/wiki/Style_Guide/C_Cpp#Integer_Types
2022-08-19 14:19:13 +12:00
Chris Blackbourn e80a9d2645 Cleanup: lint, unused_vars 2022-08-19 13:44:55 +12:00
Chris Blackbourn a5c696a0c2 UV: respect uv selection for smart uv, cube, sphere and cylinder projection
Differential Revision: https://developer.blender.org/D15711
2022-08-19 13:35:03 +12:00
Campbell Barton 529f0427fc Cleanup: spelling in comments 2022-08-19 11:29:32 +10:00
Chris Blackbourn aa82f91c92 Cleanup: uvedit_*_select, replace `BMEditMesh*` with `BMesh*`
Change `cd_loop_uv_offset` from signed to unsigned, forcing
a crash if passed invalid input.

Differential Revision: https://developer.blender.org/D15722
2022-08-19 13:00:48 +12:00
Campbell Barton 4f8c15daf4 Fix logical errors in RNA_path_array_index_token_find
This function never succeeded as an off by one error checking the last
character always indexed the null byte.
The 'for' loop was broken as of [0] since the unsigned number could wrap
around with some RNA paths causing out of bounds memory access.

This is an example where tests would have caught the problem early on,
RNA path tests are planned as part of D15558.

[0]: 11b4d0a3c3
2022-08-19 10:54:45 +10:00
Germano Cavalcante f5aac6662d Fix GPUShader.format_calc documentation
`format_calc` instead of `calc_format`.
2022-08-18 20:03:07 -03:00
Harley Acheson d772e11b5a BLF: Gamma Correction
Gamma correction for glyph coverage values.

See D13376 for details and examples.

Differential Revision: https://developer.blender.org/D13376

Reviewed by Julian Eisel
2022-08-18 12:34:23 -07:00
Julian Eisel 9707080a9d Cleanup: Remove unused outliner function
This is unused, and I don't see a need for it.
2022-08-18 21:14:54 +02:00
Brecht Van Lommel 9961aae1e6 Merge branch 'blender-v3.3-release' 2022-08-18 20:31:34 +02:00
Julian Eisel d2255aa4ed Outliner: Refactor outliner tree-hash interfaces with C++
- Turn storage into an object with "automatic" memory management (RAII)
  so freeing is implicit and reliable.
- Turn functions into member functions, to have the data and its
  functions close together with controlled access that increases
  encapsulation and hiding implementation details.
- Use references to indicate null is not an expected value.
- Related minor cleanup (comments, use const etc.)

Couldn't spot any changes in performance.
2022-08-18 20:22:55 +02:00
Julian Eisel 75cca8360f Outliner: Add commented out benchmarking calls for tree rebuilding
This way you can benchmark the tree rebuilding by simply commenting out
a single line. Not that it was difficult before, but this makes it as
easy as it gets, with basically no knowledge of existing benchmarking
tools required.
2022-08-18 20:22:55 +02:00
Julian Eisel de794adc0c Outliner: Use C++ container for tree hash element storage
Simplifies code quite a bit, since this was doing the typical work of
such a container. I may remove this vector entirely as I'm working on
performance fixes, not sure, but simplifying this helps reason about the
design.

Couldn't spot performance differences in some benchmarks, and I wouldn't
expect any. Maybe some minor onces thanks to the small buffer
optimization of `blender::Vector`.
2022-08-18 20:22:55 +02:00
Julian Eisel 5148e1c60c Cleanup: General style improvements for Outliner tree hashing code
- Use C++ nullptr instead of C's NULL (clang-tidy warns otherwise)
- Use early exit/continue to avoid indentation (helps readability
  because visual scope of no-op branches is minimized).
- Use const for local variables, to separate them clearly from the
  mutable ones.
- Avoid struct typedef, this is not needed in C++
2022-08-18 20:22:55 +02:00
Brecht Van Lommel 6a4f4810f3 Fix T100246: Cycles GPU render error when adding AO node during viewport render 2022-08-18 20:04:22 +02:00
Brecht Van Lommel e11c899e71 Cycles: disable Metal inlining optimization on Apple GPUs
This gave a 1.1x speedup, however also leads to very long compile times
that make it seems like Blender has stopped working.

This can be brought back in the future behind an option that users can
explicitly enabled.

Fix T100102

Ref D14923, D14763, T92212
2022-08-18 20:01:29 +02:00
Brecht Van Lommel 790d57b88a Fix build error when not using unity build 2022-08-18 18:56:17 +02:00
Bastien Montagne b375019ebc Merge branch 'blender-v3.3-release' 2022-08-18 17:26:54 +02:00
Bastien Montagne f2f680d82d Fix T100475: Crash on undoing the created override from ID template.
We only need to 'manually' remap RNA ID pointer property to the newly
created override if the owner itself was not already a local override.

Also some more minor tweaks to notifiers sent when creating the
override.
2022-08-18 17:26:12 +02:00
Omar Emara 885e7abed1 Realtime Compositor: Implement bilateral blur node
This patch implements the bilateral blur node for the realtime compositor.

Differential Revision: https://developer.blender.org/D15674

Reviewed By: Clement Foucault
2022-08-18 17:16:14 +02:00
Sergey Sharybin d8be33333f Merge branch 'blender-v3.3-release' 2022-08-18 17:09:52 +02:00
Sergey Sharybin 96206aa98a Enable oneAPI AoT kernels for Release on Linux
Windows still needs some work on the buildbot side, so keep
that disabled for the time being.
2022-08-18 17:03:59 +02:00
Omar Emara 7d4aa0db9e Realtime Compositor: Implement despeckle node
This patch implements the despeckle node for the realtime compositor.

Differential Revision: https://developer.blender.org/D15673

Reviewed By: Clement Foucault
2022-08-18 16:53:16 +02:00
Antonio Vazquez 41dd5a6c38 GPencil: Fix wrong material index in previous commit 2022-08-18 16:35:04 +02:00
Antonio Vazquez aa7b2f1dd9 GPencil: New operator to convert strokes to perimeter.
This operator converts any stroke of gpencil with a center line into a stroke with the perimeter.

It's possible to assign the active material, keep current or create a new material for all perimeters.

The conversion is only done for strokes with a material using `Stroke`. Only `Fill` strokes are not converted.

Known issues: As the perimter has not boolean implementation, some perimeters can be overlaped. This could be solved in the future when a new 2D boolean library will be developed.

Reviewed By: mendio, pepeland, frogstomp

Differential Revision: https://developer.blender.org/D15664
2022-08-18 16:30:27 +02:00
Bastien Montagne 4d4a84bbeb Merge branch 'blender-v3.3-release' 2022-08-18 15:50:05 +02:00