Commit Graph

150077 Commits

Author SHA1 Message Date
Omar Emara
e9af802330 Refactor: Compositor: Use generic pointer with MF operation
This patch refactors how single values are passed to MF operations by
utilizing generic pointers. This avoids boilerplate and makes it easier
to add new types.
2025-03-13 15:47:46 +02:00
Miguel Pozo
44b64ca9df Fix #135848: Selection-Next: Backface culling
Allow extending the DRWState on select_bind so backface culling can be used when needed.

Note: There's still a difference in behavior with Overlay Legacy, causing backface culled flat objects to still be selectable at the edges, due to the "MeshFlat" workaround.
Pull Request: https://projects.blender.org/blender/blender/pulls/135867
2025-03-13 14:23:17 +01:00
Xavier Hallade
3de1a60c6a Cycles: oneAPI: Force large GRF for shade_surface_* kernels
While auto lets the compiler make the right choice for shade_surface
kernel when compiling for Battlemage and Lunar Lake, that's not the case
for Alchemist and Meteor Lake, so now we force this mode.
2025-03-13 14:22:48 +01:00
Jesse Yurkovich
e492794e1e Fix: Resolve several int -> uint conversion shader warnings
Resolves several int -> uint conversion warnings. Warnings like the
following will be printed otherwise:

```
      |
  225 |   uint shadow_type = flags & 0xF;
      |                      ^
      | gpu_shader_text_vert.glsl:17:22: Warning: some implementations
        may not support implicit int -> uint conversions for `&'
        operators; consider casting explicitly for portability
