Commit Graph

120055 Commits

Author SHA1 Message Date
Thomas Dinges
43def5d19d Release: Bump to 4.3 release 2024-11-18 19:15:25 +01:00
Miguel Pozo
d4f321fe54 Overlay: Add a pre_draw step and use submit_only for PassMain
Run the compute steps of all passes up-front to avoid constant GPU
compute/raster context switching.

Pull Request: https://projects.blender.org/blender/blender/pulls/130336
2024-11-18 18:25:09 +01:00
Miguel Pozo
d50d287924 Draw: Add specialized generate_commands for PassSortable 2024-11-18 18:25:07 +01:00
Miguel Pozo
5586533cc8 Overlay: Add image_plane_depth_bias shader
Move the depth bias to the shader to avoid creating extra views and
culling passes.
2024-11-18 18:25:07 +01:00
Miguel Pozo
c86fd709cf Overlay: Add missing early return 2024-11-18 18:25:07 +01:00
Miguel Pozo
a9cd1639db Cleanup: Fix codestyle for private variables 2024-11-18 18:25:07 +01:00
Miguel Pozo
cd26e0834b FIx: EEVEE: Fix asserts on exit at GLShaderCompiler destructor 2024-11-18 18:24:09 +01:00
Julian Eisel
f0db870822 UI: Support persistent view state, write tree-view height to files
Adds support for saving some view state persistently and uses this to keep the
height of a tree-view, even as the region containing it is hidden, or the file
re-loaded.

Fixes #129058.

Basically the design is to have state stored in the region, so it can be saved
to files. Views types (tree-view, grid-view, etc) can decide themselves if they
have state to be preserved, and what state that is. If a view wants to preserve
state, it's stored in a list inside the region, identified by the view's idname.

Limitation is that multiple instances of the same view would share these bits of
state, in practice I don't think that's ever an issue.

More state can be added to be preserved as needed. Since different kinds of
views may require different state, I was thinking we could add ID properties to
`uiViewState` even, making it much more dynamic.

Pull Request: https://projects.blender.org/blender/blender/pulls/130292
2024-11-18 18:19:48 +01:00
Jacques Lucke
9f0d20c056 Cleanup: Blenloader: add missing const
This adds `const` in a few obvious places where it should be used.

Pull Request: https://projects.blender.org/blender/blender/pulls/130461
2024-11-18 17:55:24 +01:00
Sebastian Parborg
4acb7455df VSE: Remove byte position index from our time codes
This is a more invasive change to the timecode indexer because ffmpeg removed the ability to to get the `pkt_pos` (byte location of a frame packet):
27f8c9b27b
As stated there, they don't think that using it too seek is any better than using the dts or the pts position of the packets.
While you can still seek with the byte position, you need to do quite a bit of extra work to get this information from ffmpeg.
As we are only using it for the indexer and only if the fileformat was quite old (mpegts etc) I thought that we could instead simplify this and always seek by the pts timestamp instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/130444
2024-11-18 17:46:33 +01:00
Sebastian Parborg
b1ca2f09db Fix: FFmpeg deprecation warnings
Pull Request: https://projects.blender.org/blender/blender/pulls/127203
2024-11-18 17:46:04 +01:00
Jeroen Bakker
f7fef99b31 Vulkan: Fix renderdoc step-by-step debugger.
Recently the GLSL code was changed in Blender. For every GLSL file
the #line directive was added. However due to limitations in Blender
we misuse the indexed based line directive to store a hash. This is not
according to the spec where indexes should index the source inside the
array of sources. In vulkan the indexed based approach is not
'supported' as the compiler inputs only accepts a single file.

We tried to support file based approach but that lead to other issues in
renderdoc. Might be related to that the source file doesn't exist on the
file system.

This PR fixes this by scrambling the #line directive so the
step-by-step debugger can be used. The scrabling only happens when
blender is started with the `--debug-gpu-renderdoc` startup argument.