```

Pull Request: https://projects.blender.org/blender/blender/pulls/135890
2025-03-13 14:22:21 +01:00
Clément Foucault
c02dea2e26 Fix: GL: Race condition in shader compilation
The patch strings did not have thread safe initialization.
The string might hav been returned null or incomplete
which might trigger compilation errors.
2025-03-13 14:04:59 +01:00
Omar Emara
9bf05f4def Refactor: Compositor: Provide const variants for data accessors
This patch provides const variants to the cpu_data accessors that
returns GSpan. This is done to better const correctness. Some code need
non-const data even for read-only data, so we have to const cast those
for the moment.
2025-03-13 14:49:01 +02:00
Clément Foucault
94c7c84bcd Refactor: DRW: Simplify the DRWContext classes and methods
This refactor part of `draw_manager_c.cc` to make it more understandable
and less bug prone.

- Splits the context handing to `draw_gpu_context.cc`
- Rename `draw_manager_c.cc` to `draw_context.cc`
- Merge `DRWContextState` into `DRWContext`
- Merge lots of static functions into `DRWContext` to avoid global access
- Deduplicate code between entry point functions
- Move context init logic to `DRWContext` constructor
- Move resource init logic to `DRWContext::acquire_data`
- Move extraction `TaskGraph` out of `DRWContext`
- Reduce / centralize complexity of enabling draw engines
- Reduce the amount of `drw_get` calls
- Remove unused code

Pull Request: https://projects.blender.org/blender/blender/pulls/135821
2025-03-13 13:47:02 +01:00
Jeroen Bakker
e1d2eee02b Cleanup: Vulkan: Remove unused variable 2025-03-13 13:31:13 +01:00
Julian Eisel
1ca05d3940 UI: Fix double padding in file browser drawing
Paddings were applied a bit oddly, resulting in a double padding for the
drawing. Each "tile" (the space to draw the file in) already had a padding
applied (`FileLayout.tile_border_x`), we'd apply another one to it. This second
padding should only be used for spacing of individual items *inside* the tile.

Code makes more sense too now, there are fewer arbitrary/eyeballed numbers to
make things "look good".

Pull Request: https://projects.blender.org/blender/blender/pulls/135915
2025-03-13 13:14:53 +01:00
Sybren A. Stüvel
ac4f22cec4 Merge remote-tracking branch 'origin/blender-v4.4-release' 2025-03-13 12:53:59 +01:00
Sybren A. Stüvel
30ba81f805 Fix #135894: Assigned Action can mute NLA strip when reusing the same Action
Fix an issue when the NLA is used in conjunction with a directly-
assigned Action.

When the directly-assigned Action is also used in an NLA strip, that
strip would not be evaluated any more. This was even the case when
different slots were used, which entirely muted the strip when there
was no slot directly assigned. Now the "this has been handled already"
logic considers the action and the slot.

Pull Request: https://projects.blender.org/blender/blender/pulls/135911
2025-03-13 12:50:47 +01:00
Alaska
24b08e7d09 Tests: Adjust filter glossy on glossy_ashikhmin test to test ashikhmin blur
The Ashikmin Shirley microfacet option for the glossy BSDF has it's own
blurring function for the filter glossy feature.

This commit adjusts the glossy_ashikhmin test to make use of filter
glossy so that this code path can be tested.

Ref: blender/blender-test-data!72
2025-03-13 12:41:38 +01:00
Sybren A. Stüvel
565377b8f1 Merge remote-tracking branch 'origin/blender-v4.4-release' 2025-03-13 11:27:13 +01:00
Sybren A. Stüvel
1d20304442 Fix #135894: after "Merge Animation" animation does not play properly
The "Merge Animation" operator now properly tags the affected Actions
with `ID_RECALC_ANIMATION_NO_FLUSH` so that new 'evaluated copies' are
created. Because this was missing, the animation evaluation code didn't
see the moved channelbags yet, which caused animation playback to be
broken.

Pull Request: https://projects.blender.org/blender/blender/pulls/135906
2025-03-13 11:26:42 +01:00
Omar Emara
9f254ef08c Refactor: Compositor: Use BKE conversion for images
This patch refactors the conversion code for images to use BKE
conversion rules. This reduces boilerplate and makes it easier to add
new types.
2025-03-13 12:17:35 +02:00
Jeroen Bakker
1ea1f4c92c Refactor: GHOST/Vulkan: Wrap handles in a struct
Vulkan handles are currently only requested once. In the future OpenXR
also needs acces to these handles and additional handles will be needed
when introducing copy queues and async compute.

This PR will collect the handles in a struct to ensure we don't need to
alter the GHOST interface for every change.

Pull Request: https://projects.blender.org/blender/blender/pulls/135905
2025-03-13 11:06:20 +01:00
Omar Emara
8f2f0520da Cleanup: Unused declaration
Removes a now unused declaration from the previous commit.
2025-03-13 11:49:46 +02:00
Omar Emara
cbd01d2a6f Refactor: Compositor: Reduce boilerplate in conversion code
This patch refactors GPU implicit conversion code by generating the name
of the shaders on the fly using fmt. This reduces boilerplate and makes
it easier to add new types.
2025-03-13 11:38:12 +02:00
Pratik Borhade
5a09715db9 Fix #135847: Grease Pencil: Empty material slot doesn't show icon
Move those material specific conditions below so that `icon` is always
drawn in UI even when material does not exist at specific slot.

Pull Request: https://projects.blender.org/blender/blender/pulls/135849
2025-03-13 10:17:05 +01:00
Alaska
42e7a950cd Tests: Add Cycles tests for hidden OSL closures
In Cycles there are three closures (Diffuse Ramp, Phong Ramp,
and Burley diffuse) which are only avaliable through OSL. This commit
adds tests for these closures.

Ref: blender/blender-test-data!70
2025-03-13 08:44:39 +01:00
Campbell Barton
ff8baa6791 Cleanup: pass BMUVOffsets by const reference 2025-03-13 17:06:32 +11:00
Campbell Barton
78c3f6a1ee Cleanup: adjust order of terms for BMesh UV map function calls
Order more generic terms first for better ordering, more useful
completion.
2025-03-13 15:23:46 +11:00
Alaska
0031f50d6b Test: Add Cycles test for the shading offset feature in Cycles
This commit adds a test for the shading offset feature in Cycles,
testing different material types (Diffuse, Glossy, and Transmissive)
and with different strengths.

Ref: blender/blender-test-data!71
2025-03-13 05:12:29 +01:00
Campbell Barton
6ec1bc669e UV: correct checks for no-selection
There is no need to check "Sync Selection" as the check for no selected
vertices is also valid when sync-selection is disabled.
2025-03-13 14:57:10 +11:00
Campbell Barton
571bab615c UV: skip adding UV data layers when sync-select is used
When sync select is enabled, the data layers aren't accessed
so there is no need to add them.

Also skip adding a "pin" layer when clearing pinned UV's.
2025-03-13 14:40:56 +11:00
Campbell Barton
4a8e50e5de UI: show an error when rip is attempted with sync select
This was failing with an unhelpful error.
2025-03-13 13:50:16 +11:00
Campbell Barton
13b4da2568 Docs: update bmesh_class.hh header
- Minor corrections & clarifications.
- Use doxygen docs.
2025-03-13 13:41:19 +11:00
Campbell Barton
6ef7dae8ef Cleanup: spelling in comments (make check_spelling_*) 2025-03-13 13:41:17 +11:00
Harley Acheson
9dbd20b369 UI: Hide NLA Scrollbars When Very Short
With commit f40cd831fd we are hiding scrollbars when timeline and many
other editors are sized to be very short. This PR just does the same
for NLE.

Pull Request: https://projects.blender.org/blender/blender/pulls/135834
2025-03-13 01:27:12 +01:00
Harley Acheson
e4baefe0d4 Tests: Adding Two Test Font Files
Adding two files to tests/data for BLF tests.
2025-03-12 17:06:43 -07:00
Pratik Borhade
a0fdbf0fd2 UI: Include obdata in material properties context path
Context path in the header of material properties tab always indicates
material is on object. Include object.data in context path when material
is on mesh for example.

Pull Request: https://projects.blender.org/blender/blender/pulls/134968
2025-03-12 23:09:58 +01:00
Hans Goudey
5f6e94ca58 Grease Pencil: Avoid GPU API overhead when extracting index buffers
Similar changes done elsewhere (#116901), replace usage of the GPU API's
`GPU_indexbuf_add_generic_vert` function by simply writing the index
data that we need. This avoids a function call and min/max tests for
every index added.

Pull Request: https://projects.blender.org/blender/blender/pulls/135404
2025-03-12 21:55:18 +01:00
Hans Goudey
2cf5838b87 Grease Pencil: Slightly optimize IndexMask usage in draw extraction
Instead of computing an index mask for all curves, then returning an
intersection with the visible curves, just use the visible curves as
a universe for the original calculation. Also add another early out
for when there are no NURBS curves.
2025-03-12 21:55:18 +01:00
Hans Goudey
32e96f1ff7 Grease Pencil: Avoid overhead counting visible points for drawing
Currently the drawing data extraction code uses the offset indices API
quite inefficiently, copying the size of every selected every curve, then
accumulating those sizes. Instead just use the existing API function that
counts the size of all selected curves. Also for the weight overlay, avoid
doing the same calculation twice.
2025-03-12 21:55:18 +01:00
Sergey Sharybin
977a334f6f Merge branch 'blender-v4.4-release' 2025-03-12 19:24:01 +01:00
Sergey Sharybin
a3eb0faa3f Fix: Incorrect ray time used for HIP-RT local intersections
It was always hard-coded to be 0.

It does not seem to result in any extra tests passing, but they are
probably not sophisticated enough.

Noticed while looking into details for the #135856.

Pull Request: https://projects.blender.org/blender/blender/pulls/135878
2025-03-12 19:23:38 +01:00
Bastien Montagne
ef1d5432cb RNA: LibraryWeakReference: make path and ID name editable.
There is no real reason to keep these read-only, they are not exposed in
the UI anyway, and being able to edit them can become necessary in a
pipeline mamangement context.
2025-03-12 17:50:50 +01:00
Bastien Montagne
4c4e3142df Cleanup: makesrna: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

MEM_[cm]allocN<T> templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use MEM_new (i.e. allocation and
construction) as much as possible, even for trivial PoD types.

Pull Request: https://projects.blender.org/blender/blender/pulls/135870
2025-03-12 17:19:06 +01:00
Omar Emara
b37afc86d1 Refactor: Compositor: Replace proxy results with data sharing
This patch refactors the result class to replace proxy results with the
possibility of doing data sharing through a shared heap allocated data
reference count. This is more robust and simpler since proxy results no
longer need to be handled as a special case in a lot of the results
code. Additionally, it allows stronger const correctness since inputs to
operations can now be const.

This is somewhat similar to implicit sharing used in other parts of
Blender, so we can look into using that in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/135778
2025-03-12 16:42:26 +01:00
Bastien Montagne
f36f9bdb87 Fix (unreported) MOD_surface: raw calloc on non-trivial data.
It seems that this was 'fine', as non-trivial data in `BVHTreeFromMesh`
appear to be 'safe' when simply zero-initialized instead of being
properly constructed.

Note that this 'calloced' data was already 'MEM_deleted', this is
currently considered as a valid use-case unfortunately, otherwise the
issue would have been detected earlier.

Directly use 'copy' `MEM_new` code instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/135862
2025-03-12 15:43:34 +01:00
Bastien Montagne
58d34984d2 Cleanup: modifiers: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

MEM_[cm]allocN<T> templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use MEM_new (i.e. allocation and
construction) as much as possible, even for trivial PoD types.
2025-03-12 15:43:33 +01:00
Brecht Van Lommel
3ff3c2bf21 Merge branch 'blender-v4.4-release' 2025-03-12 15:33:26 +01:00
Hans Goudey
e3df02999b Fix: Build error without FFMPEG 2025-03-12 15:32:36 +01:00
Brecht Van Lommel
a80f4ceb24 Fix #135837: Crash cancelling render with stamp burn into image
The image buffer might not exist if cancelling happens early enough.

Pull Request: https://projects.blender.org/blender/blender/pulls/135861
2025-03-12 15:31:29 +01:00
Hans Goudey
e92f869cf4 Fix: Build error without FFMPEG 2025-03-12 10:05:48 -04:00
Brecht Van Lommel
dc488b99a5 Merge branch 'blender-v4.4-release' 2025-03-12 13:39:50 +01:00
Brecht Van Lommel
92f2027f62 Fix #135806: Wrong error message on render to directory without permission
Make MOV_write_begin always report an error on failure, and remove the
generic one from the caller.

Regression from 974efe7d23.

Pull Request: https://projects.blender.org/blender/blender/pulls/135859
2025-03-12 13:39:00 +01:00
Thomas Dinges
278f4410f9 Merge branch 'blender-v4.4-release' 2025-03-12 12:31:51 +01:00
Thomas Dinges
9f66476430 Release: Blender 4.4 goes to RC 2025-03-12 12:30:03 +01:00
Thomas Dinges
4124e67116 Release: Update license doc for 4.4 2025-03-12 12:28:05 +01:00