Pull Request: https://projects.blender.org/blender/blender/pulls/130458
2024-11-18 17:37:35 +01:00
Clément Foucault
7ca8a66a45 Fix: Overlay-Next: Fix uninitialized memory in some shape batches 2024-11-18 17:16:18 +01:00
Clément Foucault
d4ac4f7b2d DRW: Make manager and passes allow range of handles
Allow passing range of resources inside the draw manager.

This allows to reduce the overhead of the drawing logic
for group of instances sharing the same drawing state.

The only catch is that we do consider them as having the
same handedness, which seems to be a valid assumption for
now.

For now this is not used and just change the API in a transparent
way to allow incremental changes to the engines code.

Pull Request: https://projects.blender.org/blender/blender/pulls/130290
2024-11-18 17:08:19 +01:00
Bastien Montagne
645e542b58 Fix/Cleanup (unreported) illegal PointerRNA::owner_id manipulation.
RNA accessors should never (ever?) modify the `owner_id` of their parent
PointerRNA data. This is opening a potential monstruous can of worms.

If such behavior is absolutely needed, there should be a very detailed
comment about why!

In the present case, this does not seem needed at all - and was most
likely fairly harmless in practice.
2024-11-18 17:04:50 +01:00
Bastien Montagne
fb59efb12e Cleanup: Use PointerRNA_NULL assignement to reset a PointerRNA.
Do not reset each individual values manually.
2024-11-18 17:04:50 +01:00
Aras Pranckevicius
b26dc3dd01 VSE: Optimize Text Box w/ roundness with multi-threading
Filling the background Box of a text strip was a single-threaded
code before. Which was pretty fast for a simple rectangle, but
when roundness is used it becomes a bit slower (super-ellipse
equation has to be evaluated for each pixel in the rounded corners,
which is 3x powf per pixel).

So make the background box use multi-threading. On M1 Max, filling
background box of 2256x1691 pixels:
- No roundness: 25.8ms -> 4.3ms
- Roundness 0.3 (253 pixels): 31.9ms -> 5.8ms
- Roundness 1.0 (845 pixels): 94.6ms -> 15.8ms

Pull Request: https://projects.blender.org/blender/blender/pulls/130403
2024-11-18 16:40:23 +01:00
Thomas Dinges
6f286980b9 Merge branch 'blender-v4.3-release' 2024-11-18 16:37:23 +01:00
Omar Emara
24d1733059 Compositor: Implement Double Edge Mask for new CPU compositor
Reference #125968.
2024-11-18 17:35:22 +02:00
Omar Emara
9dd04cafd9 Compositor: Implement Jump Flooding for new CPU compositor
Reference #125968.
2024-11-18 17:35:22 +02:00
Omar Emara
a8591c9efb Compositor: Implement Box Mask for new CPU compositor
Reference #125968.
2024-11-18 17:35:22 +02:00
Omar Emara
c9e974249e Compositor: Implement Ellipse Mask for new CPU compositor
Reference #125968.
2024-11-18 17:35:22 +02:00
Omar Emara
8034e1ee51 Compositor: Implement ID Mask node for new CPU compositor
Reference #125968.
2024-11-18 17:35:22 +02:00
Omar Emara
6166e9ab6e Compositor: Add integer pixel load and store functions 2024-11-18 17:35:21 +02:00
Omar Emara
5511256f3b Compositor: Add fallback variant for pixel loader
This patch adds a variant of the pixel loader function that returns a
fallback value for out of bound access.
2024-11-18 17:35:21 +02:00
Falk David
9e82331ae6 Fix #130368: GPv3: Canvas overlay incorrect offset
The issue was that if the evaluated object doesn't have an active
layer, the canvas is offset by twice the objects position.

The reason was that the code scaled the whole transformation
matrix by two to match the code in 4.2, but then had to overwrite
the location of the transformation again to counteract the scaling.

The fix is to not counteract the scaling and just scale the 3x3 part
of the matrix instead. This way we can remove the part afterwards
that writes to the location of the transform.

Pull Request: https://projects.blender.org/blender/blender/pulls/130454
2024-11-18 16:24:34 +01:00
Pratik Borhade
e23b710bcf Fix #130376: GPv3: Outline modifier traces flat caps incorrectly
For flat caps, only one point is added in data.positions array for
endpoints of stroke. It results in incomplete outline. To resolve
this, add another point in new curves at the exact opposite position.

Pull Request: https://projects.blender.org/blender/blender/pulls/130437
2024-11-18 16:16:08 +01:00
Bastien Montagne
e8770a3845 Cleanup: Do not use PointerRNA::owner_id to create non-ID PointerRNAs.
Also added asserts to 'document' that in that case the PointerRNA data
is expected to be the same as the (Brush) ID.
2024-11-18 15:58:06 +01:00
Clément Foucault
376f896b1f Cleanup: Overlay-Next: Use same test for V3D everywhere 2024-11-18 15:55:14 +01:00
Clément Foucault
fb6188f658 Fix: Overlay-Next: Crash when changing workspace
Outline drawing was not guarded to V3D
2024-11-18 15:55:14 +01:00
Clément Foucault
cb1440b92f Fix: Overlay-Next: Wireframe does not update in sculpt mode
Was just missing the implementation.
2024-11-18 15:55:14 +01:00
Germano Cavalcante
607b2dd826 Fix: assert failure when snapping to geometry with only vertices
These geometries do not have "EDGE_ENDPOINT".
2024-11-18 11:18:09 -03:00
Clément Foucault
906e770b15 Fix: Overlay-Next: Object wireframe draw type not drawing wireframe
Logic was missing.
2024-11-18 14:42:28 +01:00
Clément Foucault
3cad71b03f Fix: Overlay-Next: Grid occluding overlays in wireframe mode 2024-11-18 14:35:39 +01:00
Hans Goudey
47a002747c Merge branch 'blender-v4.3-release' 2024-11-18 08:34:40 -05:00
Hans Goudey
97be9b603b Cleanup: Grease Pencil: Remove unnecessary legacy modifier writing
Since all legacy Grease Pencil modifier are converted to regular modifiers
in versioning, we should never be in a position where we need to write the
old modifiers anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/130388
2024-11-18 14:33:20 +01:00
Sean Kim
28a5a800ee Fix #130422: Expand Active Face Set crashes on Multires mesh
Caused by dcb3391e10

Pull Request: https://projects.blender.org/blender/blender/pulls/130431
2024-11-18 14:31:10 +01:00
Lukas Tönne
fe76d267e3 Merge branch 'blender-v4.3-release' 2024-11-18 13:39:51 +01:00
Lukas Tönne
a452e2d499 Fix #125559: Eraser does not find intersections at small scales
When points are close together in 2D view space the eraser intersection
function does not have a valid direction vector (zero). This cancels out
terms in the computation that would still contribute to the result and
the function always returns zero intersections.

This patch adds a special case when the direction vector is zero,
so the point distance to the circle is still calculated (just not in
any particular direction).

Pull Request: https://projects.blender.org/blender/blender/pulls/130341
2024-11-18 13:39:10 +01:00
Bastien Montagne
4d181e9470 RNA: Store PointerRNA as pointer in PropertyRNAOrID.
While copying `PointerRNA` struct is currently extremely cheap, this
won't be the case in the future once it starts storing more complex
data.

Keeping an independent copy in `PropertyRNAOrID` struct should never be
needed, as this is a fairly short-lived runtime data, so store a pointer
to the given PointerRNA instead.
2024-11-18 12:59:39 +01:00
Sybren A. Stüvel
1c34e00ce1 Anim: draw prop as 'orange' when changed value with stashed Actions present
Properties that are animated, but have different values than their
animation data, are drawn in orange. This was skipped whenever any NLA
tracks were active (likely because this would re-evaluate the NLA for
every property drawn, which is a performance bottleneck).

This commit lifts this limitation slightly, and only skips the "has this
changed?" check if there are any non-muted NLA tracks. This means that
using the NLA purely as a stash of Actions is now possible without
losing the 'orange means it changed' indicators in the UI.

Fixes: #129968

Pull Request: https://projects.blender.org/blender/blender/pulls/130130
2024-11-18 12:58:36 +01:00
Falk David
624b38e531 Merge branch 'blender-v4.3-release' 2024-11-18 12:45:43 +01:00
Pratik Borhade
d7d7a6ef97 Fix: GPv3: Hide channel color for layers in dopesheet
This is not implemented yet so remove the callback function which draws
channel color for GPv3 layers. Also `acf_gpl_channel_color` is a legacy function,
it may lead to different channel color as explained in #130370.

Pull Request: https://projects.blender.org/blender/blender/pulls/130445
2024-11-18 12:44:38 +01:00
Falk David
cf39bd3704 Merge branch 'blender-v4.3-release' 2024-11-18 12:31:29 +01:00
Falk David
7911f8e6b3 Fix #130353: GPv3: Fill strokes disappear when using bucket fill
The issue was that when the fill strokes were merged into the drawing,
the `fill_opacity` attribute would be created on the drawing
(when it didn't exist before) and initialized to 0. This meant that
all previously drawn fill strokes would disappear.

The fix manaully initializes the `fill_opacity` attribute on the
target geometry before calling `join_geometries`.

Ideally this could be something the attribute system handles
or the `join_geometries` function takes care of by getting
some information about how to initialize attributes.

Pull Request: https://projects.blender.org/blender/blender/pulls/130442
2024-11-18 12:29:51 +01:00
Aras Pranckevicius
bbbe08d0b0 Fix #111703: banding and color shift when decoding some videos
Tell ffmpeg swscale to do accurate YUV->RGB conversion, instead of
slightly faster but not really accurate one. Fixes banding and some
color shifts in video files, particularly in dark regions.

The accurate conversion is a bit slower though, on 4K resolution video,
time taken to convert video frame from YUV to RGB:

- x64 (Ryzen 5950X): 2.3ms -> 3.7ms
- arm64 (M1 Max): 0.6ms -> 2.9ms

My take is that paying 1-2ms per 4K video playback is acceptable
since the result is obviously "more correct" and matches what VLC/ffplay
produces.

From what I can tell, "accurate conversion" turns off some dedicated
assembly code paths within ffmpeg. Maybe someday ffmpeg would get
accurate and assembly-optimized routines for that.

With more accurate decoding, we can now lower the expected render
test threshold again, since x64 & arm64 decoding is much closer now.

Comparison screenshots in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/130383
2024-11-18 12:27:50 +01:00
Pratik Borhade
7dfe47164a Fix #130325: GPv3: Update overlay on changing active layer in dopesheet
This is due to missing depsgraph update.

Pull Request: https://projects.blender.org/blender/blender/pulls/130367
2024-11-18 11:55:10 +01:00
Jesse Yurkovich
704d34fe0f Fix: properly save in-memory and packed textures during USD export
While adding test coverage for in-memory and packed texture scenarios, I
found that UDIMs were not being handled correctly in both cases. For
in-memory scenarios the per-tile generated/dirty status was not taken
into account. For packed scenarios the wrong filename substitutions were
being used.

This fixes both of these cases and adds test coverage for these
scenarios now. Both relative and absolute path options are validated.

Note: Both in-memory and packed images behave incorrectly when using the
'KEEP' and 'PRESERVE' texture export modes, so those remain untested
currently. A design on exactly what should happen in these modes is TBD.

Pull Request: https://projects.blender.org/blender/blender/pulls/130391
2024-11-17 21:53:35 +01:00
Clément Foucault
1a96d73f52 Fix: DRW: PassSimple do not pass resource_id correctly
This only happened if there are multiple different resource
handle used inside the same `PassSimple`.

Fix is to use the same logic to find the first instance.

Fix #130384
2024-11-17 19:17:12 +01:00
Clément Foucault
94d2a1e6a2 GPU: GLSL CPP stubs: Allow printf in code 2024-11-17 19:17:12 +01:00