1
1

Compare commits

...

275 Commits

Author SHA1 Message Date
948f8298b9 Release Cycle: bump to Blender 3.3.6 release 2023-04-17 16:03:35 +02:00
533e8ac3f3 Fix #106794: Changing active camera changes other viewport local cameras
f36543c5f5 took care of syncing multiple viewport`s cameras, but wasnt
fully meeting intentions [which was to only do this if both viewports
are locked to the scene camera].

Check was only done for the viewport this was executed in (if this was
locked to the scene camera, it would change all other viewports as
well), now also check if the target viewport prefers to use its own
local camera instead and skip it in that case.

Pull Request: blender/blender#106799

Pull Request: blender/blender#106858
2023-04-12 14:49:08 +02:00
c2b517950a Fix #106394: motion triangles could have unnormalized normals 2023-04-12 14:12:00 +02:00
9b86f9c32e Fix #106396: UV stitch crash with hidden faces
This was the case with hidden faces and `Sync Selection` turned ON.

Caused by 8f543a73ab.

Since 8f543a73ab, the UV element map
respects the hidden state of geometry, but stitching [which also
respected this on its own even prior to the culprit commit in its
calculation of connectivity] did this differently [it only skipped
hidden geo when UV_SYNC_SELECTION was OFF -- even though UVs would not
be visible which is probably the real error here, I believe there is
this principle that we "dont act on stuff we dont see"].

To fix this, also skip hidden geo (even with UV_SYNC_SELECTION = ON) in
the stitch calculation of connectivity, just as
`BM_uv_element_map_create` does it.

Should go into 3.3 LTS as well.

Pull Request: blender/blender#106493
2023-04-12 14:11:19 +02:00
b5144f7ec0 Fix #105339: grease pencil selection can toggle object selection
Grease Pencil (when not in object mode) implements its own selection
opertor. This operator (`gpencil.select`) returns
`OPERATOR_PASS_THROUGH`, then falls though to `view3d.select` which can
toggle object selection (when using shift-click picking).

Removing `OPERATOR_PASS_THROUGH` would fix the object toggling, but this
was added in 62c73db734 with good reason (the tweak tool would not
work then).

Now prevent `view3d.select` from acting on Grease Pencil (when not in
object mode).

NOTE: longer term we could have grease pencil use view3d.select to avoid having to add these awkward exceptions

Pull Request #105342
2023-04-12 14:10:31 +02:00
140f6a7a75 Fix #105216: Clear Asset does not immediately redraw the outliner
While **marking** an asset would update the Outliner immediately (this
due to the fact that `ED_asset_generate_preview` indirectly took care of
a refresh), **clearing** an asset would not do this.

Now be explicit about this in the Outliner listener and consider asset
notifiers there.

Pull Request: blender/blender#105287
2023-04-12 13:56:20 +02:00
312f954a22 Fix #105757: Resizing images is not marking them as changed
Resizing an image via the operator did not mark it dirty
(`IB_BITMAPDIRTY` is needed to pick this up as being modified, if this is
not set, no warning/option is shown on file close).

Note that using RNA would already do this correctly (since it uses
`BKE_image_scale` -- which already calls `BKE_image_mark_dirty`
internally).

Pull Request: blender/blender#105851
2023-04-12 13:55:31 +02:00
a9e4c62b41 Fix: unnecessary edge pan updates
Found together with a fix for #106043.

Edge panning (in Node Editors, Outliner and VSE) does unnecessary
updates when the view has not changed at all. This includes adding
`MOUSEMOVE` events (even if you dont move the mouse at all).

Adding `MOUSEMOVE` events results in the transform system constantly running (even if you dont move the mouse) which we certainly want to avoid.

Rectify this by only calling these updates when the view changes.

Pull Request: blender/blender#106301
2023-04-12 13:54:51 +02:00
4bb3baddbd Fix #105325: crash calling asset_generate_preview() in backgound mode
`.asset_generate_preview()` internally calls `UI_icon_render_id` as a
job -- as opposed to `.preview_ensure()` [which internally also calls
`UI_icon_render_id`, but not as a job] leading to crashes in background
mode.

This might be due to the fact that OpenGL context is not set up
correctly (so there might be other ways to fix this), but there seems to
be other places/comments indicating that icon handling is only for main
thread (see e.g. 13beeb5892).
And while this does not fully explain why doing this with jobs works fine
from the UI, the patch certainly fixes the crashes in background mode for
now (by not using jobs).

Pull Request: blender/blender#106046
2023-04-12 13:49:09 +02:00
5ff9180890 Fix #106251: "Shift to extend" doesn't work in 3D View Collections panel
Regression in [0], use shift to initialize the extend option when unset.

[0]: d7dd7403a8
2023-04-12 13:48:19 +02:00
9301513a43 Fix OBJ tests using release folder
This change aimed to solve the following issues:

- Possible threading issue of two tests writing to the same
  file, depending on how the ctest is invoked

- Test using the release directory, and potentially leaving
  temp file behind on test failure, breaking code sign on
  macOS.

Pull Request: blender/blender#106311
2023-03-30 19:59:56 +02:00
72a8bab04e Fix Cycles Metal failing when run in parallel, always run serial
The command buffer fails to execute, the cause is unknown. It does not
appear to be related to the binary archive cache as disabling that does
not prevent the issue.

Pull Request: blender/blender#106328
2023-03-30 19:56:30 +02:00
8dd3498b2b Release Cycle: bump to Blender 3.3.6 release candidate 2023-03-30 19:56:16 +02:00
dd0cd1df1d Release Cycle: Bump version cycle to release for 3.3.5. 2023-03-20 11:19:53 +01:00
c86cda24a3 Fix #104534: Image editor doesn't refresh after render.render.
When render is triggered from python and the render result is displayed
it isn't being updated as it wasn't tagged as being invalid.

Pull Request #105480
2023-03-16 14:37:05 +01:00
88dcc0b176 WM: Fix invalid memory access in wmTimer handling code.
Timer management code often loops over the list of timers, calling
independant callbacks that end up freeing other timers in the list. That
would result in potentail access-after-free errors, as reported in #105160.

The typical identified scenario is wmTimer calling wmJob code, which
calls some of the job's callbacks (`update` or `end` e.g.), which call
`WM_report`, which removes and add another timer.

To address this issue on a general level, the deletion of timers is now
deferred, with the public API `WM_event_remove_timer` only marking the
timer for deletion, and the private new function
`wm_window_delete_removed_timers` effectively removing and deleting all
marked timers.

This implements design task #105369.

Pull Request #105380
2023-03-16 14:31:14 +01:00
a274713f6c Fix #105230: Crash when reloading a library when one of its scene is active.
Scene and viewlayers pointers in the link/append context data need to be
updated after reload, otherwise they would keep pointing to old freed
IDs.
2023-03-16 14:30:13 +01:00
0e8080419d Fix #104341: Handle edge case in Curve to Mesh node
Don't create caps when using cyclic profile splines with two or fewer
points.
This case wasn't handled, yet, leading to invalid meshes or crashes.

Co-authored-by: Leon Schittek <leon.schittek@gmx.net>
Pull Request #104594
2023-03-16 14:24:05 +01:00
cb9cd06f06 Fix #104347: Loop Cut Tool becomes impressive with GPU Subdivision
When updating a mesh, the GPU Subdivision code makes calls to
`GPU_indexbuf_bind_as_ssbo()`.

This may cause the current VAO index buffer to change due to calls from
`glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo_id_)` in
`GPU_indexbuf_bind_as_ssbo()`.

The solution is to unbind the VAO (by calling `glBindVertexArray(0)`)
before creating the index buffer IBO.

Co-authored-by: Germano Cavalcante <grmncv@gmail.com>
Pull Request #104873
2023-03-16 14:19:10 +01:00
04da7c1153 Fix #104810: Appending a camera does not pull in background movie clip
This was broken even before 0649e63716 and was always expanding the
`Image`, not the movie clip (even if the source was set to
`CAM_BGIMG_SOURCE_MOVIE`)

Now the rule here seems to be to always expand unconditionally, so
remove checking the source and always expand image and movie clip.

Co-authored-by: Philipp Oeser <philipp@blender.org>
Pull Request #104815
2023-03-16 14:18:19 +01:00
Antonio Vazquez
23f6baf45b GPencil: Fix unreported Eyedropper color difference in Materials
The color selected was converted wrongly for materials. The undo of the conversion must be done only for palettes.

Also, some code cleanup done.
2023-03-16 14:15:59 +01:00
02498e8f13 Fix failing test after own recent commit regarding Main freeing function.
3e5ce23c99 introduced a regression in case the freed Main was part of a
list, and was supposed to be removed from it, since calling
`BLI_remlink` does _not_ clear the `prev`/`next` pointers of the removed
link.

This commit also contains a few more tweaks to recent related b3f42d8e98
commit.
2023-03-16 13:54:58 +01:00
28cb5a3a04 Cleanup: Add warning to ListBase's BLI_remlink regarding not cleared prev/next pointers.
While this behavior can be useful in some cases, it can also create
issues (as in one of own recent commits, 3e5ce23c99), since it
implicetly keeps the removed linknode 'linked' to the listbase.

At least warn about it in the documentation of `BLI_remlink`.
2023-03-16 13:54:58 +01:00
f4b095c872 Fix #99836: Blender SEGV when open .blend file in blender.
Use recent 'abort file reading' mechanism to simply not try to load such
purposedly broken .blend files at all.
2023-03-16 13:54:58 +01:00
b9d242797b Add a mechanism to abort a blend file reading on critical error.
This commit introduces a new Main boolean flag that marks is as invalid.

Higher-level file reading code does checks on this flag to abort reading
process if needed.

This is an implementation of the #105083 design task.

Given the extense of the change, I do not think this should be
considered for 3.5 and previous LTS releases.
2023-03-16 13:54:58 +01:00
6494fbbdc5 Fix (unreported) potential leak in Main freeing function.
Could happen in case a 'split-by-libraries' Main is passed to
`BKE_main_free`.
2023-03-16 13:54:58 +01:00
0c79ec15f4 Release cycle: Version bump to 3.3.5 candidate 2023-03-16 13:47:03 +01:00
743389a99c Cleanup: quiet parenthesis compiler warnings 2023-03-10 20:12:06 +11:00
2f16323ff0 Update submodule hashes for 3.3.4. 2023-02-21 10:12:54 +01:00
5429ce1e0a Bump version char to release for 3.3.4. 2023-02-20 12:51:44 +01:00
d9ff1fb519 Make update: Allow amd64 architecture
Apparently, the 64bit Intel architecture is presented differently
on Linux and Windows.

Allow both variants for the command line, so that semantically the
command line argument can be seen as a lower case platform.machine.

Pull Request #104877
2023-02-17 15:24:32 +01:00
867bee6125 Make update: Add --architecture command line attribute
Possible values are x86_64 and arm64.

Allows to use make_update.py in a cross-compile environment, like
building x86_64 macOS Blender from Apple Silicon machine.

Pull Request #104863
2023-02-17 15:11:13 +01:00
6cb3145d6c Make update: Add new style command line for Linux libraries
It is not possible to know from the Buildbot which style to use
when building patches. So use the new style as an alias.
2023-02-17 15:07:50 +01:00
3f3067c70c Make update: Use BKE_blender_version to detect release branches
On a user level there are no expected changes, other than being able
to update submodules and libraries from a main repository at a detached
HEAD situation (which did not work before).

On the infrastructure level of things this moves us closer to ability
to use the main make_update.py for the buildbot update-code stage, and
to remove the update-code section from the pipeline_config.yaml.

The initial idea of switching make_update to the pipeline config did
not really work, causing duplicated work done on blender side and the
buildbot side. Additionally, it is not easy to switch make_update.py
to use pipeline_config.yaml because the YAML parser is not included
into default package of Python.

There will be few more steps of updates to this script before we can
actually clean-up the pipeline_config: the changes needs to be also
applied on the buildbot side to switch it to the actual make_update.

Switching buildbot to the official make_update.py allows to much more
easily apply the submodules change as per #104573.

Pull Request #104875
2023-02-17 14:17:33 +01:00
581d1f396b Cycles: fix rendering with Nishita Sky Texture on Intel Arc GPUs in 3.3
This is a backport of 1c90f8209d.

Pull Request #104781
2023-02-15 15:11:46 +01:00
1e16e55f7d Fix #104637: EEVEE Displacement regression after #104595
Keep using the 3 evaluations dF_branch method for the Displacement output.
The optimized 2 evaluations method used by node_bump is now on its own macro (dF_branch_incomplete).
displacement_bump modifies the normal that nodetree_exec uses, so even with a refactor it wouldn’t be possible to re-use the computation anyway.
2023-02-15 13:46:54 +01:00
4fec780a9f Fix #103903: Bump Node performance regression
Avoid computing the non-derivative height twice.
The height is now computed as part of the main function, while the height at x and y offsets are still computed on a separate function.
The differentials are now computed directly at node_bump.

Co-authored-by: Miguel Pozo <pragma37@gmail.com>
Pull Request #104595
2023-02-15 13:45:50 +01:00
608916b0e1 Fix #104514: GPencil merge down layer misses some frames
When merging two gpencil layers, if the destination layer had a keyframe
where the source layer did not, strokes of the previous keyframe
in source layer were lost in that frame.

This happened because the merge operator was looping through
frames of the source layer and appending strokes in the
corresponding destination layer, but never completing
other frames than the ones existing in the source layer.

This patch fixes it by first adding in source layer
all frames that are in destination layer.

Co-authored-by: Amelie Fondevilla <amelie.fondevilla@les-fees-speciales.coop>
Pull Request #104558
2023-02-15 13:38:13 +01:00
a3c0ff9b74 Fix #104026: Click-Drag to select graph editor channels no longer working
Box-Selecting channels in the dope sheet with click-drag was no longer possible as of Blender 3.2

Due to the removal of tweak events the box select operator was always shadowed by the click operator.

Original Phabricator discussion here: https://archive.blender.org/developer/D17065

Use `WM_operator_flag_only_pass_through_on_press` on click operator to fix it

Co-authored-by: Christoph Lendenfeld <chris.lenden@gmail.com>
Pull Request #104505
2023-02-15 13:37:23 +01:00
bc9a6c858e Fix (unreported): snap to object origin not respecting clipping planes
There was an incorrect conversion for local clip planes although the
coordinates used are in world positions.
2023-02-15 13:36:36 +01:00
Amelie Fondevilla
92213e052b Fix T104371: GPencil merge down layer duplicates wrong frame
The merge down operator was sometimes copying the wrong frame, which altered the animation.
While merging the layers, it is sometimes needed to duplicate a keyframe,
when the lowest layer does not have a keyframe but the highest layer does.
Instead of duplicating the previous keyframe of the lowest layer, the code
was actually duplicating the active frame of the layer which was the current frame in the timeline.

This patch fixes the issue by setting the previous keyframe of the layer as its active frame before duplication.

Related issue: T104371.

Differential Revision: https://developer.blender.org/D17214
2023-02-15 13:35:59 +01:00
555eb1e46c Fix T88617: Wrong annotation cursor in Preview of sequencer editor
Allow preview region to change cursor as per the selected tool

Reviewed by: campbellbarton, ISS

Differential Revision: https://developer.blender.org/D16878
2023-02-15 13:35:23 +01:00
0364607a69 Fix T90893: Restoring a key in the keymap editor doesn't work if the key is only disabled
Reset `KMI_INACTIVE` flag when restore-item  button is called

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D16773
2023-02-15 13:34:32 +01:00
06bfceeda7 Fix T104243: GPencil Cutter flattening caps on both sides 2023-02-15 13:33:49 +01:00
786286111d Fix T104176: Smooth modifier with vergex group not work for negative factors.
Regression from rBabc8d6b12ce9, over three years ago!

Should be backported to the active LTS releases too.
2023-02-15 13:32:51 +01:00
a1015d2d23 Fix T104089: Removing greasepencil vertex group can leave no active
We should always have an active vertexgroup (making sure this is the
case was just not happening on the greasepencil side).

Now do this (similar to what is done for other object types in
`object_defgroup_remove_common`).

Maniphest Tasks: T104089

Differential Revision: https://developer.blender.org/D17091
2023-02-15 13:21:59 +01:00
aa2571b8e7 Fix T94752: Cycles renders stereoscopic panoramas incorrectly
The bug is caused by rBb66b3f547c43e841a7d5da0ecb2c911628339f56.
From what I can see, that fix was intended to enable manual lens shift for
panorama cameras, but it appears that it also unintentionally applies
interocular shift.

This fix disables the multiview shift for panorama cameras, that way manual lens
shift still works but we get the 2.x behavior for stereoscopic renders back.

Differential Revision: https://developer.blender.org/D16950
2023-02-15 13:18:45 +01:00
90f06aa48f Fix T103888: Regression: Side-by-side stereo renders ignore color management
Looks like rB42937493d8253a295a97092315288f961e8c6dba accidentally dropped the
colorspace copy.
2023-02-15 13:15:04 +01:00
3a0eb79ed0 Fix T103887: Line Art Vertex Weight Transfer to target group broken
Caused by {rB841df831e89d} and {rB3558bb8eae75}.

These commits moved flags from `eLineArtGPencilModifierFlags` to
`eLineartMainFlags`, but later on in code, these were still evaluated
from the modifiers `flags` (instead of `calculation_flags`).
This resulted in a false condition (`match_output` was assumed true but
it wasnt), leading to a wrong codepath taken.

This is now corrected (`calculation_flags` need to be passed around for
this as well).

Maniphest Tasks: T103887

Differential Revision: https://developer.blender.org/D17062
2023-02-15 13:13:55 +01:00
fc61f24f63 Fix T103400: Transfer Mesh Data Layout broken for color attributes
This was the case when using the operator outside of the modifiers panel.

Caused by {rBeae36be372a6}.

In above commit, `DT_layer_items` shared both `DT_TYPE_MPROPCOL_LOOP` |
`DT_TYPE_MLOOPCOL_LOOP` in a single EnumPropertyItem value "Colors".
This is a bit unusual, but probably allowed.
As a consequence, checks for specific datatypes would fail when selecting
such EnumPropertyItem:
- `DT_DATATYPE_IS_MULTILAYERS` (uses `ELEM` to check distinct entries --
would return false)
- `BKE_object_data_transfer_dttype_to_srcdst_index` (would return
`DT_MULTILAYER_INDEX_INVALID`)

These places have now been corrected to take these "special" values into
account.

Another issue was that multiple EnumPropertyItems with the same value
could be created in dt_add_vcol_layers() if attributes of the same
domain, but different color types are in play (could lead to crashes)
and that has also been corrected.

Also: above commit did not give the choice of transfering color
attributes from the vertex domain (only face corner attributes could be
chosen), this has now been added. DT_layer_vert_items (used from the
modifier) already had this included so this was only an issue when using
the operator outside of the modifiers panel.

Since we now feature two domains, the single "VCOL" in the enum has been
split into "COLOR_VERTEX" and "COLOR_CORNER". This will break existing
scripts calling bpy.ops.object.datalayout_transfer and will be marked as
a breaking change in the release notes.

NOTE: there is another bug here when attributes of the same domain, but
different color types are in play and you want to transfer just a single
specific layer (but that is for a separate commit)

Maniphest Tasks: T103400

Differential Revision: https://developer.blender.org/D16935
2023-02-15 13:11:45 +01:00
4eab596c3d Fix T103972: crash with cloth simulation rest shape key and subdivision surface 2023-02-15 12:59:15 +01:00
46293e3f97 Fix T103881: Unlink operation crash in Blender File view
Similar to rBe97443478e32 and rBe772087ed664, exit early when
texture, collection and world ID has no parent to unlink from.

Reviewed by: Severin, lichtwerk

Differential Revision: https://developer.blender.org/D17017
2023-02-15 12:58:22 +01:00
225f9c9528 Build: update patch for OSL which no longer applied
Remove patch on src/include/OSL/mask.h which is no longer included &
content from this file is no longer included.
2023-02-14 21:53:23 +11:00
86a41f8c34 Fix bug report including rB commit hash prefix not needed for Gitea 2023-02-13 18:35:03 +01:00
2cec5d8139 Fix Cycles bug baking with multiple materials, due to mistake in backport 2023-02-09 23:25:43 +01:00
8c7cca66f0 Build: library security updates for Blender 3.3.4
Various things found by make cve_check.

Differential Revision: https://developer.blender.org/D16956
2023-02-02 16:42:03 +01:00
e636c4e4c4 Bump version to 3.3.4rc 2023-02-01 17:45:04 +01:00
09febafb97 Updating submodule hashes for 3.3.3 release. 2023-01-17 12:50:44 +01:00
8d94aeb604 Release cycle: Version bump to 3.3.3 release 2023-01-17 09:40:39 +01:00
faca2c614b Fix T103507: Distant lights partially contribute to wrong lightgroup
The the BSDF-sampling half of MIS next-event estimation for distant lights was
using the background lightgroup instead of the lamp's lightgroup.
2023-01-14 02:34:03 +01:00
d290b8b2b9 Fix T103403: Lightgroup passes can contain lighting on shadow catchers 2023-01-14 02:10:28 +01:00
c3a5a0becf Fix T101501: Masks are not visible in Image Editor
Need to initialize the mask drawing overlays when the new space
is created. Otherwise the new space is configured in a way that
the splines are not visible and overlay opacity is 0.

This change fixes the new masking files created. The currently
saved ones need a manual tweak.
2023-01-13 10:51:37 +01:00
47868c8a4f Fix T101981: Incorrect playback of AVI files
Commit bcc56253e2 introduced 3 frame negative offset for seeking. This
can result in negative seek values.

Ensure, that seek value is always positive.
2023-01-13 09:08:33 +01:00
4ffbc6175e Fix T101964: Edge and face snapping no locking to axis
In rBed6c8d82b804 it was wrongly assumed that the constraint functions
always apply the transformations.

But that is not the case for when axes are aligned.

The `mul_m3_v3(t->con.pmtx, out)` fallback is still required.
2023-01-12 22:43:09 +01:00
d6d0643265 Fix T101196: constraint plane failing in side orthographic views
Caused due to an inaccuracy when the values of `in` and `out` are too
close.

The solution is to project the value of `in` directly onto the plane.
2023-01-12 22:42:33 +01:00
405dd143cf Fix: UI: broken texpaintslot/color attributes/attributes name filtering
rB8b7cd1ed2a17 broke this for the paint slots
rB4669178fc378 broke this for regular attributes

Name filtering in UI Lists works when:
- [one] the items to be filtered have a name property
-- see how `uilist_filter_items_default` gets the `namebuf`
- [two] custom python filter functions (`filter_items`) implement it
themselves
-- if you use `filter_items` and dont do name filtering there, the default
name filtering wont be used

So, two problems with rB8b7cd1ed2a17:
- [1] items to be listed changed from `texture_paint_images` to
`texture_paint_slots`
-- the former has name_property defined, the later lacks this
- [2] the new `ColorAttributesListBase` defined a `filter_items` function,
but did not implement name filtering

And the problem with rB4669178fc378:
- it added `filter_items` functions, but did not implement name filtering.

These are all corrected now.

Fixes T102878

Maniphest Tasks: T102878

Differential Revision: https://developer.blender.org/D16676
2023-01-12 22:20:12 +01:00
095b363899 Fix: Reversed attribute is_internal RNA property
`is_internal` is supposed to mean that the attribute shouldn't be
visible in lists or the spreadsheet by default, and that it can't be
accessed in geometry nodes. But the value was reversed, which
just happened to work because the list filtering was swapped.

Differential Revision: https://developer.blender.org/D16680
2023-01-12 22:13:40 +01:00
6191b726aa Fix T103615: OSL image box mapping has flipped textures
This breaks backwards compatibility some in that 3 sides will be mapped
differently now, but difficult to avoid and can be considered a bugfix.

Similar to rBdd8016f7081f.

Maniphest Tasks: T103615

Differential Revision: https://developer.blender.org/D16910
2023-01-12 22:08:01 +01:00
6aacbdd716 Fix T103234: GPencil applying armature does not work
The problem was the bake function was using the evaluated
data and must use the original data.

The problem was caused by commit: rBcff6eb65804d: Cleanup: Remove duplicate Bake modifier code.

Fix by Philipp Oeser
2023-01-12 22:06:03 +01:00
442ce8610d Fix Outliner: Click next to View Layer name triggers object select
Unlike other (closed) hierarchies, view layers dont show their contents
next to their names.

Code would still find the item via outliner_find_item_at_x_in_row though,
this is now prevented (same as if the viewlayer was open [instead of
collapsed]).

Fixes T102357.

Maniphest Tasks: T102357

Differential Revision: https://developer.blender.org/D16662
2023-01-12 22:05:08 +01:00
158752cee6 Fix T103303: Dbl-click in the Graph Editor wont select all keyframes
This was the case when an Annotation is also present as in the report.

Since {rB92d7f9ac56e0}, Dopesheet is aware of greaspencil/annotations
(displays its channels/keyframes, can rename their data, layers, fcurve
groupings etc.). However, the Graph Editor does not display these /
should not be aware of them.

Above commit already had issues that were addressed in the following
commits (mostly adding the new `ANIMFILTER_FCURVESONLY` to places that
dont handle greasepencil/annotations)
- {rBfdf34666f00f}
- {rB45f483681fef}
- {rBa26038ff3851}

Now in T103303 it was reported that doublicking a channel would not
select all fcurve`s keyframes anymore and this wasnt actually an issue
with that particular operator, but instead with another operator that is
also mapped to doubleclicking: the channel renaming (I assume the
keyconflict here is actually wanted behavior).
Channel renaming would not return `OPERATOR_PASS_THROUGH` here anymore
in the case nothing cannot be renamed, so we would not actually reach
the 2nd operator at all (the one selecting all keyframes).
Deeper reason for this is that the renaming operator would actually
"see" a channel that could be renamed (in the case of the report: an
annotation layer), but then cannot proceed, because the "real"
underlying data where the doubleclick happens is an fcurve...

So now exclude non-greasepencil channels in filtering as well where
appropriate by also adding `ANIMFILTER_FCURVESONLY` to the filter there.

Fixes T103303.

Maniphest Tasks: T103303

Differential Revision: https://developer.blender.org/D16871
2023-01-12 22:02:21 +01:00
9137a4f03c Fix: new Grease Pencil layer not selected when added from the viewport
When adding a new layer from the viewport, the newly created layer
is set as active, which is visible in the properties panel,
but the selection in the dopesheet was not updated accordingly,
due to a missing notifier which is added in this patch.
2023-01-12 22:01:26 +01:00
8529458cc7 Fix T95683: FFmpeg seeking is broken
According to information I gathered, ffmpeg seeks internally using DTS
values instead of PTS. In some files DTS and PTS values are offset and
ffmpeg fails to seek correctly to keyframe located before requested PTS.

This issue become evident after hardcoded preseek of 25 frames was
removed and effort went into more precise seeking to improve
performance. It was thought, that this is bug in ffmpeg code, but
after reading some discussions, I don't think it is considered as such
by their developers, see below:
http://ffmpeg.org/pipermail/ffmpeg-devel/2018-March/226354.html
https://trac.ffmpeg.org/ticket/1189

Best solution seems to be to add small preseek value possibly at
detriment of performance, so 3 frames of preseek are applied. Number 3
was chosen experimentally.

Performance impact seems to be insignificant with this change.

Reviewed By: zeddb

Differential Revision: https://developer.blender.org/D15847
2023-01-12 22:00:28 +01:00
3029bd2b0c Fix T102942: Cycles wrong alpha for multi-layer PSD files 2023-01-12 21:59:31 +01:00
427b0a0ab2 Fix T101850: Cycles DDS oversaturation when alpha is in use
DDS files coming through OIIO needed a similar treatment as TGA in
T99565; just for DDS OIIO just never set the "unassociated alpha"
attribute. Fixes T101850.

Reviewed By: Brecht Van Lommel
Differential Revision: https://developer.blender.org/D16270
2023-01-12 21:57:00 +01:00
eca95d35ba Fix T102612: Line art crash on loading due to references to other scenes. 2023-01-12 21:40:39 +01:00
849c76a10b Fix T102993: Incorrect icon displaying of Weighted Normal modifier in the outliner
Mistake in {rBd15e8bdaa3343cf97a74f918b2570e66fb7abfa0}

Reviewed by: JacquesLucke

Differential Revision: https://developer.blender.org/D16890
2023-01-12 21:39:14 +01:00
6fbb4d7051 Fix T103261: Undo after mask extract doesn't restore active object 2023-01-12 15:49:11 +01:00
ae5b912f78 Fix T103293: GPencil Multiframe Scale affects stroke thickness inversely
The problem was the falloff factor was applied directly
and in the thickness must be inversed. Now the thickess
is calculated using an interpolation.
2023-01-12 15:46:50 +01:00
d2050c7c36 Fix T102990: OpenVDB files load very slow from network drives
The OpenVDB delay loading of voxel leaf data using mmap works poorly on network
drives. It has a mechanism to make a temporary local file copy to avoid this,
but we disabled that as it leads to other problems.

Now disable delay loading entirely. It's not clear that this has much benefit
in Blender. For rendering we need to load the entire grid to convert to NanoVDB,
and for geometry nodes there also are no cases where we only need part of grids.
2023-01-12 15:40:19 +01:00
746af98b00 Fix T102992: GPencil Array doesn't respect restriction in Offset
The problem was the bounding box was calculated using
all strokes, but if a filter is added, the bounding box must
include only selected strokes.

Fix by @frogstomp
2023-01-12 15:27:32 +01:00
17fd81fb9b Fix T102684: GPencil Crash when trying to sculpt with Dot Dash
The problem was the original pointer was not set.

There is a technical limitation with dots of 1 point
because it cannot assign orig pointer.
2023-01-12 15:26:45 +01:00
77e66d630a GPencil: Fix unreported interpolate crash if no frames
If there is a layer that hasn't frames but is not the active layer
the pointer to frames can be NULL and crash.

Now, the empty layers are skipped.

Reported to me by Samuel Bernou.
2023-01-12 15:16:13 +01:00
b3e0eadbdc GPU: Fix using FLOAT_2D_ARRAY and FLOAT_3D textures via Python.
Translation from python enum values were incorrect and textures created
in python using those types would result in faulty textures. In
renderdoc those textures would not bind.
2023-01-12 15:02:01 +01:00
a86f32d219 Fix T102797: Unlinking an Orphan Action crashes
In `Orphan Data` (or `Blender File`) view, the ID pointer of the
actions's parent tree-element wasn't actually pointing to an ID, but to
the list-base containing the IDs.

Early out (with a warning) if the object or object-data to unlink the
action from is not clear.

Caused by rBb4a2096415d9.

Similar to rBe772087ed664.

Maniphest Tasks: T102797

Differential Revision: https://developer.blender.org/D16635
2023-01-12 14:40:12 +01:00
2bbabbc739 Fix T102801: Empty metasequence sliding away while moving
Meta strip position relies on strips within. When meta strip is empty,
update function, that would normally update it's position returns early
and this causes translaton to behave erratically.

When strip is empty, treat it as normal strip and move its start frame
as with other strip types.
2023-01-12 14:34:04 +01:00
7a4b3d2287 Fix T102663: Meta strips from older versions are broken
Meta strip range was adjusted in versioning because of previous issues
by function `version_fix_seq_meta_range`. After `speed_factor` property
was added, this changed how function works and result was incorrect
function due to uninitialized property value.

Running `version_fix_seq_meta_range` after `seq_speed_factor_set` fixes
this issue.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D16606
2023-01-12 14:31:16 +01:00
5940e9b792 Fix: missing greasepencil hook modifier relationship lines
Overlay relationship lines were missing between the object having the
modifier and the target object.

To make this consistent with other objects types, now draw relationship
lines for greasepencil and hooks now, too.

Spotted while looking into T102741.

Maniphest Tasks: T102741

Differential Revision: https://developer.blender.org/D16609
2023-01-12 14:00:42 +01:00
f3a10a1543 Fix: greasepencil selection mask picking points not working
When in greasepencil sculpt-/vertexpaint mode and using selection
masking, picking points wasnt working correctly.

So regular gpencil.select (without modifier keys) was not enabled for the
keymap. This only really makes sense for RCS (right click select) atm
(and not using RC fallback tools - which I dont think are present in
these modes anyways). With RCS, this can be supported and afaict, this
does not cause conflicts.

NOTE: prior to D16576, one could use the ALT modifier key (this
combination was actually in the keymap) -- but it should select the
entire stroke, which is handled in D16576.

Differential Revision: https://developer.blender.org/D16577
2023-01-12 13:52:53 +01:00
e981a187e5 Fix T102685: Grease Pencil brush cursors missing on file open
Brush cursors were missing when opening a file saved in sculpt/vertex-/
weightpaint mode.

Since we dont do a full modeswitch on file load in `ED_editors_init` for
grease pencil since rBde994d6b7b1c, we were missing the brush cursor
toggling [`ED_gpencil_toggle_brush_cursor`] normally done in
`ED_gpencil_setup_modes`.

This is now explicitly added for any greasepencil paintmode (in case
object is active).

Maniphest Tasks: T102685

Differential Revision: https://developer.blender.org/D16603
2023-01-12 13:51:57 +01:00
15b36dc4e6 Fix: greasepencil selection of entire_strokes not working
Caused by rB85f90ed6fd88.

Above commit made sure whole strokes are selected when the
GP_SELECTMODE_STROKE is used in different modes, but ignored the fact
that this can also already be set by the entire_strokes select operator
property.

This is now corrected.

Differential Revision: https://developer.blender.org/D16576
2023-01-12 13:51:03 +01:00
a274718e7d Fix T102514: wrong scene reported for missing compositing camera
If compositing uses renderlayers, and a camera was missing in the
associated scenes, the error message also referred to the scene the comp
tree was in (not the scene of the renderlayer -- which can potentionally
be different).

This was confusing and is now rectified.

Maniphest Tasks: T102514

Differential Revision: https://developer.blender.org/D16542
2023-01-12 13:49:58 +01:00
fff29e1bd6 Fix T102470: Make material LineArt properties animatable.
MaterialLineArt didn't have a path func, now corrected.
2023-01-12 13:41:02 +01:00
YimingWu
9d3d9019ab Fix T101824: Line art flickers when light object has scaling.
Line art doesn't expect light or camera objects to have scaling.
2023-01-12 13:36:05 +01:00
f32939af53 Fix T101402: EEVEE: Wrong Volume transforms
Ensure VolumeUniformPool uses is always incremented when retrieving a buffer in alloc().
Otherwise the same buffer will be retrieved for more than one object when incrementing the pool size.

Reviewed By: fclem

Maniphest Tasks: T101402

Differential Revision: https://developer.blender.org/D16607
2023-01-12 13:16:40 +01:00
cdfb21c7e2 Fix T102466: push/pull doesn't work if applied to many vertices
The assignment of member`distance` was missing in rB2d4ec9049744.
2023-01-12 13:15:02 +01:00
4107e04c45 Fix T102670: Crash after deleting attribute in edit mode
Since we free BMesh attributes by attempting on every domain,
sometimes the attribute wouldn't be found for a CustomData.
We avoid reallocating custom data blocks in that case, so we
need to pass the ownership of the "pool" back to the BMesh.
2023-01-12 13:13:54 +01:00
4d25c6b86e Fix T103423: boolean crash on macOS Apple silicon
Thanks to Howard Trickey for finding the cause.
2023-01-09 15:12:02 +01:00
934af61134 Bump version to 3.3.3rc 2023-01-09 14:22:35 +01:00
bd3a7b41e2 Update submodule references before tagging v3.3.2 2022-12-07 13:12:06 +01:00
bf24652e38 Release cycle: Bump char for Blender 3.3.2 release. 2022-12-06 19:19:59 +01:00
86abbf7176 Fix macOS build error after recent changes to enable Intel GPUs
This will only work once we upgrade to the macOS 13 SDK.

Ref D16253
2022-11-28 19:21:50 +01:00
Morteza Mostajab
f9f834068e Cycles: Allow Intel GPUs under Metal
Known Issues:
- Command buffer failures when using binary archives (binary archives is disabled for Intel GPUs as a workaround)
- Wrong texture sampler being applied (to be addressed in the future)

Ref T92212

Differential Revision: https://developer.blender.org/D16253
2022-11-28 19:20:41 +01:00
3e247f0f76 Cycles: Enable MetalRT pointclouds & other fixes
Differential Revision: https://developer.blender.org/D16499
2022-11-28 19:20:29 +01:00
Michael Jones
021c8c7cd0 Cycles: Tweak inlining policy on Metal
This patch optimises the Metal inlining policy. It gives a small speedup
(2-3% on M1 Max) with no notable compilation slowdown vs what is already
in master. Previously noted compilation slowdowns (as reported in T100102)
were caused by forcing inlining for `ccl_device`, but we get better
rendering perf by relying on compiler heuristics in these cases.

Backported to 3.3 because this also fixes a test failure.

Differential Revision: https://developer.blender.org/D16081
2022-11-28 19:18:36 +01:00
8dfe5b236e Fix slow continuous depsgraph updates in sculpt paint mode in some cases
Updates for cursor could cause the paint data to be continuously refreshed,
which is pretty cheap by itself, but not when it starts tagging the depsgraph.

The paint slot refresh code ideally should not be doing depsgraph tags at all,
but checking if there were changes at least avoids continuous updates.
2022-11-28 17:03:59 +01:00
24c416c302 Fix T101925: sculpt color painting not updating with Cycles viewport render
* External engines do not use the PBVH and need slower depsgraph updates.
* Final depsgraph tag after stroke finishes was missing for sculpt color
  painting, caused missing updates for other viewports as well as any
  modifiers or nodes on other objects using the colors.
2022-11-28 16:06:13 +01:00
dd7a10e5a5 Fix T102214: inconsistenty between bake and render with invalid material index
When the materal slot index on mesh faces exceeds the number of slots, rendering
would use the last material slot while other operations like baking would fall
back to the default material.

Now consistently use the last material slot in such cases, since preserving
backwards compatibility for rendering seems most important. And if there is
one material slot, it's more useful to use that one rather than falling back
to the default material.
2022-11-28 15:56:06 +01:00
2eabe0a320 Fix T100969: Memory leak GPU subdivision during rendering.
The viewport cleans up old subdivision buffers right after drawing.
During rendering this was not done and when rendering many frames
this lead to memory issues.

This patch will also clear up the GPU Subdivision buffers after any
offscreen render or final render. There is already a mutex so this
is safe to be done from a non main thread.

Thanks to @kevindietrich to finding the root cause.
2022-11-28 15:02:52 +01:00
Sayak Biswas
3e41332798 Cycles: enable AMD RDNA3 GPUs and upgrade HIP compiler
* Enable AMD RDNA3 GPUs
* Fix T100891: performance regression with RDNA2 cards
* Workaround new compiler issue with Vega, by using -O1

Differential Revision: https://developer.blender.org/D16507
2022-11-28 15:01:19 +01:00
Germano Cavalcante
e968b4197b Fix T102257: Crash when making an Object as Effector set to Guide and trying to scrub the timeline
rB67e23b4b2967 revealed the bug. But the bug already existed before,
it just wasn't triggered.

Apparently the problem happens because the python code generated in
`initGuiding()` cannot be executed twice.

The second time the `initGuiding()` code is executed, the local python
variables are removed to make way for the others, but the reference to
one of the grids in a `Solver` object (name='solver_guiding2') is still
being used somewhere. So an error is raised and a crash is forced.

The solution is to prevent the python code in `initGuiding()` from being
executed twice.

When `FLUID_DOMAIN_ACTIVE_GUIDE` is in `fds->active_fields` this
indicates that the pointer in `mPhiGuideIn` has been set and the guiding
is already computed (does not need to be computed again).

Maniphest Tasks: T102257

Differential Revision: https://developer.blender.org/D16416
2022-11-28 15:00:10 +01:00
4d58a1c657 Fix Grease Pencil materials added by Python missing
These materials were missing from the "Change Active Material" menu.

Caused by rBe3faef686d38.

Error was getting the preview [which wasnt there yet]
These only appeared once the material tab in the Properties Editor was
used (since this ensured a valid preview icon).

Above commit changed behavior for RNA icon getter (this does not create
data anymore), so ensure the preview by hand here.

Similar to rB182edd4c35c2.

Fixes T102566.

Maniphest Tasks: T102566

Differential Revision: https://developer.blender.org/D16541
2022-11-28 14:59:36 +01:00
6008c67859 Fix T100530: Drawing arifacts Volume/AMD.
Missing initialization of global shader variable.
Most drivers initialize these by them selves, but not all of them.
2022-11-28 14:58:39 +01:00
4a7ace4a78 win-launcher: linger when launched from steam
The launcher is designed to exit as soon as possible
so there's no useless processes idling. Now when steam
launches blender with the launcher, this breaks the
time tracking steam has as the thing it just started
exits within milliseconds.

There already is some code in the launcher that makes
the launcher linger to support background mode. This
patch extends this a bit to also wait if the parent
process is steam.exe

Reviewed by: brecht lichtwerk dingto
Differential Revision: https://developer.blender.org/D16527
2022-11-28 14:51:17 +01:00
5a03d212a9 Fix T100926: Show UV outline in texture paint mode
After rB716ea1547989 the UV overlay is no longer displayed in
the UV Editor. It only appears for the Image Editor.

So restore the previous behavior, displaying the "UV shadow"
overlay in the UV editor as well.

Reviewed By: Jeroen Bakker, Germano Cavalcante

Maniphest Tasks: T92614, T100926

Differential Revision: https://developer.blender.org/D16490
2022-11-28 14:50:39 +01:00
f0cd1fed18 Fix T102537: Curve subdivide mishandles single point curves
Also, single point cyclic Catmull Rom curves aren't evaluated properly.
Cyclic is meant to make no difference in that case. Now they correctly
evaluate to a single point.
2022-11-28 14:49:55 +01:00
Martijn Versteegh
e257e2e075 Fix: Link drag search crash with incorrect socket name in switch node
When dragging out a boolean noodle, releasing and choosing
'switch > Switch' from the search popup, the code would mistakenly
search for 'Start' instead of 'Switch'.

Also the function called was not exactly the right one, leading to the
node being marked as invalid.

Reviewed By: Jacques Lucke

Differential Revision: https://developer.blender.org/D16512
2022-11-28 14:47:38 +01:00
981245fc6f Fix T102421: Image.save() not respecting set image.file_format
The default file type for new ImBuf is already PNG, no need to override it
again in the save method.
2022-11-28 14:46:22 +01:00
c024d6f47d Fix T95335 Bevel operator Loop Slide overshoot.
If the edge you are going to slide along is very close to in line
with the adjacent beveled edge, then there will be sharp overshoots.
There is an epsilon comparison to just abandon loop slide if this
situation is happening. That epsilon used to be 0.25 radians, but
bug T86768 complained that that value was too high, so it was changed
to .0001 radians (5 millidegrees). Now this current bug shows that
that was too aggressively small, so this change ups it by a factor
of 10, to .001 radians (5 centidegrees). All previous bug reports
remained fixed.
2022-11-28 14:42:37 +01:00
92680674d0 Fix T102187: Add knife tool in mesh panel
Add knife tool option in mesh panel

Reviewer: campbellbarton, JulienKaspar

Differential Revision: https://developer.blender.org/D16395
2022-11-28 14:41:52 +01:00
4f22e6178e Fix T101270: Object Info > Random not unique for nested instances and curves
This random number is intended to be unique for every instance, however for
some cases with more than one level of nesting this was failing. This also
affected curves after they were refactored to use geometry sets.

For simple cases the random number is the same as before, however for more
complex nesting it will be different than before, changing the render result.
2022-11-28 14:33:58 +01:00
d0e9a8c46a Fix T101533: Wrong DoF when a non-camera object is the active camera
Make sure non-camera data is not casted to a Camera pointer.

Solution suggested by Damien Picard (@pioverfour).
2022-11-28 14:33:13 +01:00
331de028ef Fix T101220: UV proportional editing not working correctly with UV Sync Selection
Regression introduced in rb2ba1cf4b40fc.

The `MLOOPUV_VERTSEL` flag only indicates UV selection without sync.
2022-11-28 14:32:38 +01:00
Germano Cavalcante
29bc410c8a 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-11-28 14:31:02 +01:00
be34354500 audaspace: Fix build error with MSVC 17.4+
`DeviceManager.h` uses `std::string` without explicitly including
the `<string>` header. While older MSVC implicitly included this
header somewhere, the headers for 17.4+ do not leading to a build
error.
2022-11-28 14:30:06 +01:00
198fd56a5e Fix T100883: crash with particle instancing and clumping
Properly initialize clump curve mapping tables for duplis and other cases
where this was missed by making a generic init/free function instead of
duplicating the same logic in multiple places. Also fold lattice deform
init into this.
2022-11-28 14:29:02 +01:00
ee8d32b1d9 Fix T101669: Cycles artifacts in bump map baking
After barycentric convention changes, the differentials used for bump mapping
were wrong leading to artifacts with long thin triangles.
2022-11-28 14:16:57 +01:00
036c60a27d Fix: Spline Parameter node produces NaN when curve is a single point
Issue found in file from T101256.
2022-11-28 14:15:15 +01:00
7a21a49ac5 Fix T102312: anchored brush texture overlay draws in wrong place
Rotation and scale was done around the wrong center (always around mouse
position) in paint_draw_tex_overlay [on the other hand,
paint_draw_cursor_overlay already got the center right].

Now make the center dependent on UnifiedPaintSettings "draw_anchored".

Maniphest Tasks: T102312

Differential Revision: https://developer.blender.org/D16418
2022-11-28 14:11:03 +01:00
19a13a8b8b Fix T85870: ColorRamp Keyframes crash Blender
The color-band needs to do some special, rather awkward updating of the
UI state when certain values are changed. As @lichtwerk noted in the
report, this was done to the wrong buttons. Now lookup the proper
buttons, and don't assume that `uiItemR()` only adds a single button
(which often isn't the case).
2022-11-28 14:09:06 +01:00
1fd35126c4 Fix File Browser Move Bookmark malfunction if no item is selected
The operator was acting on non selected items (wasnt checking SpaceFile
bookmarknr for being -1) which could end up removing items even.

Now sanatize this by introducing proper poll (which returns false if
nothing is selected).

Fixes T102014.

Maniphest Tasks: T102014

Differential Revision: https://developer.blender.org/D16385
2022-11-28 14:08:10 +01:00
af7dd99588 Fix T102018: find HIP library also in system library paths on Linux
Previously it would use a hardcoded location where the AMD driver installs it,
but Linux distributions may use other locations. Now look for both cases.
2022-11-28 14:06:59 +01:00
6810deb521 Fix T101062: sculpt curves crash using a paintcurve brush
For one, paintcurves were not considered in curves sculpt mode at all
(so you couldnt draw them). This is now enabled.

And the second issue was that since curves sculpt mode uses the reguar
paint_stroke_modal() [which handles paintcurves], this was actually
excuted, freeing the PaintStroke from SculptCurvesBrushStrokeData (but
not the CurvesSculptStrokeOperation) and immediately return
OPERATOR_FINISHED from modal (resulting in a double MEM_delete of
SculptCurvesBrushStrokeData -- in both invoke and modal).

There might be better ways to handle the memory free, for now the double
freeing is prevented by setting the operator customdata to NULL (and
check for that later).

Maniphest Tasks: T101062

Differential Revision: https://developer.blender.org/D16099
2022-11-28 14:05:47 +01:00
9676cb6d8d Fix T102092: GPencil Sculpt Grab crash using Shift key
There was a problem with the hash table that was 
not created as expected.

Also fixed an unreported memory leak in Grab tool not
related to this crash but detected during debug.
2022-11-28 13:56:56 +01:00
b43cfae49c Fix T102045: Properties Editor Attribute panels errors when pinning mesh
When pinning a Mesh, we cannot rely on the context object.
Instead, use the context mesh now.
For vertexgroups names [which are still on the object API wise], this
means name collisions cannot be checked when pinning a Mesh (so print
this as a warning in that case)

Maniphest Tasks: T102045

Differential Revision: https://developer.blender.org/D16333
2022-11-28 13:38:09 +01:00
7ce6750234 Fix: set more UI colors to PROP_COLOR_GAMMA
Followup to rBfb424db2b7bb. Found some more candidates.

UI colors should use PROP_COLOR_GAMMA to avoid being affected by scene
color management (clarification by @brecht).

Differential Revision: https://developer.blender.org/D16337
2022-11-28 13:35:11 +01:00
d2b74943ce Fix T99603: node body colors colormanagement issue
This led to the color actually looking different on the node body itself
vs. in the panel, also using the colorpicker gave unexpected results.

UI colors should use PROP_COLOR_GAMMA to avoid being affected by scene
color management (clarification by @brecht).

Maniphest Tasks: T99603

Differential Revision: https://developer.blender.org/D16334
2022-11-28 13:31:42 +01:00
c5ec667b69 Fix T101933: pick deselecting bones in empty space deactivates armature
As a consequence of this, subsequent box-selection of bones would not
show correctly in Animation Editors (not showing the channels there
because of the lack of an active object).

The bug was caused by rBba6d59a85a38.
Prior to said commit, code logic was relying on the check for `basact`
being NULL to determine if object selection changes need to happen.
After that commit, this was handled by a `handled` variable, but this
was not set correctly if `basact` is actually NULL after the initial
pick (aka deselection by picking).

Maniphest Tasks: T101933

Differential Revision: https://developer.blender.org/D16326
2022-11-28 13:30:44 +01:00
a49a960a58 Fix T101946: Outliner data-block counter treats bones as collection
Mistake in own rBb6a35a8153c3 which caused code to always recurse into
bone hierarchies (no matter which collapsed level an armature was
found).
This led to bone counts always being displayed even outside a collapsed
armature (e.g. if an armature was somewhere down a object or collection,
the collapsed object or collection would show this bonecount).
This is inconsistent with other data counting in the Outliner, e.g.
vertexgroups or bonegroups do have their indicator at object level,
however the counter only shows if `Vertex Groups` or `Bone Groups` line
shows (so if the object is not collapsed).

And this also led to the bug reported in T101946 which was that the bone
counts would be treated as collections when further down a collapsed
hierarchy.
Background: The whole concept of `MergedIconRow` is based on the concept
of counting **objects types or collectinons/groups**. If other things
like overrides, vertexgroups or bonegroups are displayed in a counted/
merged manner, then these will always be counted in the array spots that
are usually reserved for groups/collections. But for things this is not
a problem (since these are only displayed below their respective
outliner entry -- and will never be reached otherwise).

So to correct all this, we now only recurse into a bone hierarchy if a
bone is at the "root-level" of a collapsed subtree (direct child of the
collapsed element to merge into).

NOTE: there are certainly other candidates for counted/merged display
further up the hierarchy (not just bones -- constraints come to my mind
here, but that is for another commit)

Maniphest Tasks: T101946

Differential Revision: https://developer.blender.org/D16319
2022-11-28 13:21:47 +01:00
90055a1f2c Fix T101329: EXR 'JPG Preview' doesn't use color space anymore
For the JPG preview, the only thing that was changed in the image
format was the format itself. However, the colorspace code now also
checks the bitdepth through BKE_image_format_is_byte, so the depth
needs to be explicitly set to 8-bit for the JPG preview output.
2022-11-28 13:00:31 +01:00
0c3a52d571 Fix (studio-reported) issue with overrides on library relocating.
Liboverrides that were using a missing linked reference ID would not get
their 'MISSING' tag properly cleared afer relocating, in case their
linked reference is no more missing.

Reported by Andy (@eyecandy) from Blender studio.
2022-11-28 12:47:30 +01:00
f07f55582a GPencil: Fix compiler warning
The variable can never be NULL and the comparison was wrong.
2022-11-28 12:41:30 +01:00
be38344de0 Fix T101896 Eevee: Custom object properties don't work in shader for Curves objects
Move the material resources binding inside the
`DRW_shgroup_curves_create_sub` so that `DRW_shgroup_call_no_cull`
extracts the attributes.
2022-11-28 12:33:57 +01:00
d5acb2b2fe Fix T94136: Cycles: No Hair Shadows with Transparent BSDF 2022-11-28 12:29:03 +01:00
832157cb02 Fix T101928: transform operator properties saving wrong snap values
The check for the flags should be `== 0` since they are describing a
negative state.

Thanks to @lone_noel for pointing out the error.
2022-11-28 12:27:47 +01:00
2124bfb211 Windows: Run blender-launcher.exe instead of blender.exe
With this change Blender, delivered via the Microsoft store, will launch without the console window flashing.

Ref T88613

Differential Revision: https://developer.blender.org/D16589
2022-11-24 15:33:03 +01:00
b7b9e670ce Fix T101020: Cycles Add Performance Preset is broken 2022-11-24 10:19:26 +01:00
15b2b53b87 Fix T92416: First render with unknown image colorspace looks different
The issue here was that the Barbershop benchmark scene was saved with a
custom OCIO config, which leads to some textures having a unknown
colorspace when loading with a default installation.

This is automatically fixed by Blender during image loading, but since
Cycles queried the colorspace before actually loading the image, it
didn't get the updated value in the first render.

To fix this, just re-query the colorspace after the image is loaded.

Note that non-packed images still get treated as raw data if the
colorspace is unknown, but this is at least consistent and doesn't
magically change when you press F12 a second time.

Differential Revision: https://developer.blender.org/D16427
2022-11-17 16:31:41 +01:00
5bbef85bc8 Fix T102577: make update issues with python x86_64 running on macOS Arm
Still default to arm64 libraries in that case.
2022-11-17 14:08:10 +01:00
Harley Acheson
19202736d5 Fix T99872: Crash Loading Embedded Fonts - 3.3
Ensure kerning cache exists when loading embedded fonts

---

When loading embedded fonts from memory the font->kerning_cache is not
created and so we get a crash if the font does support kerning.
This was not caught because the loading of packed fonts was not
actually doing anything in VSE until {523bc981cfee}.

We have since consolidated `blf_font_new` and `blf_font_new_from_mem`
into a single function so that they cannot get out of sync like this
any more.  So this fix is specific to Blender 3.3.  But we can add this
as a candidate for corrective release 3.2.3

Reviewed By: brecht

Maniphest Tasks: T99872

Differential Revision: https://developer.blender.org/D15704
2022-11-09 09:41:57 +01:00
e86b5230ca cmake/windows: Prepare for 3.4 library changes for opencollada
The opencollada dependency will be using an external xml2 library
for 3.4. This change allows to build against both old and new
style lib folders.

As it is a C library it did not need a special debug version.
2022-11-03 16:09:33 +01:00
953eda6bfd Build: bump expat version to 2.5.0 to address CVE-2022-43680 2022-11-02 14:57:15 +01:00
49b7a7efca Build: ignore more CVEs from tiff command line tools that we don't use 2022-11-02 14:57:15 +01:00
05d09dcb81 Build: fix/workaround for the opencollada.diff not applying on Linux 2022-11-02 14:57:15 +01:00
c76c8ee3a0 deps_builder: OpenCollada fixes for windows
- build and use our version of libxml

- the cli tools had a linker error due
to it trying to link a shared version
of libxml, disabled both and zlib 1.2.3
with a patch since we do not want/need
them for blender.

- postfix the libraries with _d for debug
automatically so we don't have to fix that
during the harvest.

due to this only being windows changes no
rebuild needed for the other platforms.
2022-11-02 14:57:15 +01:00
f6294c437f deps_builder: fix missing png harvest on windows 2022-11-02 14:57:15 +01:00
da0d699d92 Build: mark remaining CVEs reported by cve_check as mitigated or ignored
After the last library update cve_check still reported some false positives.
One GMP issues was mitigated with a patch in the library update. The others
are ignored, with a description explaining why they do not affect Blender.

Ref D16269, T101403
2022-11-02 14:57:15 +01:00
2fb0640740 Build: update various libraries for 3.4, fixing bugs and security issues
THis is bumping dependencies to fix known CVEs, with the exception of
OpenImageIO which also includes bugfixes for performance and correctness
with some image types.

zlib 1.2.12 -> 1.2.13
freetype 2.11.1 -> 2.12.1
openimageio 2.3.13.0 -> 2.3.20.0
python 3.10.2 -> 3.10.8
openjpeg 2.4.0 -> 2.5.0
ffmpeg 5.0 -> 5.1.2
sndfile 1.0.28 -> 1.1.0
xml2 2.9.10 -> 2.10.3
expat 2.4.4 -> 2.4.9
openssl 1.1.1g/i -> 1.1.1q
sqlite 3.31.1 -> 3.37.2

Notable changes:
* AOM: the hack we had in place to make it not detect pthreads on windows no
  longer worked with a more recent cmake version. Disabled pthreads with a
  diff on Windows.
* Python: embedded copy of zlib 2.1.12 swapped out for our 2.1.13 copy with
  some folder manipulation on Windows.
* Freetype: was harbouring a copy of zlib 2.1.12 as well, so that had to end.
* FFmpeg: patch used to fix D11796 is no longer needed. Add new patch to deal
  with simple_idct.asm generating an object file with no sections in it,
  backport from upstream commit.
* TinyXML: still being downloaded but no longer used by OpenColorIO, removed.
* GMP applied upstream patch to fix CVE-2021-43618, as there is no release yet.
* SQLite and Libsndfile patches no longer needed.

Includes contributes by Ray Molenkamp, Campbell Barton and Brecht Van Lommel.

Ref T101403

Differential Revision: https://developer.blender.org/D16269
2022-11-02 14:57:15 +01:00
20679ca25c Build: get make deps working with Xcode command line tools
Deduplicating code with Xcode detection for Blender builds.
2022-11-02 14:57:15 +01:00
5b27e6f24b deps_builder: harden the package download process
During the 3.3 release some packages were missing
in SVN during the release and it ended up building
the release tarball without issues when re-running
the `make source_archive_complete` command after it
failed initially. The tarball however had 0 byte files
for the missing packages.... not good.

This diff hardens the download process by :

1) Validating all required variables are set. This
catches the erroneously attempt at downloading the
nanovdb package even though we have removed it
from versions.cmake but neglected to remove it
from download.cmake

2) When a download fails (due to either a missing
package, or bad download URL) FILE Download will
warn about a hash mismatch but will carry on
happily, you then have to go into the file system
go delete the 0 byte file to retry the download.
We know for a fact the file is bad when it is 0
bytes, just delete it.

3) When we are using the blender repository
(and likely building a source archive) explicitly
validate the hash of all packages. Normally the
build process does this, however when building
a source archive the build does not actually
run for a dep. So preform this check during the
configuration stage.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D16124
2022-11-02 14:57:15 +01:00
ad6f5117ad Build: add missing include for opencolorio
OpenColorIO failed to build on Linux+GCC-12.2 because of strlen() use.
2022-11-02 14:57:15 +01:00
8daad7dab5 Cleanup: remove unnecessary argument to else() in CMake
We have moved away from duplicating arguments in else() and endif()
commands.
2022-11-02 14:57:15 +01:00
2bdc9908a9 Cleanup: correct indentation of harvest.cmake 2022-11-02 14:57:15 +01:00
2db9bfb6d8 deps_builder: Add support for cve-bin-tool
This change adds support for intels cve-bin-tool [1]
in the deps builder. This adds 2 new targets to the
builder that do not build automatically but can be
build on demand when required.

`make cve_check` will output to the console.
`make cve_check_html` will output a html file that
can be shared with other people.

Requirements:

- A working installation of cve-bin-tool on the system

Not required but higly recommended:

- Obtaining a key from the nvd [2] to speed up the
  database download. you can pass the key to cmake
  using `-DCVE_CHECK_NVD_KEY=your_api_key`

[1] https://github.com/intel/cve-bin-tool
[2] https://nvd.nist.gov/developers/request-an-api-key

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D16160
2022-11-02 14:57:15 +01:00
9f5a2d8788 Fix Cycles build error on 32bit x86 2022-10-31 20:29:50 +01:00
2b2fc6d759 Fix missing OpenMP in Linux builds
OpenSubdiv OpenMP detection was interfering, but we don't use it there
anymore so just remove that code.
2022-10-31 20:29:50 +01:00
2a7b8e78e1 Fix T99997: Calling teleport without waiting for the previous event disables gravity
During teleport event, gravity is disabled and WalkMethod
is stored in `teleport.navigation_mode` which is used later to reset
the status after execution. Calling teleport events consecutively
will change the initial WalkMethod value. So update it only on the
first call. Also remove `else condition` as it stops the previously running
teleport when the new teleport call fails to find a hit point.

Reviewed by: dfelinto, mano-wii

Differential Revision: https://developer.blender.org/D15574
2022-10-26 11:55:23 +02:00
514f4e8b47 Fix T101903: Crash when deleting library in some cases.
Remapping in batch deletion could end up calling viewlayer resync code
on partially invalid BMain (some IDs still in Main using IDs removed
from Main).

Think this code can actually be further optimized, but this fix should
be safe enough for 3.3 (and potentially 2.93).

Thanks to Jeroen (@jbakker) for the initial investigation.
2022-10-26 11:54:20 +02:00
94ec66c2f2 Fix T99565: Cycles reading TGA files with alpha different than Blender
Thanks to Lukas for tracking down the cause in OIIO.
2022-10-26 11:53:29 +02:00
5916e73b28 Fix T100699: Older preferences from 2.93 wont load
Even though this was intentionally removed in [0], loading data from
older startup files is supported. So show them when available.

[0]: 45439dfe4c
2022-10-26 11:52:24 +02:00
30774f01cd Fix T98672: Noise texture shows incorrect behaviour for large scales
This was a floating point precision issue - or, to be more precise,
an issue with how Cycles split floats into the integer and fractional
parts for Perlin noise.
For coordinates below -2^24, the integer could be wrong, leading to
the fractional part being outside of 0-1 range, which breaks all sorts
of other things. 2^24 sounds like a lot, but due to how the detail
octaves work, it's not that hard to reach when combined with a large
scale.

Since this code is originally based on OSL, I checked if they changed
it in the meantime, and sure enough, there's a fix for it:
https://github.com/OpenImageIO/oiio/commit/5c9dc68391e9

So, this basically just ports over that change to Cycles.

The original code mentions being faster, but as pointed out in the
linked commit, the performance impact is actually irrelevant.

I also checked in a simple scene with eight Noise textures at
detail 15 (with >90% of render time being spent on the noise), and
the render time went from 13.06sec to 13.05sec. So, yeah, no issue.
2022-10-26 11:37:45 +02:00
5ff62df238 Cycles: Fix floor intrinsic for ARM Neon 2022-10-26 11:37:12 +02:00
1492f566c8 Fix T99450: Animated Holdout not updating on frame change
Problem here was that layer_collection_objects_sync wasn't called when
the holdout property is updated due to frame change, so the changed
visibility flag was never applied to ob->base_flag.

Turns out there's no real reason to handle the per-object holdout
property through the layer system. So, instead of merging both the
layer holdout and object holdout into base_flag and checking that
from the render engines, only handle the layer holdout (which can't
be animated, so no issue here) through base_flag and explicitly also
check the object holdout in the render engines.
2022-10-26 11:36:02 +02:00
e5af9a12d7 Fix T101262: Crash in spreadsheet selection filter with empty domain
The BMesh selection virtual array was empty. There are a few different
places we could add an "empty" check here, but at the top of the
function is the simplest for now.
2022-10-26 11:19:42 +02:00
9f8ece70ee Fix T101776: wrong logic for GLX setSwapInterval
Regression in 93e4b15767.
2022-10-26 11:14:14 +02:00
bb95609fce Fix T101679: Duplicate objects are created when 'Make' override is called on existing override in 3DView
When the active selected object in the 3DView is already a local
liboverride, only perform the 'clear system flag' process on selected
objects, there is no point in trying to create an override out of it.
2022-10-26 10:50:06 +02:00
0386737097 ImageEngine: Clamp image data to fit half float range.
When image data exceeds half float ranges values are set to +/-
infinity that could lead to artifacts later on in the pipeline.
Color management for example.

This patch adds a utility function `IMB_gpu_clamp_half_float`
that clamps full float values to fit within the range of
half floats.

This fixes T98575 and T101601.
2022-10-26 10:48:47 +02:00
f9c6e0c814 Fix T101709: Proportional editing being disabled in NLA Editor redo panel
Do not save the "use_proportional_edit" property if it is not supported.
This prevents it from being automatically disabled.

And hide "use_proportional_edit" in `SPACE_NLA`
2022-10-26 10:33:11 +02:00
7881a797a0 Fix T101721: Knife project crashes
The crash was caused by [0] however knife-project functionality has been
incorrect since [1] which would loop over each edit-mode object and run
the knife project function which operated on all edit-mode objects too.

- Resolve the crash by postponing face-tessellation recalculation
  until the knife tool has cut all objects

- Objects occluding each other is now supported
  (an old TODO and something that was never supported).

[0]: 690ecaae20
[1]: 6e77afe6ec
2022-10-26 10:31:40 +02:00
07ba515b21 GPencil: Fix unreported Close Stroke operator did not select new points
When use the close stroke, the new created points were not addedd to the
selection.
2022-10-26 10:14:44 +02:00
3d7f298e9a Fix T101651: Cycles crashes when failing to initialize render device
The issue here was that PathTraceWork was set up before checking if
any error occurred, and it didn't account for the dummy device so
it called a non-implemented function.

This fix therefore avoids creating PathTraceWork for dummy devices
and checks for device creation errors earlier in the process.
2022-10-26 10:13:11 +02:00
7e942b2a1e Partially fix T101702: OSL Shaders with boolean inputs crash
OSL (like Cycles) has no internal boolean type, instead an integer
input can be flagged to be shown as a boolean in the UI.
Cycles reacts to this by creating a boolean socket on the Blender
side, but as a result incorrectly called the boolean overload of the
set function even though the internal type is an integer.

There's another unrelated crash in the GPU viewport shader code that
appears to apply to every OSL node that outputs a shader, and the file
in T101702 triggers both, so this is only a partial fix for the report.
2022-10-26 10:11:55 +02:00
e1e9c83889 Fix T101685: OBJ importer does not assign proper material if "usemtl" is before "o"
The importer logic was wrongly resetting "current material name"
upon encountering a new object ("o" command). However as per OBJ
specification, this is incorrect:

> Specifies the material name for the element following it. Once a
> material is assigned, it cannot be turned off; it can only be
> changed.

Fixes T101685. Test coverage for this was added in svn tests repo.
2022-10-26 10:10:49 +02:00
Nate Rupsis
bfc9d7cadf FIX T101275: Regression in NLA causes Actions to be ignored by Context menu (I.e influence, etc)
Reviewed By: sybren

Differential Revision: http://developer.blender.org/D16154
2022-10-26 10:04:42 +02:00
fcc291bbf9 Fix T101025: Cycles motion blur crash with changing point cloud size
Caused by 410a6efb74 which didn't properly use the
smallest size between the Cycles and Blender point clouds.
2022-10-26 09:46:15 +02:00
567e3f6508 Fix T101547: Add update notifiers in dopesheet and timeline selection operators
Updates the function checking if a container can have grease pencil layer keyframes, to account for dopesheet in main mode, and timeline.

Reviewed By: Sybren A. Stüvel

Differential Revision: http://developer.blender.org/D16132
2022-10-26 09:44:09 +02:00
0b45d3e386 Refactor: adding function to check if an animation container has grease pencil layer keyframes.
Used in action_select to refactor the selection operators.

No functional changes.

Reviewed By: Sybren A. Stüvel

Differential Revision: http://developer.blender.org/D16168
2022-10-26 09:42:37 +02:00
6004e9d62b Fix T100953: Zooming with NDOF is inverted in the camera view
Use convention for applying zoom in other 2D views.
2022-10-26 09:40:17 +02:00
c98268d3f5 DRW: fix use of potentially uninitialized variable
Bug introduced in rB6774cae3f25b.

This causes undefined behavior in `DRW_state_draw_support()` making
overlay depth drawing unpredictable.
2022-10-17 16:20:24 +02:00
86f8898ccd Fix T101618: Freeze when reloading a library in certain situation
Freeze happened when reloading a library while having an Object property
with a custom getter function defined in Python.

Just piggybacking on rB62eb21e3ce87, this just applies the same fix (use
the BPy_BEGIN/END_ALLOW_THREADS macros) to relading from RNA/py.

All credit goes to @brecht and @mont29.

Maniphest Tasks: T101618

Differential Revision: https://developer.blender.org/D16167
2022-10-17 16:17:31 +02:00
85fb4708f4 Fix T101492: UV stitch crash (more than 32 objects selected)
Crash happened when adjusting operator props in Adjust Last Operation
panel.

When there are more than 32 objects selected in muti-object-editmode, we
are running into RNA array limit (`objects_selection_count` is defined as
an RNA array (which can only hold 32 entries, see
`RNA_MAX_ARRAY_LENGTH`), leading to reading random memory errors.

While there might be ways to make this work with more than 32 selected
objects (e.g. by instead using a collection, or investigate supporting
dynamic sized arrays for run-time RNA), this patch only cancels the
operator with a report message (instead of crashing).

Maniphest Tasks: T101492

Differential Revision: https://developer.blender.org/D16115
2022-10-17 16:16:32 +02:00
2a78941d2c LineArt: Fix "No intersection" flicker.
The flicker was caused by the failure for checking both triangles for
flags. Now fixed.
2022-10-17 15:55:47 +02:00
8725bb5108 Fix T101517: GPencil strokes snap to origin in a Scale value is on 0
The problem was the conversion to object space converted the
points to zero.

Now, the new function `zero_axis_bias_m4` is used in order to add
a small bias in the inverse matrix and avoid the zero points.

A known math issue is the stroke can be offsetted if the scale is set to 1 
again. In this case apply the scale to reset to 1.

Differential Revision: https://developer.blender.org/D16162
2022-10-17 15:47:01 +02:00
e2beed6ae2 Fix T101591: mathutils.geometry.intersect_line_line 2D vector error
Uninitialized stack memory was used when intersecting 2D vectors.
2022-10-17 15:45:51 +02:00
7e5db850dc New math function to add small bias to zero axis
In some situations the zero axis can produce problems and need to add a small bias.

This function adds a small bias using the orthogonal result of the others valid axis.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D16158
6d
2022-10-17 15:42:38 +02:00
cb2fb570f1 Fix T101405: Deleting a baked action results in an error.
RNA code to create new actions did not properly remove the extra user
set by default, as done in other `new` callbacks of other ID types.

NOTE: Mask ID had the same issue, also fixed in this commit.

NOTE: At some point this needs to be properly fixed, default super-low
level ID creation code should simply not add a 'default' user, this is
extremely bad design and forces higher-level code to do all kind of
extra work to get rid of it half of the time, in very unclear and
confusing ways and places.
2022-10-17 15:21:07 +02:00
a18b8ba1be Fix T101334: Paint Texture Slots appear greyed out
To the user, this looks like a disfunctional thing (usually greying out
is used for props having no effect).

The greying out is caused by
{rB8b7cd1ed2a17e40661101eea4adae99e8e3d02e9}.
Above commit disabled the direct renaming of images in the
`TEXTURE_UL_texpaintslots` UIList (and instead displays the texture slot
directly as a prop -- which has its `PROP_EDITABLE` flag cleared)
(from the commit message):
> A limitation of this patch is that is isn't possible anymore to rename
images directly from
> the selection panel. This is currently allowed in master. But as
CustomDataLayers
> aren't ID fields and not owned by the material supporting this wouldn't
be easy.

To work around the UI confusion (but still keep the non-editable nature
of the property), now just display this as a label.

Maniphest Tasks: T101334

Differential Revision: https://developer.blender.org/D16138
2022-10-17 15:19:25 +02:00
5d820393af Fix T101306: crash when calling Delete command for Library Override
Was not passing user_data to id_override_library_delete_hierarchy_fn.

Also correct a wrong assert.

Greenlit by @mont29 in T101306.
Should also go into 3.3 LTS.
2022-10-17 14:54:38 +02:00
295eb04ba3 Fix T101447: Hold split not working correctly
Caused by incorrect conflict resolution in commit 302b04a5a3.
2022-10-17 14:51:38 +02:00
72a34ab1b9 Fix T100330: Remove Render Slot not working for first slot
This bug was caused by the weird ownership logic for render results.
Basically, the most recent render result is owned by the Render, while
all others are owned by the RenderSlots.
When a new render is started, the previous Render is handed over to its
slot, and the new slot is cleared. So far, so good.

However, when a slot is removed and happens to be the one with the most
recent render, this causes a complication.
The code handles this by making another slot the most recent one, along
with moving its result back to the Render, as if that had always been
the most recent one.

That works, unless there is no most recent render because you haven't
rendered anything yet. Unfortunately, there is no way to store "there
hasn't been a render yet", so the code still tries to perform this
handover but can't.
Previously, the code handled that case by just refusing to delete the
slot. However, this blocks users from deleting this slot.

But of course, if there hasn't been a render yet, the slots will not
contain anything yet, so this entire maneuver is pointless.
Therefore, the fix for the bug is to just skip it altogether if there
is no Render instead of failing the operation.

Technically, there is a weird corner case remaining, because Renders
are per-scene. Therefore, if a user renders images in one scene,
switches to a different scene, deletes a slot there and then switches
back, in some situations the result in the deleted slot might end up
in the next slot.
Unfortunately this is just a limitation of the weird split ownership
logic and can't just be worked around. The proper fix for this
probably would be to hand over ownership of the result from the Render
to the RenderSlot once the render is done, but this is quite complex.

Also fixes a crash when iuser->scene is NULL.
2022-10-17 14:40:58 +02:00
197f3d75d1 Fix T101499: Do not allow unlinking objects from linked collections. 2022-10-17 14:38:08 +02:00
8f8eac78cf Bump version cycle for Blender 3.3.2 candidate 2022-10-17 14:13:00 +02:00
b292cfe5a9 Bump version cycle for Blender 3.3.1 release. 2022-10-04 20:35:22 +02:00
28e09980a2 Fix T101233: Crash on deleting the object in outliner due to null pointer access
After rB188f7585a183 deleting the object results in crash due
to null pointer access if collections are filtered out

Reviewed by: mont29

Differential Revision: https://developer.blender.org/D16031
2022-10-04 20:21:56 +02:00
5a1ef2dc78 Fix T101510: Incorrect context for running data unlink from template ID
There was already a fix for this, but it got broken again with c973d333da.
2022-10-04 20:17:18 +02:00
2653775c66 Cycles: Disable binary archives on macOS < 13.0
(Cherry pick D16082)
An bug with binary archives was fixed in macOS 13.0 which stops some spurious kernel recompilations. In older macOS versions, falling back on the system shader cache will prevent recompilations in most instances (this is the same behaviour as in Blender 3.1.x and 3.2.x).

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D16141
2022-10-04 19:09:29 +01:00
8d97ecde02 Fix T101559: Rain Test Animation demo crashes Blender 3.3
Update to liboverride creation code to add support of keeping active
object forgot to consider case when there is no known/given view layer.

NOTE: similar fix to rBc3003b4346fd5c5 in master.
2022-10-04 11:05:38 +02:00
fb499916bb Fix T101564: GPencil: Selecting imprecise if transforms are animated
The check was doing with the original point and
must be the evaluated point.
2022-10-03 13:17:35 +02:00
1bdb5542ff Fix T101548: GPencil new lines in Multiframe editing appear as Onion
The problem was the eval data update only occurs for the 
actual frame and in this case must be for all frames.
2022-10-03 13:14:00 +02:00
3f30c1c042 Fix T101487: New OBJ importer handles UVs incorrectly when some faces of an object don't have UVs
The UV data filling logic was incorrectly just skipping over loop
entries that don't have a UV coordinate, instead of assigning
the default zero UV for them. This was a problem only for meshes
where some faces did have UVs, but some other faces did not (T101487).
2022-10-03 13:13:09 +02:00
86538e31f5 Scew Modifier: Remove eager normal calculation
The screw modifier calculated normals eagerly (whether or not the
next modifier actually used them). However, this was incorrect and
set invalid normals. It isn't necessary because they can be calculated
later anyway. The potential performance improvement isn't worth the
complexity or maintenance burden.

Fixes T101075

Differential Revision: https://developer.blender.org/D16073
2022-10-03 13:12:13 +02:00
25cc656003 Fix: Order of node mixins in custom nodes python template
See T101259. This order makes the poll not work, even when called from
Python. The bundled template shouldn't be a source of errors for node
addons.
2022-10-03 13:01:46 +02:00
cc8df686ad Fix missing Outliner updates when adding nodetrees
When e.g. grouping nodes into nodegroups, these would not show up
immediately in the Outliner (Blender File / Data API view).

Now send (unique combination, not used elsewhere) notifiers (and listen
for these in the Outliner).

Differential Revision: https://developer.blender.org/D16093
2022-09-30 15:03:01 +02:00
5041666321 Fix T101341: make nodegroups active input/output non-animatable
Active UI list index is usually not animatable.
Here specifically, the active list index is oly used for operators acting
on a specific (active) socket.

Note other props here were already made non-animatable in
rB1d3b92bdeabc.

Maniphest Tasks: T101341

Differential Revision: https://developer.blender.org/D16077
2022-09-30 15:02:36 +02:00
93bbaad2f8 Fix T101347: Curve draw fails to project to cursor depth in ortho views
ED_view3d_win_to_3d_on_plane with do_clip enabled wasn't working in
non-camera orthographic views as it didn't take into account the ray
origin being centered to the view.

Resolve by testing viewport clipping after the ray has been projected.
2022-09-30 15:01:43 +02:00
662ba67210 GPencil: Fix unreported memory leak in Fill inverse
There was a memory leak when use inverted fill.
2022-09-30 14:51:14 +02:00
Germano Cavalcante
6c3364052b Fix T101231: Console flooded with warnings when fluid type is Domain
Although rB67e23b4b2967 turned the problem more recurrent, the warning
messages in the console always appear when `BKE_fluid_cache_free_all`
is called.

This is because of a bug in `BLI_filelist_dir_contents` as this function
calls `BLI_strdupcat` instead of `BLI_join_dirfile`

NOTE: Other places in Blender avoid this problem by making sure to add
a `SEP_STR` to the end of the directory.

Differential Revision: https://developer.blender.org/D16043
2022-09-30 14:50:28 +02:00
24814a03b7 Fix: GPencil animated layer transforms evaluate wrong when identity
Due to (optimization) checks in in `BKE_gpencil_prepare_eval_data` &
`BKE_gpencil_update_layer_transforms`, updates were skipped if animation
reached exact identity transforms.

Now check if the matrix has changed additionally to gain proper updates.
Unsure if this is the cheapest way to check for the animated state of
layer transforms tbh, but I see similar checks elsewhere.

Fixes T101164.

Maniphest Tasks: T101164

Differential Revision: https://developer.blender.org/D16018
2022-09-30 14:49:28 +02:00
ede6c26222 Fix curves sculpting in deformed space when using Subdivide node
Needs a call to remember_deformed_curve_positions_if_necessary, missed
in rB1f94b56d7744.

Thx @JacquesLucke for the solution!

Differential Revision: https://developer.blender.org/D16078
2022-09-30 14:44:28 +02:00
b4e8d03e5c Fix typo and and incorrect property initialization
Error in rB236fda7faf58
2022-09-30 14:43:47 +02:00
1c8374978d Fix T101343: useless Snapping menu in transform operators
Changes:
- Use the "snap_elements" property only for operators that support snapping to geometry.
- Remove unused properties:
  - "use_snap_to_same_target",
  - "snap_face_nearest_steps").
- Fix property with wrong name "use_snap_selectable_only" -> "use_snap_selectable"
- Fix use of dependent property flags.
- Remove redundant initialization of variables
- Simplify `poll_propety`. Only the "use_snap_project" is not hidden.

>>! In rBc484599687ba it's said:
>  These options are needed for Python tools to control snapping without requiring the tool settings to be adjusted.
If that's the case, there doesn't seem to be any need to display them in the redo panel.  Therefore:
- Hide snapping properties in redo panel.

Many properties have been added that can be independent of ToolSettings. Therefore:
- Save snapping properties in the operator itself. For Redo.
2022-09-30 14:43:04 +02:00
a6c27ea49d Cycles: increase min-supported driver version for Intel GPUs
Windows drivers 101.3430 fix an important GUI-related crash and it's
best to prevent users from running into it.
Linux drivers weren't affected but still had relevant gpu binary
compatibility fixes, so it makes sense to keep the min-supported version
aligned across OSes.
2022-09-30 14:42:09 +02:00
b266eedb24 Fix T101370: GPencil Grab Sculpt crash after bake transform animation
The problem was the duplicated strokes had wrong pointers 
to the original stroke.
2022-09-30 14:36:15 +02:00
803d9f9748 Fix T101317: GPencil separate Active layer freezes blender
The error occurs only when the layer is empty.
2022-09-30 14:35:34 +02:00
740b501d8b Fix T101109: Animation on nodes problems when dealing with Node Groups
Whenever animation on nodes was transfered to/from nodegroups (grouping/
ungrouping/separating) via BKE_animdata_transfer_by_basepath, it was
possible to create new nodes with the same name (in the formerly same
path -- see report for an example of this) and animation from the
original node was still performed on them. Issue went away after save/
reload.

In order to fully update the action, a depsgraph is now performed on the
action (similar to what is done when renaming for example).

Maniphest Tasks: T101109

Differential Revision: https://developer.blender.org/D15987
2022-09-30 14:34:52 +02:00
0ecc1d788c Fix T101046: missing DEG update changing bone layers in editmode
Following {T54811} (and {rBbb92edd1c802}), DEG updates have been added
to the various operators. This has also been done for the layers
operators (see {rBf998bad211ae}, `ARMATURE_OT_bone_layers` has been
marked done in T54811). However, instead of `ARMATURE_OT_bone_layers`,
the update tagging actually happened for `POSE_OT_bone_layers`.

Now do this for `ARMATURE_OT_bone_layers` as well (keep it for
`POSE_OT_bone_layers`, dont think this is wrong there either).

Maniphest Tasks: T101046

Differential Revision: https://developer.blender.org/D15969
2022-09-30 14:33:45 +02:00
4b0243dae4 Fix T100141: Header Alignment of New Editors
Revert part of [0] which changed logic for scaling 2D regions
when the window resize. This re-introduces T72392 which can be
fixed separately.

[0]: 6243972319
2022-09-30 14:32:49 +02:00
5faaaf0982 Fix EEVEE: Screen Space Refraction Artefacts caused by viewport aspect ratio
This was caused by the vertical/horizontal clasification being done in
NDC space which wasn't respecting the Aspect ratio.

Multiplying the test vector by the target size fixes the issue.
2022-09-30 14:31:35 +02:00
aa7449e691 Fix T101138: remove console spam when hovering over toolbar in uv editor
Reviewers: Campbell Barton <ideasman42>, Ryan Inch <Imaginer>

Differential Revision: https://developer.blender.org/D16015
2022-09-30 14:30:14 +02:00
753dea79a3 UI: add preference to disable touchpad multitouch gestures
Available on Windows and macOS, where such gestures are supported.
For Windows, disabling this option restores touchpad behavior to
match Blender 3.2.

Ref T97925

Differential Revision: https://developer.blender.org/D16005
2022-09-26 23:04:41 +02:00
6012deddfe Fix T101365: saving second view layer as (non-Multilayer) OpenEXR does not work 2022-09-26 22:33:01 +02:00
cc1105f01b Fix T101354: Cycles crash with baking and adaptive sampling 2022-09-26 22:19:01 +02:00
58e78c1ffe Fix T101298: Blender 3.3.1 crash on macOS due to merge error
Blender 3.3 is still using GLEW and needs this initialization.
2022-09-23 17:55:31 +02:00
81ec5ec366 Fix T100899: Drag and Drop failing depending on window position
Regression introduced in rBbbf87c4f7509, which now relies on OS coordinates for Drag and Drop.

These coordinates did not match on different OSs.
2022-09-22 09:19:23 +02:00
07b547ef96 Fix T100797: C++ exporters do not remember the path on subsequent exports
Most/all C++ based IO code had a pattern of doing using
RNA_struct_property_is_set to check whether a default path needs to
be set. However, it returns false for properties restored from
"previous operator settings" (property restoration code sets
IDP_FLAG_GHOST flag on them, which "is set" sees and goes
"nope, not set").

The fix here is to apply similar logic as 10 years ago in the
T32855 fix (rBdb250a4): use RNA_struct_property_is_set_ex instead.

Reviewed By: Campbell Barton
Differential Revision: https://developer.blender.org/D15904
2022-09-22 09:15:46 +02:00
345cdf71e9 GPencil: Allow import several SVG at time
For SVG is very convenient to be able to import several SVG in one operation. Each SVG is imported as a new Grease Pencil object.

Also, now the SVG file name is used as Object name.

Important: As all SVG imported are converted to Grease Pencil object in the same location of the 3D cursor, the SVG imported are not moved and the result may require a manual fix of location. The same is applied for depth order, the files are imported in alphabetic order according to the File list.

Reviewed By: mendio, pepeland

Differential Revision: https://developer.blender.org/D14865
2022-09-22 09:14:58 +02:00
dba599c806 obj: support importing multiple files at once
Implemented the same way as STL or GPencil SVG importers: loop over
the input files, import one by one.

Has been requested by the community for quite a long time
(e.g. https://blender.community/c/rightclickselect/Jhbbbc/), as well
as 3rd party addons to implement just this
(https://github.com/p2or/blender-batch-import-wavefront-obj).
2022-09-22 09:13:39 +02:00
243e28b73b PyAPI: Support Python 3.9 (for VFX platform support)
Support Python 3.9, part of VFX platform support.

The intention of restoring Python 3.9 support is so it's possible to
build a (mostly) VFX compatible version of Blender, not to provide
official builds on the buildbot.

Includes contribution by Brecht.

Reviewed By: brecht

Ref D16030
2022-09-22 13:41:00 +10:00
Alaska
a920f32ccd Add oneAPI to the 'cycles_device' command line argument help text
Differential Revision: https://developer.blender.org/D16027
2022-09-21 16:39:49 +02:00
609422c0a1 Fix T100833: Cycles UDIM baking broken after recent changes 2022-09-21 16:27:25 +02:00
03fbfb3092 Fix part of T100626: Cycles not using tiles for baking
Leading to excessive memory usage compared to Blender 2.93. There's still
some avoidable memory usage remaining, due to the full float buffer in the
new image editor drawing and not loading the cached EXR from disk in tiles.

Main difficulty was handling multi-image baking and disk caches, which is
solved by associating a unique layer name with each image so it can be
matched when reading back the image from the disk.

Also some minor header changes to be able to use RE_MAXNAME in RE_bake.h.
2022-09-21 16:27:05 +02:00
5fddc4a3b1 Fix T101065: wrong denoising depth after ray precision improvements 2022-09-21 16:25:10 +02:00
cab2ca7a24 Fix macOS build error due to merge issue 2022-09-21 16:21:24 +02:00
fe15766f46 GPencil: Add frame number to Trace operator
The default trace can only trace an image or a sequence, but
it was not possible to trace only selected frames in a sequence. 
This new parameter allows to define what frame trace.

If the value is 0, the trace is done as before.

The parameter is not exposed in the UI because this is logic
if it is managed by a python API, but it has no sense in the UI.

This feature was included after receiving feedback from Studios
which need to trace videos only for some frames using custom
python scripts.
2022-09-21 13:01:04 +02:00
3a880b820b Fix T101001: crash setting texture node active in certain cases
Code from {rBb0cb0a785475} assumed a texture node `node->id` would
always be an image.
That is not true though:
 - could be an object (as reported here with the Point Density node)
 - could be a textblock (as in the IES Texture node)

Acting on these would crash when doing `BKE_image_signal` on them.

Now check node id is an image and do nothing otherwise.
Also check if an image is actually set in these nodes (if none is, the
Image Editor is now also untouched, previously the image in the Image
Editor was "cleared" here [set to NULL] -- which does not seems very
beneficial)

Maniphest Tasks: T101001

Differential Revision: https://developer.blender.org/D15943
2022-09-21 12:59:40 +02:00
Wannes Malfait
9b591a104b Fix T101137: Crash with Transform Node
In `BKE_mesh_tag_coords_changed_uniformly` the checks for dirty vertex
and dirty poly normals were swapped around, causing an assert to be
triggered.

Differential Revision: https://developer.blender.org/D16002
2022-09-21 12:54:17 +02:00
55177b40f3 Fix T100998: Speed effect not rendering scene strip subframes
After change in 19bff8eb51, subframe must be calculated for function
`RE_RenderFrame` in order to render subframes.
2022-09-21 12:53:35 +02:00
c1f2cd4871 LineArt: Force intersection option.
This option allows easier setup of intersection overrides on more
complex scene structures. Setting force intersection would allow objects
to always produce intersection lines even against no-intersection ones.

Reviewed By: Aleš Jelovčan (frogstomp) Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D15978
2022-09-21 12:52:57 +02:00
41527ea89c Fix T101098: Moving meta strip can change its length
Caused by clamping handle translation to strip bounds in functions
`SEQ_time_*_handle_frame_set()` to prevent strip ending in invalid
state. Issue happens when meta strip is moved so quickly, such that
immediate offset is greater than strip length.

Currently meta strip bounds are updated when any contained strip changes
its position, but this update always preserves meta strip position.
Transforming meta strip is not possible directly and all contained
strips are moved instead. Therefore this is 2-step process and fix needs
to be applied on update function and on translation function.

Inline offset handling without clamping in function
`SEQ_time_update_meta_strip_range()`.
Add new function `seq_time_translate_handles()` to move both handles at
once in `SEQ_transform_translate_sequence()`.
2022-09-21 12:52:12 +02:00
b50c1ca8fe Fix 101000: color picker colors drift above 1 for some OCIO configurations
Increase threshold to avoid float precision issues.
2022-09-21 12:51:27 +02:00
Germano Cavalcante
52f7d4bbab Fix T101040: Blender Crashes When snap roll a bone in armature
The modes that don't support individual projection shouldn't support
FACE_NEAREST either.

Differential Revision: https://developer.blender.org/D15970
2022-09-21 12:49:04 +02:00
2a43bb5ed7 Sculpt: Fix T100941: Draw cache invalidation loop
PBVH draw was invalidating the draw cache even
when disabled (e.g. if modifiers exist).
2022-09-21 12:40:57 +02:00
440c29f65b Fix T100771: Incorrect strip length when timecodes are used
Some files have 2 different framerates stored in metadata. Use function
`av_guess_frame_rate` to get media FPS, because it provides more
consistent / correct values across multiple files.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D15839
2022-09-21 12:40:01 +02:00
42937493d8 Fix T100886: error saving side-by-side stereo EXR image of depth pass
The stereo saving code that combines two image buffers into one did not work
correctly when the number of channels is not equal to 4.
2022-09-21 12:34:21 +02:00
6143b3ab38 Fix compilation on Linux, glibc 2.34, and CentOS libraries
A continuation of previous fix for malloc hooks which got removed
from the new glibc library.

The pre-compiled jemalloc has definitions which interpose hooks
in glibc leading to linking errors with multiple hook definitions.

A simple fix is to skip doing the workaround when using jemalloc
from pre-compiled libraries.

This will likely be revisited in the future, but for now it is
important to fix compilation errors for developers.
2022-09-21 12:33:07 +02:00
ec2938c71a Cleanup: quiet missing-variable-declarations warning 2022-09-21 12:32:13 +02:00
bf6a9d705f GLibC Compat: Add deprecated memory hooks symbols removed from 2.34.
Starting from GLibC 2.34, deprecated `__malloc_hook` & co. have been
removed from headers, while still present in the shared library itself.

This means that it is no more possible to build Blender with USD 22.03
on recent linux systems.

While USD 22.08 has a fix to this issue, it is unlikely to be upgraded
for Blender 3.4, and definitely not for Blender 3.3.

This commit ensures Blender can build with USD 22.03 and glibc >= 2.34.

Ref.: T99618,
https://devtalk.blender.org/t/building-blender-on-linux-using-glibc-2-34-raises-linking-errors-from-the-usd-library/24185

Patch by @brecht, many thanks.
2022-09-21 12:29:13 +02:00
22c73b36af Fix T100999: GPencil Copy paste stroke(s) does not respect autokeying
The operator was not checking the status of the 
Autokey button.
2022-09-21 12:24:28 +02:00
0a3b6b134c Fix T100851: Sync markers does not work for numinput
special_aftertrans_update would always use TransInfo values (not
the values_final -- we need the final values to follow numinput, snapping,
etc).

Maniphest Tasks: T100851

Differential Revision: https://developer.blender.org/D15893
2022-09-21 12:23:44 +02:00
568265964e Fix: link drag search feature only works forgeometry nodes groups
The node tree used to detect if the tree was a node group wasn't the
last in the node editor's path like it should be, so the search thought
that all shader node groups weren't node groups.
2022-09-21 12:22:47 +02:00
faccd88038 Fix T100887: Some C++ importers/exporters (e.g. OBJ) reset file dialog Sort By mode
A couple years ago D8598 made it so that C++ operators generally
should use "default" sort mode, which remembers previously used sort
setting. Back then all the places that needed it got changed to use
this "default" one, but since then some more IO code landed, where
seemingly by accident it used "sort by file name":

- USD importer,
- Grease Pencil exporter,
- OBJ importer & exporter,
- STL importer.

Reviewed By: Julian Eisel
Differential Revision: https://developer.blender.org/D15906
2022-09-21 12:21:44 +02:00
761da576b0 Fix T96297: obj: improve layout of UI fields and axis validation
Implement ideas from T96297:
- Fix "invalid axis settings" (both forward & up along the same
  direction) validation: now similar to the Python based code, when
  invalid axis is applied, the other axis is changed to not conflict.
- Make axis enums be expanded inside the row, similar to Collada UI.
- Move "selected only" near the top, similar to how it's in Collada,
  USD, FBX and glTF export UIs.
- Move animation export options to the bottom.
2022-09-21 12:20:31 +02:00
6133434478 Fix T100669: OBJ exporter does not properly export image sequence texture names
When exporting OBJ/MTL animation, texture file paths of image
sequences were not adjusted to contain the correct frame number.
Fixes T100669.

Also, the OBJ exporter was wrongly writing to the same .mtl file
for each exported frame, which is a regression compared to the
legacy Python exporter.
2022-09-21 12:16:11 +02:00
bcdb90b961 Fix: Spreadsheet row filters unimplemented for boolean type
This was lost in 474adc6f88
2022-09-21 12:00:36 +02:00
c25181be4d UI: Add shift-click hint to library overrides button tooltip
This information was missing and made the feature hard to discover.
2022-09-21 11:59:42 +02:00
Sonny Campbell
8004214356 Fix T99141: Crash with edit mode and copy location constraint
The constraint attempted to access mesh normals on a mesh with
wrapper type ME_WRAPPER_TYPE_BMESH. This commit reverses the if
statements so that If there is an editmesh then we use that as the
source of truth - otherwise use the evaluated mesh.

Differential Revision: https://developer.blender.org/D15809
2022-09-21 11:58:06 +02:00
5e372fca7c EEVEE: Fix attributes node on Alpha Clip/Hashed materials
This was cause by a missing implementation of some post
processing attribute functions. Leading to unresolved reference.
2022-09-21 11:56:07 +02:00
Jason Fielder
c0640ddff9 MacOS: Resolve purple rendering artifacts in EEVEE materials by increasing sampler limit.
Enables a feature flag during OpenGL device initialisation on macOS, which increases the available number of texture samplers available for use within shaders. Enabling this flag removes purple rendering artifacts present in certain EEVEE materials, when the existing limit of 16 is exceeded.

This feature flag is supported on Apple Silicon and AMD GPUs, for devices supporting macOS 11.0+. Device initialisation first tests whether GL device creation with the flag is supported, if not, we fall back to standard initialisation.

Other solutions would not be trivial or incur additional performance overhead or feature limitations. Other workarounds, such as texture atlas's, could already be created by artists.

{F13245498}

{F13245497}

Reviewed By: jbakker

Maniphest Tasks: T57759, T63935

Differential Revision: https://developer.blender.org/D15336
2022-09-21 11:49:02 +02:00
50069fb2a1 Fix T100708: Cycles bake of diffuse/glossy color not outputting alpha 2022-09-21 11:32:49 +02:00
765f987fee Fix: Build error in Cycles with OpenVDB turned off 2022-09-21 11:13:25 +02:00
b5ff47667d Fix T100714: Cycles volume render artifacts with negative value grids
The volume bounds were not constructed correctly in this case.
2022-09-21 11:12:48 +02:00
40194f7219 Tweak cryptomatte channels naming to improve interoperability
Use lowercase rgba channel names which still by-passes lossy nature
of DWA compression and which also keeps external compositing tools
happy.

Thanks Steffen Dünner for testing this patch!

Differential Revision: https://developer.blender.org/D15834
2022-09-21 11:09:47 +02:00
cb9b6cefb3 Fix cryptomatte passes saved lossy into multilayer EXR
The DWA compression code in OpenEXR has hardcoded rules which decides
which channels are lossy or lossless. There is no control over these
rules via API.

This change makes it so channel names of xyzw is used for cryptomatte
passes in Cycles. This works around the hardcoded rules in the DWA code
making it so lossless compression is used. It is important to use lower
case y channel name as the upper case Y uses lossy compression.

The change in the channel naming also makes it so the write code uses
32bit for the cryptomatte even when saving half-float EXR.

Fixes T96933: Cryptomatte layers saved incorrectly with EXR DWA compression
Fixes T88049: Cryptomatte EXR Output Bit Depth should always be 32bit

Differential Revision: https://developer.blender.org/D15823
2022-09-21 11:08:54 +02:00
19ae71c113 Fix T100914: Cycles faceting with combined Bump and Displacement
Port over small part of ray differentials refactor in e949d6da5b that
accidentally fixed this bug. Ensure ray differentials are orthogonal to
the normal.
2022-09-12 20:27:29 +02:00
a6c0d0a0e3 Version bump: 3.3.1-rc
One additional fix over 3.3.0 was already committed, so version must be bumped
to indicate the difference.
2022-09-12 20:26:19 +02:00
361 changed files with 3986 additions and 2113 deletions

View File

@@ -447,7 +447,7 @@ endif()
if(NOT APPLE)
option(WITH_CYCLES_DEVICE_HIP "Enable Cycles AMD HIP support" ON)
option(WITH_CYCLES_HIP_BINARIES "Build Cycles AMD HIP binaries" OFF)
set(CYCLES_HIP_BINARIES_ARCH gfx900 gfx906 gfx90c gfx902 gfx1010 gfx1011 gfx1012 gfx1030 gfx1031 gfx1032 gfx1034 gfx1035 CACHE STRING "AMD HIP architectures to build binaries for")
set(CYCLES_HIP_BINARIES_ARCH gfx900 gfx906 gfx90c gfx902 gfx1010 gfx1011 gfx1012 gfx1030 gfx1031 gfx1032 gfx1034 gfx1035 gfx1100 gfx1101 gfx1102 CACHE STRING "AMD HIP architectures to build binaries for")
mark_as_advanced(WITH_CYCLES_DEVICE_HIP)
mark_as_advanced(CYCLES_HIP_BINARIES_ARCH)
endif()
@@ -956,8 +956,8 @@ if(WITH_PYTHON)
# Do this before main 'platform_*' checks,
# because UNIX will search for the old Python paths which may not exist.
# giving errors about missing paths before this case is met.
if(DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.10")
message(FATAL_ERROR "At least Python 3.10 is required to build, but found Python ${PYTHON_VERSION}")
if(DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.9")
message(FATAL_ERROR "At least Python 3.9 is required to build, but found Python ${PYTHON_VERSION}")
endif()
file(GLOB RESULT "${CMAKE_SOURCE_DIR}/release/scripts/addons")

View File

@@ -96,6 +96,8 @@ include(cmake/openimagedenoise.cmake)
include(cmake/embree.cmake)
include(cmake/fmt.cmake)
include(cmake/robinmap.cmake)
include(cmake/xml2.cmake)
if(NOT APPLE)
include(cmake/xr_openxr.cmake)
if(NOT WIN32 OR BUILD_MODE STREQUAL Release)
@@ -148,7 +150,6 @@ if(NOT WIN32 OR ENABLE_MINGW64)
endif()
if(UNIX)
include(cmake/flac.cmake)
include(cmake/xml2.cmake)
if(NOT APPLE)
include(cmake/spnav.cmake)
include(cmake/jemalloc.cmake)
@@ -172,3 +173,4 @@ if(UNIX AND NOT APPLE)
endif()
include(cmake/harvest.cmake)
include(cmake/cve_check.cmake)

View File

@@ -8,11 +8,6 @@ if(WIN32)
# building with mingw, it'll have an unhappy time with that and
# we need to clear them out.
set(AOM_CMAKE_FLAGS )
# CMake will correctly identify phreads being available, however
# we do not want to use them, as that gains a dependency on
# libpthreadswin.dll which we do not want. when pthreads is not
# available oam will use a pthreads emulation layer using win32 threads
set(AOM_EXTRA_ARGS_WIN32 -DCMAKE_HAVE_PTHREAD_H=OFF)
else()
set(AOM_GENERATOR "Unix Makefiles")
set(AOM_CMAKE_FLAGS ${DEFAULT_CMAKE_FLAGS})
@@ -36,6 +31,7 @@ ExternalProject_Add(external_aom
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${AOM_HASH_TYPE}=${AOM_HASH}
PREFIX ${BUILD_DIR}/aom
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/aom/src/external_aom < ${PATCH_DIR}/aom.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/aom/src/external_aom-build/ &&
${CMAKE_COMMAND} -G "${AOM_GENERATOR}" -DCMAKE_INSTALL_PREFIX=${LIBDIR}/aom ${AOM_CMAKE_FLAGS} ${AOM_EXTRA_ARGS} ${BUILD_DIR}/aom/src/external_aom/

View File

@@ -0,0 +1,75 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# CVE Check requirements
#
# - A working installation of intels cve-bin-tool [1] has to be available in
# your path
#
# - Not strictly required, but highly recommended is obtaining a NVD key from
# nist since it significantly speeds up downloading/updating the required
# databases one can request a key on the following website:
# https://nvd.nist.gov/developers/request-an-api-key
# Bill of Materials construction
#
# This constructs a CSV cve-bin-tool [1] can read and process. Sadly
# cve-bin-tool at this point does not take a list of CPE's and output a check
# based on that list. so we need to pick apart the CPE retrieve the vendor,
# product and version tokens and generate a CSV.
#
# [1] https://github.com/intel/cve-bin-tool
# Because not all deps are downloaded (ie python packages) but can still have a
# xxx_CPE declared loop over all variables and look for variables ending in CPE.
set(SBOMCONTENTS)
get_cmake_property(_variableNames VARIABLES)
foreach (_variableName ${_variableNames})
if(_variableName MATCHES "CPE$")
string(REPLACE ":" ";" CPE_LIST ${${_variableName}})
string(REPLACE "_CPE" "_ID" CPE_DEPNAME ${_variableName})
list(GET CPE_LIST 3 CPE_VENDOR)
list(GET CPE_LIST 4 CPE_NAME)
list(GET CPE_LIST 5 CPE_VERSION)
set(${CPE_DEPNAME} "${CPE_VENDOR},${CPE_NAME},${CPE_VERSION}")
set(SBOMCONTENTS "${SBOMCONTENTS}${CPE_VENDOR},${CPE_NAME},${CPE_VERSION},,,\n")
endif()
endforeach()
configure_file(${CMAKE_SOURCE_DIR}/cmake/cve_check.csv.in ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv @ONLY)
# Custom Targets
#
# This defines two new custom targets one could run in the build folder
# `cve_check` which will output the report to the console, and `cve_check_html`
# which will write out blender_dependencies.html in the build folder that one
# could share with other people or be used to get more information on the
# reported CVE's.
#
# cve-bin-tool takes data from the nist nvd database which rate limits
# unauthenticated requests to 1 requests per 6 seconds making the database
# download take "quite a bit" of time.
#
# When adding -DCVE_CHECK_NVD_KEY=your_api_key_here to your cmake invocation
# this key will be passed on to cve-bin-tool speeding up the process.
#
if(DEFINED CVE_CHECK_NVD_KEY)
set(NVD_ARGS --nvd-api-key ${CVE_CHECK_NVD_KEY})
endif()
# This will just report to the console
add_custom_target(cve_check
COMMAND cve-bin-tool
${NVD_ARGS}
-i ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv
--affected-versions
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv
)
# This will write out blender_dependencies.html
add_custom_target(cve_check_html
COMMAND cve-bin-tool
${NVD_ARGS}
-i ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv
-f html
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv
)

View File

@@ -0,0 +1,40 @@
vendor,product,version,cve_number,remarks,comment
@FMT_ID@,OSV-2021-991,Ignored,CVE marked as invalid but OSV not updated
@FREETYPE_ID@,CVE-2022-27404,Ignored,does not affect blender usage of freetype
@FREETYPE_ID@,CVE-2022-27405,Ignored,does not affect blender usage of freetype
@FREETYPE_ID@,CVE-2022-27406,Ignored,does not affect blender usage of freetype
@OPENJPEG_ID@,CVE-2016-9675,Ignored,issue in convert command line tool not used by blender
@OPENJPEG_ID@,OSV-2022-416,Mitigated,using newer git revision with fix included
@PYTHON_ID@,CVE-2009-2940,Ignored,issue in pygresql not used by blender
@PYTHON_ID@,CVE-2020-29396,Ignored,issue in odoo not used by blender
@PYTHON_ID@,CVE-2021-32052,Ignored,issue in django not used by blender
@PYTHON_ID@,CVE-2009-3720,Ignored,already fixed in libexpat version used
@SSL_ID@,CVE-2009-1390,Ignored,issue in mutt not used by blender
@SSL_ID@,CVE-2009-3765,Ignored,issue in mutt not used by blender
@SSL_ID@,CVE-2009-3766,Ignored,issue in mutt not used by blender
@SSL_ID@,CVE-2009-3767,Ignored,issue in ldap not used by blender
@SSL_ID@,CVE-2019-0190,Ignored,issue in apache not used by blender
@TIFF_ID@,CVE-2022-2056,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2057,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2058,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2519,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2520,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2521,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2953,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-34526,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3570,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3597,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3598,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3599,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3626,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3627,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-48281,Ignored,issue in tiff command line tool not used by blender
@XML2_ID@,CVE-2016-3709,Ignored,not affecting blender and not considered a security issue upstream
@XML2_ID@,OSV-2021-777,Ignored,already fixed in version used so OSV invalid
@XML2_ID@,CVE-2022-40303,Ignored,fixed and cve_check version comparison is wrong
@XML2_ID@,CVE-2022-40304,Ignored,fixed and cve_check version comparison is wrong
@GMP_ID@,CVE-2021-43618,Mitigated,patched using upstream commit 561a9c25298e
@SQLITE_ID@,CVE-2022-35737,Ignored,only affects SQLITE_ENABLE_STAT4 compile option not used by blender or python
@SQLITE_ID@,CVE-2022-46908,Ignored,only affects CLI tools not used by blender or python
@BROTLI_ID@,CVE-2020-8927,Ignored,fixed and cve_check version comparison is wrong
@SBOMCONTENTS@

View File

@@ -14,6 +14,20 @@ function(download_source dep)
else()
set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/trunk/lib/packages/${TARGET_FILE})
endif()
# Validate all required variables are set and give an explicit error message
# rather than CMake erroring out later on with a more ambigious error.
if (NOT DEFINED TARGET_FILE)
message(FATAL_ERROR "${dep}_FILE variable not set")
endif()
if (NOT DEFINED TARGET_HASH)
message(FATAL_ERROR "${dep}_HASH variable not set")
endif()
if (NOT DEFINED TARGET_HASH_TYPE)
message(FATAL_ERROR "${dep}_HASH_TYPE variable not set")
endif()
if (NOT DEFINED TARGET_URI)
message(FATAL_ERROR "${dep}_URI variable not set")
endif()
set(TARGET_FILE ${PACKAGE_DIR}/${TARGET_FILE})
message("Checking source : ${dep} (${TARGET_FILE})")
if(NOT EXISTS ${TARGET_FILE})
@@ -25,6 +39,36 @@ function(download_source dep)
SHOW_PROGRESS
)
endif()
if(EXISTS ${TARGET_FILE})
# Sometimes the download fails, but that is not a
# fail condition for "file(DOWNLOAD" it will warn about
# a crc mismatch and just carry on, we need to explicitly
# catch this and remove the bogus 0 byte file so we can
# retry without having to go find the file and manually
# delete it.
file (SIZE ${TARGET_FILE} TARGET_SIZE)
if(${TARGET_SIZE} EQUAL 0)
file(REMOVE ${TARGET_FILE})
message(FATAL_ERROR "for ${TARGET_FILE} file size 0, download likely failed, deleted...")
endif()
# If we are using sources from the blender repo also
# validate that the hashes match, this takes a
# little more time, but protects us when we are
# building a release package and one of the packages
# is missing or incorrect.
#
# For regular platform maintenaince this is not needed
# since the actual build of the dep will notify the
# platform maintainer if there is a problem with the
# source package and refuse to build.
if(NOT PACKAGE_USE_UPSTREAM_SOURCES OR FORCE_CHECK_HASH)
file(${TARGET_HASH_TYPE} ${TARGET_FILE} LOCAL_HASH)
if(NOT ${TARGET_HASH} STREQUAL ${LOCAL_HASH})
message(FATAL_ERROR "${TARGET_FILE} ${TARGET_HASH_TYPE} mismatch\nExpected\t: ${TARGET_HASH}\nActual\t: ${LOCAL_HASH}")
endif()
endif()
endif()
endfunction(download_source)
download_source(ZLIB)
@@ -51,7 +95,6 @@ download_source(OSL)
download_source(PYTHON)
download_source(TBB)
download_source(OPENVDB)
download_source(NANOVDB)
download_source(NUMPY)
download_source(LAME)
download_source(OGG)
@@ -71,7 +114,6 @@ download_source(WEBP)
download_source(SPNAV)
download_source(JEMALLOC)
download_source(XML2)
download_source(TINYXML)
download_source(YAMLCPP)
download_source(EXPAT)
download_source(PUGIXML)

View File

@@ -16,12 +16,6 @@ if(WIN32)
--enable-libopenjpeg
--disable-mediafoundation
)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--x86asmexe=yasm
)
endif()
else()
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}

View File

@@ -7,8 +7,11 @@ set(FREETYPE_EXTRA_ARGS
-DFT_DISABLE_HARFBUZZ=ON
-DFT_DISABLE_PNG=ON
-DFT_REQUIRE_BROTLI=ON
-DFT_REQUIRE_ZLIB=ON
-DPC_BROTLIDEC_INCLUDEDIR=${LIBDIR}/brotli/include
-DPC_BROTLIDEC_LIBDIR=${LIBDIR}/brotli/lib
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
)
ExternalProject_Add(external_freetype
@@ -23,6 +26,7 @@ ExternalProject_Add(external_freetype
add_dependencies(
external_freetype
external_brotli
external_zlib
)
if(BUILD_MODE STREQUAL Release AND WIN32)

View File

@@ -22,11 +22,20 @@ elseif(UNIX AND NOT APPLE)
)
endif()
# Boolean crashes with Arm assembly, see T103423.
if(BLENDER_PLATFORM_ARM)
set(GMP_OPTIONS
${GMP_OPTIONS}
--disable-assembly
)
endif()
ExternalProject_Add(external_gmp
URL file://${PACKAGE_DIR}/${GMP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${GMP_HASH_TYPE}=${GMP_HASH}
PREFIX ${BUILD_DIR}/gmp
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/gmp/src/external_gmp < ${PATCH_DIR}/gmp.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/gmp ${GMP_OPTIONS} ${GMP_EXTRA_ARGS}
BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && make install

View File

@@ -11,189 +11,191 @@ message("HARVEST_TARGET = ${HARVEST_TARGET}")
if(WIN32)
if(BUILD_MODE STREQUAL Release)
add_custom_target(Harvest_Release_Results
COMMAND # jpeg rename libfile + copy include
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpeg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpeg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
# png
${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
# freeglut-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib ${HARVEST_TARGET}/opengl/lib/freeglut_static.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ ${HARVEST_TARGET}/opengl/include/ &&
# glew-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/glew/lib/libglew32.lib ${HARVEST_TARGET}/opengl/lib/glew.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/glew/include/ ${HARVEST_TARGET}/opengl/include/ &&
DEPENDS
)
endif()
else(WIN32)
function(harvest from to)
set(pattern "")
foreach(f ${ARGN})
set(pattern ${f})
endforeach()
if(pattern STREQUAL "")
get_filename_component(dirpath ${to} DIRECTORY)
get_filename_component(filename ${to} NAME)
install(
FILES ${LIBDIR}/${from}
DESTINATION ${HARVEST_TARGET}/${dirpath}
RENAME ${filename})
else()
install(
DIRECTORY ${LIBDIR}/${from}/
DESTINATION ${HARVEST_TARGET}/${to}
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN ${pattern}
PATTERN "pkgconfig" EXCLUDE
PATTERN "cmake" EXCLUDE
PATTERN "__pycache__" EXCLUDE
PATTERN "tests" EXCLUDE)
if(BUILD_MODE STREQUAL Release)
add_custom_target(Harvest_Release_Results
COMMAND # jpeg rename libfile + copy include
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpeg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpeg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
# png
${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
# freeglut-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib ${HARVEST_TARGET}/opengl/lib/freeglut_static.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ ${HARVEST_TARGET}/opengl/include/ &&
# glew-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/glew/lib/libglew32.lib ${HARVEST_TARGET}/opengl/lib/glew.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/glew/include/ ${HARVEST_TARGET}/opengl/include/ &&
DEPENDS
)
endif()
endfunction()
harvest(alembic/include alembic/include "*.h")
harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
harvest(alembic/bin alembic/bin "*")
harvest(brotli/include brotli/include "*.h")
harvest(brotli/lib brotli/lib "*.a")
harvest(boost/include boost/include "*")
harvest(boost/lib boost/lib "*.a")
harvest(imath/include imath/include "*.h")
harvest(imath/lib imath/lib "*.a")
harvest(ffmpeg/include ffmpeg/include "*.h")
harvest(ffmpeg/lib ffmpeg/lib "*.a")
harvest(fftw3/include fftw3/include "*.h")
harvest(fftw3/lib fftw3/lib "*.a")
harvest(flac/lib sndfile/lib "libFLAC.a")
harvest(freetype/include freetype/include "*.h")
harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
harvest(glew/include glew/include "*.h")
harvest(glew/lib glew/lib "*.a")
harvest(gmp/include gmp/include "*.h")
harvest(gmp/lib gmp/lib "*.a")
harvest(jemalloc/include jemalloc/include "*.h")
harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpeg/include jpeg/include "*.h")
harvest(jpeg/lib jpeg/lib "libjpeg.a")
harvest(lame/lib ffmpeg/lib "*.a")
if(NOT APPLE)
harvest(level-zero/include/level_zero level-zero/include/level_zero "*.h")
harvest(level-zero/lib level-zero/lib "*.so*")
endif()
harvest(llvm/bin llvm/bin "clang-format")
if(BUILD_CLANG_TOOLS)
harvest(llvm/bin llvm/bin "clang-tidy")
harvest(llvm/share/clang llvm/share "run-clang-tidy.py")
endif()
harvest(llvm/include llvm/include "*")
harvest(llvm/bin llvm/bin "llvm-config")
harvest(llvm/lib llvm/lib "libLLVM*.a")
harvest(llvm/lib llvm/lib "libclang*.a")
harvest(llvm/lib/clang llvm/lib/clang "*.h")
if(APPLE)
harvest(openmp/lib openmp/lib "*")
harvest(openmp/include openmp/include "*.h")
endif()
if(BLENDER_PLATFORM_ARM)
harvest(sse2neon sse2neon "*.h")
endif()
harvest(ogg/lib ffmpeg/lib "*.a")
harvest(openal/include openal/include "*.h")
if(UNIX AND NOT APPLE)
harvest(openal/lib openal/lib "*.a")
harvest(blosc/include blosc/include "*.h")
harvest(blosc/lib blosc/lib "*.a")
harvest(zlib/include zlib/include "*.h")
harvest(zlib/lib zlib/lib "*.a")
harvest(xml2/include xml2/include "*.h")
harvest(xml2/lib xml2/lib "*.a")
harvest(wayland-protocols/share/wayland-protocols wayland-protocols/share/wayland-protocols/ "*.xml")
else()
harvest(blosc/lib openvdb/lib "*.a")
harvest(xml2/lib opencollada/lib "*.a")
endif()
harvest(opencollada/include/opencollada opencollada/include "*.h")
harvest(opencollada/lib/opencollada opencollada/lib "*.a")
harvest(opencolorio/include opencolorio/include "*.h")
harvest(opencolorio/lib opencolorio/lib "*.a")
harvest(opencolorio/lib/static opencolorio/lib "*.a")
harvest(openexr/include openexr/include "*.h")
harvest(openexr/lib openexr/lib "*.a")
harvest(openimageio/bin openimageio/bin "idiff")
harvest(openimageio/bin openimageio/bin "maketx")
harvest(openimageio/bin openimageio/bin "oiiotool")
harvest(openimageio/include openimageio/include "*")
harvest(openimageio/lib openimageio/lib "*.a")
harvest(openimagedenoise/include openimagedenoise/include "*")
harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
harvest(embree/include embree/include "*.h")
harvest(embree/lib embree/lib "*.a")
harvest(openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION} openjpeg/include "*.h")
harvest(openjpeg/lib openjpeg/lib "*.a")
harvest(opensubdiv/include opensubdiv/include "*.h")
harvest(opensubdiv/lib opensubdiv/lib "*.a")
harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h")
harvest(openvdb/include/nanovdb openvdb/include/nanovdb "*.h")
harvest(openvdb/lib openvdb/lib "*.a")
harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h")
harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a")
harvest(osl/bin osl/bin "oslc")
harvest(osl/include osl/include "*.h")
harvest(osl/lib osl/lib "*.a")
harvest(osl/share/OSL/shaders osl/share/OSL/shaders "*.h")
harvest(png/include png/include "*.h")
harvest(png/lib png/lib "*.a")
harvest(pugixml/include pugixml/include "*.hpp")
harvest(pugixml/lib pugixml/lib "*.a")
harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}")
harvest(python/include python/include "*h")
harvest(python/lib python/lib "*")
harvest(sdl/include/SDL2 sdl/include "*.h")
harvest(sdl/lib sdl/lib "libSDL2.a")
harvest(sndfile/include sndfile/include "*.h")
harvest(sndfile/lib sndfile/lib "*.a")
harvest(spnav/include spnav/include "*.h")
harvest(spnav/lib spnav/lib "*.a")
harvest(tbb/include tbb/include "*.h")
harvest(tbb/lib/libtbb_static.a tbb/lib/libtbb.a)
harvest(theora/lib ffmpeg/lib "*.a")
harvest(tiff/include tiff/include "*.h")
harvest(tiff/lib tiff/lib "*.a")
harvest(vorbis/lib ffmpeg/lib "*.a")
harvest(opus/lib ffmpeg/lib "*.a")
harvest(vpx/lib ffmpeg/lib "*.a")
harvest(x264/lib ffmpeg/lib "*.a")
harvest(xvidcore/lib ffmpeg/lib "*.a")
harvest(aom/lib ffmpeg/lib "*.a")
harvest(webp/lib webp/lib "*.a")
harvest(webp/include webp/include "*.h")
harvest(usd/include usd/include "*.h")
harvest(usd/lib/usd usd/lib/usd "*")
harvest(usd/plugin usd/plugin "*")
harvest(potrace/include potrace/include "*.h")
harvest(potrace/lib potrace/lib "*.a")
harvest(haru/include haru/include "*.h")
harvest(haru/lib haru/lib "*.a")
harvest(zstd/include zstd/include "*.h")
harvest(zstd/lib zstd/lib "*.a")
if(UNIX AND NOT APPLE)
harvest(libglu/lib mesa/lib "*.so*")
harvest(mesa/lib64 mesa/lib "*.so*")
function(harvest from to)
set(pattern "")
foreach(f ${ARGN})
set(pattern ${f})
endforeach()
harvest(dpcpp dpcpp "*")
harvest(igc dpcpp/lib/igc "*")
harvest(ocloc dpcpp/lib/ocloc "*")
endif()
if(pattern STREQUAL "")
get_filename_component(dirpath ${to} DIRECTORY)
get_filename_component(filename ${to} NAME)
install(
FILES ${LIBDIR}/${from}
DESTINATION ${HARVEST_TARGET}/${dirpath}
RENAME ${filename}
)
else()
install(
DIRECTORY ${LIBDIR}/${from}/
DESTINATION ${HARVEST_TARGET}/${to}
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN ${pattern}
PATTERN "pkgconfig" EXCLUDE
PATTERN "cmake" EXCLUDE
PATTERN "__pycache__" EXCLUDE
PATTERN "tests" EXCLUDE
)
endif()
endfunction()
harvest(alembic/include alembic/include "*.h")
harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
harvest(alembic/bin alembic/bin "*")
harvest(brotli/include brotli/include "*.h")
harvest(brotli/lib brotli/lib "*.a")
harvest(boost/include boost/include "*")
harvest(boost/lib boost/lib "*.a")
harvest(imath/include imath/include "*.h")
harvest(imath/lib imath/lib "*.a")
harvest(ffmpeg/include ffmpeg/include "*.h")
harvest(ffmpeg/lib ffmpeg/lib "*.a")
harvest(fftw3/include fftw3/include "*.h")
harvest(fftw3/lib fftw3/lib "*.a")
harvest(flac/lib sndfile/lib "libFLAC.a")
harvest(freetype/include freetype/include "*.h")
harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
harvest(glew/include glew/include "*.h")
harvest(glew/lib glew/lib "*.a")
harvest(gmp/include gmp/include "*.h")
harvest(gmp/lib gmp/lib "*.a")
harvest(jemalloc/include jemalloc/include "*.h")
harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpeg/include jpeg/include "*.h")
harvest(jpeg/lib jpeg/lib "libjpeg.a")
harvest(lame/lib ffmpeg/lib "*.a")
if(NOT APPLE)
harvest(level-zero/include/level_zero level-zero/include/level_zero "*.h")
harvest(level-zero/lib level-zero/lib "*.so*")
endif()
harvest(llvm/bin llvm/bin "clang-format")
if(BUILD_CLANG_TOOLS)
harvest(llvm/bin llvm/bin "clang-tidy")
harvest(llvm/share/clang llvm/share "run-clang-tidy.py")
endif()
harvest(llvm/include llvm/include "*")
harvest(llvm/bin llvm/bin "llvm-config")
harvest(llvm/lib llvm/lib "libLLVM*.a")
harvest(llvm/lib llvm/lib "libclang*.a")
harvest(llvm/lib/clang llvm/lib/clang "*.h")
if(APPLE)
harvest(openmp/lib openmp/lib "*")
harvest(openmp/include openmp/include "*.h")
endif()
if(BLENDER_PLATFORM_ARM)
harvest(sse2neon sse2neon "*.h")
endif()
harvest(ogg/lib ffmpeg/lib "*.a")
harvest(openal/include openal/include "*.h")
if(UNIX AND NOT APPLE)
harvest(openal/lib openal/lib "*.a")
harvest(blosc/include blosc/include "*.h")
harvest(blosc/lib blosc/lib "*.a")
harvest(zlib/include zlib/include "*.h")
harvest(zlib/lib zlib/lib "*.a")
harvest(xml2/include xml2/include "*.h")
harvest(xml2/lib xml2/lib "*.a")
harvest(wayland-protocols/share/wayland-protocols wayland-protocols/share/wayland-protocols/ "*.xml")
else()
harvest(blosc/lib openvdb/lib "*.a")
harvest(xml2/lib opencollada/lib "*.a")
endif()
harvest(opencollada/include/opencollada opencollada/include "*.h")
harvest(opencollada/lib/opencollada opencollada/lib "*.a")
harvest(opencolorio/include opencolorio/include "*.h")
harvest(opencolorio/lib opencolorio/lib "*.a")
harvest(opencolorio/lib/static opencolorio/lib "*.a")
harvest(openexr/include openexr/include "*.h")
harvest(openexr/lib openexr/lib "*.a")
harvest(openimageio/bin openimageio/bin "idiff")
harvest(openimageio/bin openimageio/bin "maketx")
harvest(openimageio/bin openimageio/bin "oiiotool")
harvest(openimageio/include openimageio/include "*")
harvest(openimageio/lib openimageio/lib "*.a")
harvest(openimagedenoise/include openimagedenoise/include "*")
harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
harvest(embree/include embree/include "*.h")
harvest(embree/lib embree/lib "*.a")
harvest(openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION} openjpeg/include "*.h")
harvest(openjpeg/lib openjpeg/lib "*.a")
harvest(opensubdiv/include opensubdiv/include "*.h")
harvest(opensubdiv/lib opensubdiv/lib "*.a")
harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h")
harvest(openvdb/include/nanovdb openvdb/include/nanovdb "*.h")
harvest(openvdb/lib openvdb/lib "*.a")
harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h")
harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a")
harvest(osl/bin osl/bin "oslc")
harvest(osl/include osl/include "*.h")
harvest(osl/lib osl/lib "*.a")
harvest(osl/share/OSL/shaders osl/share/OSL/shaders "*.h")
harvest(png/include png/include "*.h")
harvest(png/lib png/lib "*.a")
harvest(pugixml/include pugixml/include "*.hpp")
harvest(pugixml/lib pugixml/lib "*.a")
harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}")
harvest(python/include python/include "*h")
harvest(python/lib python/lib "*")
harvest(sdl/include/SDL2 sdl/include "*.h")
harvest(sdl/lib sdl/lib "libSDL2.a")
harvest(sndfile/include sndfile/include "*.h")
harvest(sndfile/lib sndfile/lib "*.a")
harvest(spnav/include spnav/include "*.h")
harvest(spnav/lib spnav/lib "*.a")
harvest(tbb/include tbb/include "*.h")
harvest(tbb/lib/libtbb_static.a tbb/lib/libtbb.a)
harvest(theora/lib ffmpeg/lib "*.a")
harvest(tiff/include tiff/include "*.h")
harvest(tiff/lib tiff/lib "*.a")
harvest(vorbis/lib ffmpeg/lib "*.a")
harvest(opus/lib ffmpeg/lib "*.a")
harvest(vpx/lib ffmpeg/lib "*.a")
harvest(x264/lib ffmpeg/lib "*.a")
harvest(xvidcore/lib ffmpeg/lib "*.a")
harvest(aom/lib ffmpeg/lib "*.a")
harvest(webp/lib webp/lib "*.a")
harvest(webp/include webp/include "*.h")
harvest(usd/include usd/include "*.h")
harvest(usd/lib/usd usd/lib/usd "*")
harvest(usd/plugin usd/plugin "*")
harvest(potrace/include potrace/include "*.h")
harvest(potrace/lib potrace/lib "*.a")
harvest(haru/include haru/include "*.h")
harvest(haru/lib haru/lib "*.a")
harvest(zstd/include zstd/include "*.h")
harvest(zstd/lib zstd/lib "*.a")
if(UNIX AND NOT APPLE)
harvest(libglu/lib mesa/lib "*.so*")
harvest(mesa/lib64 mesa/lib "*.so*")
harvest(dpcpp dpcpp "*")
harvest(igc dpcpp/lib/igc "*")
harvest(ocloc dpcpp/lib/ocloc "*")
endif()
endif()

View File

@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
# cmake for windows
# CMAKE for MS-Windows.
set(JPEG_EXTRA_ARGS
-DNASM=${NASM_PATH}
-DWITH_JPEG8=ON
@@ -33,8 +33,8 @@ if(WIN32)
)
endif()
else(WIN32)
# cmake for unix
else()
# CMAKE for UNIX.
set(JPEG_EXTRA_ARGS
-DWITH_JPEG8=ON
-DENABLE_STATIC=ON

View File

@@ -9,6 +9,7 @@ endif()
if(APPLE)
set(LLVM_XML2_ARGS
-DLIBXML2_LIBRARY=${LIBDIR}/xml2/lib/libxml2.a
-DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2
)
set(LLVM_BUILD_CLANG_TOOLS_EXTRA ^^clang-tools-extra)
set(BUILD_CLANG_TOOLS ON)

View File

@@ -4,6 +4,29 @@ if(UNIX)
set(OPENCOLLADA_EXTRA_ARGS
-DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2
-DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2.a)
# WARNING: the patch contains mixed UNIX and DOS line endings
# as does the OPENCOLLADA package, if this can be corrected upstream that would be better.
# For now use `sed` to force UNIX line endings so the patch applies.
# Needed as neither ignoring white-space or applying as a binary resolve this problem.
set(PATCH_MAYBE_DOS2UNIX_CMD
sed -i "s/\\r//"
${PATCH_DIR}/opencollada.diff
${BUILD_DIR}/opencollada/src/external_opencollada/CMakeLists.txt
${BUILD_DIR}/opencollada/src/external_opencollada/Externals/LibXML/CMakeLists.txt &&
)
else()
set(OPENCOLLADA_EXTRA_ARGS
-DCMAKE_DEBUG_POSTFIX=_d
-DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2
)
if(BUILD_MODE STREQUAL Release)
list(APPEND OPENCOLLADA_EXTRA_ARGS -DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2s.lib)
else()
list(APPEND OPENCOLLADA_EXTRA_ARGS -DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2sd.lib)
endif()
set(PATCH_MAYBE_DOS2UNIX_CMD)
endif()
ExternalProject_Add(external_opencollada
@@ -11,17 +34,19 @@ ExternalProject_Add(external_opencollada
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENCOLLADA_HASH_TYPE}=${OPENCOLLADA_HASH}
PREFIX ${BUILD_DIR}/opencollada
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/opencollada/src/external_opencollada < ${PATCH_DIR}/opencollada.diff
PATCH_COMMAND
${PATCH_MAYBE_DOS2UNIX_CMD}
${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/opencollada/src/external_opencollada < ${PATCH_DIR}/opencollada.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opencollada ${DEFAULT_CMAKE_FLAGS} ${OPENCOLLADA_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/opencollada
)
if(UNIX)
add_dependencies(
external_opencollada
external_xml2
)
endif()
unset(PATCH_MAYBE_DOS2UNIX_CMD)
add_dependencies(
external_opencollada
external_xml2
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
@@ -32,17 +57,7 @@ if(WIN32)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_opencollada after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/buffer.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/buffer_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/ftoa.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/ftoa_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/GeneratedSaxParser.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/GeneratedSaxParser_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/MathMLSolver.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/MathMLSolver_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADABaseUtils.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADABaseUtils_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADAFramework.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADAFramework_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADASaxFrameworkLoader.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADASaxFrameworkLoader_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADAStreamWriter.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADAStreamWriter_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/pcre.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/pcre_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/UTF.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/UTF_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/xml.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/xml_d.lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencollada/lib ${HARVEST_TARGET}/opencollada/lib
DEPENDEES install
)
endif()

View File

@@ -15,7 +15,7 @@ message("BuildMode = ${BUILD_MODE}")
if(BUILD_MODE STREQUAL "Debug")
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Debug)
else(BUILD_MODE STREQUAL "Debug")
else()
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Release)
endif()
@@ -101,34 +101,16 @@ else()
set(LIBPREFIX "lib")
if(APPLE)
# Let's get the current Xcode dir, to support xcode-select
execute_process(
COMMAND xcode-select --print-path
OUTPUT_VARIABLE XCODE_DEV_PATH OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND xcodebuild -version -sdk macosx SDKVersion
OUTPUT_VARIABLE MACOSX_SDK_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT CMAKE_OSX_ARCHITECTURES)
execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Detected native architecture ${ARCHITECTURE}.")
set(CMAKE_OSX_ARCHITECTURES "${ARCHITECTURE}")
endif()
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")
set(OSX_DEPLOYMENT_TARGET 10.13)
else()
set(OSX_DEPLOYMENT_TARGET 11.00)
endif()
set(OSX_SYSROOT ${XCODE_DEV_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk)
# Use same Xcode detection as Blender itself.
include(../cmake/platform/platform_apple_xcode.cmake)
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(BLENDER_PLATFORM_ARM ON)
endif()
set(PLATFORM_CFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
set(PLATFORM_CXXFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -std=c++11 -stdlib=libc++ -arch ${CMAKE_OSX_ARCHITECTURES}")
set(PLATFORM_LDFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
set(PLATFORM_CFLAGS "-isysroot ${CMAKE_OSX_SYSROOT} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
set(PLATFORM_CXXFLAGS "-isysroot ${CMAKE_OSX_SYSROOT} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -std=c++11 -stdlib=libc++ -arch ${CMAKE_OSX_ARCHITECTURES}")
set(PLATFORM_LDFLAGS "-isysroot ${CMAKE_OSX_SYSROOT} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")
set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin17.0.0) # OS X 10.13
else()
@@ -136,8 +118,8 @@ else()
endif()
set(PLATFORM_CMAKE_FLAGS
-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${OSX_DEPLOYMENT_TARGET}
-DCMAKE_OSX_SYSROOT:PATH=${OSX_SYSROOT}
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}
-DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT}
)
else()
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")
@@ -171,8 +153,8 @@ else()
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG ${PLATFORM_CXXFLAGS}")
set(CONFIGURE_ENV
export MACOSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET} &&
export MACOSX_SDK_VERSION=${OSX_DEPLOYMENT_TARGET} &&
export MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} &&
export MACOSX_SDK_VERSION=${CMAKE_OSX_DEPLOYMENT_TARGET} &&
export CFLAGS=${PLATFORM_CFLAGS} &&
export CXXFLAGS=${PLATFORM_CXXFLAGS} &&
export LDFLAGS=${PLATFORM_LDFLAGS}

View File

@@ -32,6 +32,8 @@ set(OSL_EXTRA_ARGS
-DUSE_Qt5=OFF
-DINSTALL_DOCS=OFF
-Dpugixml_ROOT=${LIBDIR}/pugixml
-DTIFF_ROOT=${LIBDIR}/tiff
-DJPEG_ROOT=${LIBDIR}/jpeg
-DUSE_PYTHON=OFF
-DCMAKE_CXX_STANDARD=14
-DImath_ROOT=${LIBDIR}/imath

View File

@@ -24,6 +24,14 @@ add_dependencies(
external_zlib
)
if(WIN32 AND BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_png after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static${LIBEXT} ${HARVEST_TARGET}/png/lib/libpng${LIBEXT}
DEPENDEES install
)
endif()
if(WIN32 AND BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_png after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_staticd${LIBEXT} ${LIBDIR}/png/lib/libpng16${LIBEXT}

View File

@@ -15,9 +15,11 @@ if(WIN32)
endmacro()
set(PYTHON_EXTERNALS_FOLDER ${BUILD_DIR}/python/src/external_python/externals)
set(ZLIB_SOURCE_FOLDER ${BUILD_DIR}/zlib/src/external_zlib)
set(DOWNLOADS_EXTERNALS_FOLDER ${DOWNLOAD_DIR}/externals)
cmake_to_dos_path(${PYTHON_EXTERNALS_FOLDER} PYTHON_EXTERNALS_FOLDER_DOS)
cmake_to_dos_path(${ZLIB_SOURCE_FOLDER} ZLIB_SOURCE_FOLDER_DOS)
cmake_to_dos_path(${DOWNLOADS_EXTERNALS_FOLDER} DOWNLOADS_EXTERNALS_FOLDER_DOS)
ExternalProject_Add(external_python
@@ -25,12 +27,21 @@ if(WIN32)
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${PYTHON_HASH_TYPE}=${PYTHON_HASH}
PREFIX ${BUILD_DIR}/python
CONFIGURE_COMMAND ""
# Python will download its own deps and there's very little we can do about
# that beyond placing some code in their externals dir before it tries.
# the foldernames *HAVE* to match the ones inside pythons get_externals.cmd.
# python 3.10.8 still ships zlib 1.2.12, replace it with our 1.2.13
# copy until they update.
CONFIGURE_COMMAND mkdir ${PYTHON_EXTERNALS_FOLDER_DOS} &&
mklink /J ${PYTHON_EXTERNALS_FOLDER_DOS}\\zlib-1.2.12 ${ZLIB_SOURCE_FOLDER_DOS} &&
${CMAKE_COMMAND} -E copy ${ZLIB_SOURCE_FOLDER}/../external_zlib-build/zconf.h ${PYTHON_EXTERNALS_FOLDER}/zlib-1.2.12/zconf.h
BUILD_COMMAND cd ${BUILD_DIR}/python/src/external_python/pcbuild/ && set IncludeTkinter=false && call build.bat -e -p x64 -c ${BUILD_MODE}
PATCH_COMMAND ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_windows.diff
INSTALL_COMMAND ${PYTHON_BINARY_INTERNAL} ${PYTHON_SRC}/PC/layout/main.py -b ${PYTHON_SRC}/PCbuild/amd64 -s ${PYTHON_SRC} -t ${PYTHON_SRC}/tmp/ --include-stable --include-pip --include-dev --include-launchers --include-venv --include-symbols ${PYTHON_EXTRA_INSTLAL_FLAGS} --copy ${LIBDIR}/python
)
add_dependencies(
external_python
external_zlib
)
else()
if(APPLE)
# Disable functions that can be in 10.13 sdk but aren't available on 10.9 target.

View File

@@ -15,7 +15,21 @@ ExternalProject_Add(external_python_site_packages
CONFIGURE_COMMAND ${PIP_CONFIGURE_COMMAND}
BUILD_COMMAND ""
PREFIX ${BUILD_DIR}/site_packages
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install --no-cache-dir ${SITE_PACKAGES_EXTRA} cython==${CYTHON_VERSION} idna==${IDNA_VERSION} charset-normalizer==${CHARSET_NORMALIZER_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} zstandard==${ZSTANDARD_VERSION} autopep8==${AUTOPEP8_VERSION} pycodestyle==${PYCODESTYLE_VERSION} toml==${TOML_VERSION} --no-binary :all:
# setuptools is downgraded to 63.2.0 (same as python 3.10.8) since numpy 1.23.x seemingly has
# issues building on windows with the newer versions that ships with python 3.10.9+
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install --no-cache-dir ${SITE_PACKAGES_EXTRA}
setuptools==63.2.0
cython==${CYTHON_VERSION}
idna==${IDNA_VERSION}
charset-normalizer==${CHARSET_NORMALIZER_VERSION}
urllib3==${URLLIB3_VERSION}
certifi==${CERTIFI_VERSION}
requests==${REQUESTS_VERSION}
zstandard==${ZSTANDARD_VERSION}
autopep8==${AUTOPEP8_VERSION}
pycodestyle==${PYCODESTYLE_VERSION}
toml==${TOML_VERSION}
--no-binary :all:
)
if(USE_PIP_NUMPY)

View File

@@ -11,18 +11,11 @@ else()
set(SNDFILE_OPTIONS --enable-static --disable-shared )
endif()
if(UNIX)
set(SNDFILE_PATCH_CMD ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/sndfile/src/external_sndfile < ${PATCH_DIR}/sndfile.diff)
else()
set(SNDFILE_PATCH_CMD)
endif()
ExternalProject_Add(external_sndfile
URL file://${PACKAGE_DIR}/${SNDFILE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${SNDFILE_HASH_TYPE}=${SNDFILE_HASH}
PREFIX ${BUILD_DIR}/sndfile
PATCH_COMMAND ${SNDFILE_PATCH_CMD}
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && ${SNDFILE_ENV} ${CONFIGURE_COMMAND} ${SNDFILE_OPTIONS} --prefix=${mingw_LIBDIR}/sndfile
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && make install

View File

@@ -48,7 +48,6 @@ ExternalProject_Add(external_sqlite
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${SQLITE_HASH_TYPE}=${SQLITE_HASH}
PREFIX ${BUILD_DIR}/sqlite
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/sqlite/src/external_sqlite < ${PATCH_DIR}/sqlite.diff
CONFIGURE_COMMAND ${SQLITE_CONFIGURE_ENV} && cd ${BUILD_DIR}/sqlite/src/external_sqlite/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/sqlite ${SQLITE_CONFIGURATION_ARGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sqlite/src/external_sqlite/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sqlite/src/external_sqlite/ && make install

View File

@@ -5,6 +5,7 @@ set(SSL_PATCH_CMD echo .)
if(APPLE)
set(SSL_OS_COMPILER "blender-darwin-${CMAKE_OSX_ARCHITECTURES}")
set(SSL_PATCH_CMD ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/ssl/src/external_ssl < ${PATCH_DIR}/ssl.diff)
else()
if(BLENDER_PLATFORM_ARM)
set(SSL_OS_COMPILER "blender-linux-aarch64")

View File

@@ -25,6 +25,7 @@ ExternalProject_Add(external_tiff
add_dependencies(
external_tiff
external_zlib
external_jpeg
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)

View File

@@ -1,10 +1,19 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(ZLIB_VERSION 1.2.12)
# CPE's are used to identify dependencies, for more information on what they
# are please see https://nvd.nist.gov/products/cpe
#
# We use them in combination with cve-bin-tool to scan for known security issues.
#
# Not all of our dependencies are currently in the nvd database so not all
# dependencies have one assigned.
set(ZLIB_VERSION 1.2.13)
set(ZLIB_URI https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz)
set(ZLIB_HASH 5fc414a9726be31427b440b434d05f78)
set(ZLIB_HASH 9b8aa094c4e5765dabf4da391f00d15c)
set(ZLIB_HASH_TYPE MD5)
set(ZLIB_FILE zlib-${ZLIB_VERSION}.tar.gz)
set(ZLIB_CPE "cpe:2.3:a:zlib:zlib:${ZLIB_VERSION}:*:*:*:*:*:*:*")
set(OPENAL_VERSION 1.21.1)
set(OPENAL_URI http://openal-soft.org/openal-releases/openal-soft-${OPENAL_VERSION}.tar.bz2)
@@ -17,12 +26,14 @@ set(PNG_URI http://prdownloads.sourceforge.net/libpng/libpng-${PNG_VERSION}.tar.
set(PNG_HASH 505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca)
set(PNG_HASH_TYPE SHA256)
set(PNG_FILE libpng-${PNG_VERSION}.tar.xz)
set(PNG_CPE "cpe:2.3:a:libpng:libpng:${PNG_VERSION}:*:*:*:*:*:*:*")
set(JPEG_VERSION 2.1.3)
set(JPEG_URI https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${JPEG_VERSION}.tar.gz)
set(JPEG_HASH 627b980fad0573e08e4c3b80b290fc91)
set(JPEG_HASH_TYPE MD5)
set(JPEG_FILE libjpeg-turbo-${JPEG_VERSION}.tar.gz)
set(JPEG_CPE "cpe:2.3:a:d.r.commander:libjpeg-turbo:${JPEG_VERSION}:*:*:*:*:*:*:*")
set(BOOST_VERSION 1.78.0)
set(BOOST_VERSION_SHORT 1.78)
@@ -32,12 +43,14 @@ set(BOOST_URI https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION
set(BOOST_HASH c2f6428ac52b0e5a3c9b2e1d8cc832b5)
set(BOOST_HASH_TYPE MD5)
set(BOOST_FILE boost_${BOOST_VERSION_NODOTS}.tar.gz)
set(BOOST_CPE "cpe:2.3:a:boost:boost:${BOOST_VERSION}:*:*:*:*:*:*:*")
set(BLOSC_VERSION 1.21.1)
set(BLOSC_URI https://github.com/Blosc/c-blosc/archive/v${BLOSC_VERSION}.tar.gz)
set(BLOSC_HASH 134b55813b1dca57019d2a2dc1f7a923)
set(BLOSC_HASH_TYPE MD5)
set(BLOSC_FILE blosc-${BLOSC_VERSION}.tar.gz)
set(BLOSC_CPE "cpe:2.3:a:c-blosc2_project:c-blosc2:${BLOSC_VERSION}:*:*:*:*:*:*:*")
set(PTHREADS_VERSION 3.0.0)
set(PTHREADS_URI http://prdownloads.sourceforge.net/pthreads4w/pthreads4w-code-v${PTHREADS_VERSION}.zip)
@@ -50,6 +63,7 @@ set(OPENEXR_URI https://github.com/AcademySoftwareFoundation/openexr/archive/v${
set(OPENEXR_HASH a92f38eedd43e56c0af56d4852506886)
set(OPENEXR_HASH_TYPE MD5)
set(OPENEXR_FILE openexr-${OPENEXR_VERSION}.tar.gz)
set(OPENEXR_CPE "cpe:2.3:a:openexr:openexr:${OPENEXR_VERSION}:*:*:*:*:*:*:*")
set(IMATH_VERSION 3.1.5)
set(IMATH_URI https://github.com/AcademySoftwareFoundation/Imath/archive/v${OPENEXR_VERSION}.tar.gz)
@@ -74,11 +88,12 @@ else()
set(OPENEXR_VERSION_POSTFIX)
endif()
set(FREETYPE_VERSION 2.11.1)
set(FREETYPE_VERSION 2.12.1)
set(FREETYPE_URI http://prdownloads.sourceforge.net/freetype/freetype-${FREETYPE_VERSION}.tar.gz)
set(FREETYPE_HASH bd4e3b007474319909a6b79d50908e85)
set(FREETYPE_HASH 8bc5c9c9df7ac12c504f8918552a7cf2)
set(FREETYPE_HASH_TYPE MD5)
set(FREETYPE_FILE freetype-${FREETYPE_VERSION}.tar.gz)
SET(FREETYPE_CPE "cpe:2.3:a:freetype:freetype:${FREETYPE_VERSION}:*:*:*:*:*:*:*")
set(GLEW_VERSION 1.13.0)
set(GLEW_URI http://prdownloads.sourceforge.net/glew/glew/${GLEW_VERSION}/glew-${GLEW_VERSION}.tgz)
@@ -97,6 +112,7 @@ set(ALEMBIC_URI https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.ta
set(ALEMBIC_HASH 2cd8d6e5a3ac4a014e24a4b04f4fadf9)
set(ALEMBIC_HASH_TYPE MD5)
set(ALEMBIC_FILE alembic-${ALEMBIC_VERSION}.tar.gz)
SET(FREETYPE_CPE "cpe:2.3:a:freetype:freetype:${FREETYPE_VERSION}:*:*:*:*:*:*:*")
set(OPENSUBDIV_VERSION v3_4_4)
set(OPENSUBDIV_URI https://github.com/PixarAnimationStudios/OpenSubdiv/archive/${OPENSUBDIV_VERSION}.tar.gz)
@@ -109,6 +125,7 @@ set(SDL_URI https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz)
set(SDL_HASH a53acc02e1cca98c4123229069b67c9e)
set(SDL_HASH_TYPE MD5)
set(SDL_FILE SDL2-${SDL_VERSION}.tar.gz)
set(SDL_CPE "cpe:2.3:a:libsdl:sdl:${SDL_VERSION}:*:*:*:*:*:*:*")
set(OPENCOLLADA_VERSION v1.6.68)
set(OPENCOLLADA_URI https://github.com/KhronosGroup/OpenCOLLADA/archive/${OPENCOLLADA_VERSION}.tar.gz)
@@ -127,6 +144,7 @@ set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LL
set(LLVM_HASH 5a4fab4d7fc84aefffb118ac2c8a4fc0)
set(LLVM_HASH_TYPE MD5)
set(LLVM_FILE llvm-project-${LLVM_VERSION}.src.tar.xz)
set(LLVM_CPE "cpe:2.3:a:llvm:compiler:${LLVM_VERSION}:*:*:*:*:*:*:*")
if(APPLE)
# Cloth physics test is crashing due to this bug:
@@ -141,9 +159,9 @@ set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${
set(OPENMP_HASH_TYPE MD5)
set(OPENMP_FILE openmp-${OPENMP_VERSION}.src.tar.xz)
set(OPENIMAGEIO_VERSION v2.3.13.0)
set(OPENIMAGEIO_VERSION v2.3.20.0)
set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/refs/tags/${OPENIMAGEIO_VERSION}.tar.gz)
set(OPENIMAGEIO_HASH de45fb38501c4581062b522b53b6141c)
set(OPENIMAGEIO_HASH defb1fe7c8e64bac60eb3cacaf5c3736)
set(OPENIMAGEIO_HASH_TYPE MD5)
set(OPENIMAGEIO_FILE OpenImageIO-${OPENIMAGEIO_VERSION}.tar.gz)
@@ -154,6 +172,7 @@ set(FMT_URI https://github.com/fmtlib/fmt/archive/refs/tags/${FMT_VERSION}.tar.g
set(FMT_HASH 7bce0e9e022e586b178b150002e7c2339994e3c2bbe44027e9abb0d60f9cce83)
set(FMT_HASH_TYPE SHA256)
set(FMT_FILE fmt-${FMT_VERSION}.tar.gz)
set(FMT_CPE "cpe:2.3:a:fmt:fmt:${FMT_VERSION}:*:*:*:*:*:*:*")
# 0.6.2 is currently oiio's preferred version although never versions may be available.
# the preferred version can be found in oiio's externalpackages.cmake
@@ -163,11 +182,12 @@ set(ROBINMAP_HASH c08ec4b1bf1c85eb0d6432244a6a89862229da1cb834f3f90fba8dc35d8c8e
set(ROBINMAP_HASH_TYPE SHA256)
set(ROBINMAP_FILE robinmap-${ROBINMAP_VERSION}.tar.gz)
set(TIFF_VERSION 4.4.0)
set(TIFF_VERSION 4.5.0)
set(TIFF_URI http://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz)
set(TIFF_HASH 376f17f189e9d02280dfe709b2b2bbea)
set(TIFF_HASH db9e220a1971acc64487f1d51a20dcaa)
set(TIFF_HASH_TYPE MD5)
set(TIFF_FILE tiff-${TIFF_VERSION}.tar.gz)
set(TIFF_CPE "cpe:2.3:a:libtiff:libtiff:${TIFF_VERSION}:*:*:*:*:*:*:*")
set(OSL_VERSION 1.11.17.0)
set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.tar.gz)
@@ -175,19 +195,22 @@ set(OSL_HASH 63265472ce14548839ace2e21e401544)
set(OSL_HASH_TYPE MD5)
set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz)
set(PYTHON_VERSION 3.10.2)
set(PYTHON_VERSION 3.10.9)
set(PYTHON_SHORT_VERSION 3.10)
set(PYTHON_SHORT_VERSION_NO_DOTS 310)
set(PYTHON_URI https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz)
set(PYTHON_HASH 14e8c22458ed7779a1957b26cde01db9)
set(PYTHON_HASH dc8c0f274b28ee9e95923d20cfc364c9)
set(PYTHON_HASH_TYPE MD5)
set(PYTHON_FILE Python-${PYTHON_VERSION}.tar.xz)
set(PYTHON_CPE "cpe:2.3:a:python:python:${PYTHON_VERSION}:-:*:*:*:*:*:*")
set(TBB_VERSION 2020_U3)
set(TBB_YEAR 2020)
set(TBB_VERSION ${TBB_YEAR}_U3)
set(TBB_URI https://github.com/oneapi-src/oneTBB/archive/${TBB_VERSION}.tar.gz)
set(TBB_HASH 55ec8df6eae5ed6364a47f0e671e460c)
set(TBB_HASH_TYPE MD5)
set(TBB_FILE oneTBB-${TBB_VERSION}.tar.gz)
set(TBB_CPE "cpe:2.3:a:intel:threading_building_blocks:${TBB_YEAR}:*:*:*:*:*:*:*")
set(OPENVDB_VERSION 9.0.0)
set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
@@ -198,6 +221,7 @@ set(OPENVDB_FILE openvdb-${OPENVDB_VERSION}.tar.gz)
set(IDNA_VERSION 3.3)
set(CHARSET_NORMALIZER_VERSION 2.0.10)
set(URLLIB3_VERSION 1.26.8)
set(URLLIB3_CPE "cpe:2.3:a:urllib3:urllib3:${URLLIB3_VERSION}:*:*:*:*:*:*:*")
set(CERTIFI_VERSION 2021.10.8)
set(REQUESTS_VERSION 2.27.1)
set(CYTHON_VERSION 0.29.26)
@@ -214,12 +238,14 @@ set(NUMPY_URI https://github.com/numpy/numpy/releases/download/v${NUMPY_VERSION}
set(NUMPY_HASH 252de134862a27bd66705d29622edbfe)
set(NUMPY_HASH_TYPE MD5)
set(NUMPY_FILE numpy-${NUMPY_VERSION}.zip)
set(NUMPY_CPE "cpe:2.3:a:numpy:numpy:${NUMPY_VERSION}:*:*:*:*:*:*:*")
set(LAME_VERSION 3.100)
set(LAME_URI http://downloads.sourceforge.net/project/lame/lame/3.100/lame-${LAME_VERSION}.tar.gz)
set(LAME_HASH 83e260acbe4389b54fe08e0bdbf7cddb)
set(LAME_HASH_TYPE MD5)
set(LAME_FILE lame-${LAME_VERSION}.tar.gz)
set(LAME_CPE "cpe:2.3:a:lame_project:lame:${LAME_VERSION}:*:*:*:*:*:*:*")
set(OGG_VERSION 1.3.5)
set(OGG_URI http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz)
@@ -232,6 +258,7 @@ set(VORBIS_URI http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERS
set(VORBIS_HASH 0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab)
set(VORBIS_HASH_TYPE SHA256)
set(VORBIS_FILE libvorbis-${VORBIS_VERSION}.tar.gz)
set(VORBIS_CPE "cpe:2.3:a:xiph.org:libvorbis:${VORBIS_VERSION}:*:*:*:*:*:*:*")
set(THEORA_VERSION 1.1.1)
set(THEORA_URI http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.bz2)
@@ -239,17 +266,19 @@ set(THEORA_HASH b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc
set(THEORA_HASH_TYPE SHA256)
set(THEORA_FILE libtheora-${THEORA_VERSION}.tar.bz2)
set(FLAC_VERSION 1.3.4)
set(FLAC_VERSION 1.4.2)
set(FLAC_URI http://downloads.xiph.org/releases/flac/flac-${FLAC_VERSION}.tar.xz)
set(FLAC_HASH 8ff0607e75a322dd7cd6ec48f4f225471404ae2730d0ea945127b1355155e737 )
set(FLAC_HASH e322d58a1f48d23d9dd38f432672865f6f79e73a6f9cc5a5f57fcaa83eb5a8e4 )
set(FLAC_HASH_TYPE SHA256)
set(FLAC_FILE flac-${FLAC_VERSION}.tar.xz)
set(FLAC_CPE "cpe:2.3:a:flac_project:flac:${FLAC_VERSION}:*:*:*:*:*:*:*")
set(VPX_VERSION 1.11.0)
set(VPX_URI https://github.com/webmproject/libvpx/archive/v${VPX_VERSION}/libvpx-v${VPX_VERSION}.tar.gz)
set(VPX_HASH 965e51c91ad9851e2337aebcc0f517440c637c506f3a03948062e3d5ea129a83)
set(VPX_HASH_TYPE SHA256)
set(VPX_FILE libvpx-v${VPX_VERSION}.tar.gz)
set(VPX_CPE "cpe:2.3:a:webmproject:libvpx:${VPX_VERSION}:*:*:*:*:*:*:*")
set(OPUS_VERSION 1.3.1)
set(OPUS_URI https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz)
@@ -269,18 +298,21 @@ set(XVIDCORE_HASH abbdcbd39555691dd1c9b4d08f0a031376a3b211652c0d8b3b8aa9be1303ce
set(XVIDCORE_HASH_TYPE SHA256)
set(XVIDCORE_FILE xvidcore-${XVIDCORE_VERSION}.tar.gz)
set(OPENJPEG_VERSION 2.4.0)
set(OPENJPEG_SHORT_VERSION 2.4)
set(OPENJPEG_URI https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz)
set(OPENJPEG_HASH 8702ba68b442657f11aaeb2b338443ca8d5fb95b0d845757968a7be31ef7f16d)
set(OPENJPEG_VERSION 2.5.0)
set(OPENJPEG_SHORT_VERSION 2.5)
set(OPENJPEG_GIT_HASH 2d606701e8b7aa83f657d113c3367508e99bd12b)
set(OPENJPEG_URI https://github.com/uclouvain/openjpeg/archive/${OPENJPEG_GIT_HASH}.tar.gz)
set(OPENJPEG_HASH f90941955eb66a81762df5e989f13ade48d753d3182e7f9a82d2bfce3fb5cef2)
set(OPENJPEG_HASH_TYPE SHA256)
set(OPENJPEG_FILE openjpeg-v${OPENJPEG_VERSION}.tar.gz)
set(OPENJPEG_FILE openjpeg-v${OPENJPEG_GIT_HASH}.tar.gz)
set(OPENJPEG_CPE "cpe:2.3:a:uclouvain:openjpeg:${OPENJPEG_VERSION}:*:*:*:*:*:*:*")
set(FFMPEG_VERSION 5.0)
set(FFMPEG_VERSION 5.1.2)
set(FFMPEG_URI http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2)
set(FFMPEG_HASH c0130b8db2c763430fd1c6905288d61bc44ee0548ad5fcd2dfd650b88432bed9)
set(FFMPEG_HASH 39a0bcc8d98549f16c570624678246a6ac736c066cebdb409f9502e915b22f2b)
set(FFMPEG_HASH_TYPE SHA256)
set(FFMPEG_FILE ffmpeg-${FFMPEG_VERSION}.tar.bz2)
set(FFMPEG_CPE "cpe:2.3:a:ffmpeg:ffmpeg:${FFMPEG_VERSION}:*:*:*:*:*:*:*")
set(FFTW_VERSION 3.3.10)
set(FFTW_URI http://www.fftw.org/fftw-${FFTW_VERSION}.tar.gz)
@@ -294,17 +326,19 @@ set(ICONV_HASH 7d2a800b952942bb2880efb00cfd524c)
set(ICONV_HASH_TYPE MD5)
set(ICONV_FILE libiconv-${ICONV_VERSION}.tar.gz)
set(SNDFILE_VERSION 1.0.28)
set(SNDFILE_URI http://www.mega-nerd.com/libsndfile/files/libsndfile-${SNDFILE_VERSION}.tar.gz)
set(SNDFILE_HASH 646b5f98ce89ac60cdb060fcd398247c)
set(SNDFILE_VERSION 1.1.0)
set(SNDFILE_URI https://github.com/libsndfile/libsndfile/releases/download/1.1.0/libsndfile-${SNDFILE_VERSION}.tar.xz)
set(SNDFILE_HASH e63dead2b4f0aaf323687619d007ee6a)
set(SNDFILE_HASH_TYPE MD5)
set(SNDFILE_FILE libsndfile-${SNDFILE_VERSION}.tar.gz)
set(SNDFILE_CPE "cpe:2.3:a:libsndfile_project:libsndfile:${SNDFILE_VERSION}:*:*:*:*:*:*:*")
set(WEBP_VERSION 1.2.2)
set(WEBP_URI https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz)
set(WEBP_HASH b5e2e414a8adee4c25fe56b18dd9c549)
set(WEBP_HASH_TYPE MD5)
set(WEBP_FILE libwebp-${WEBP_VERSION}.tar.gz)
set(WEBP_CPE "cpe:2.3:a:webmproject:libwebp:${WEBP_VERSION}:*:*:*:*:*:*:*")
set(SPNAV_VERSION 0.2.3)
set(SPNAV_URI http://downloads.sourceforge.net/project/spacenav/spacenav%20library%20%28SDK%29/libspnav%20${SPNAV_VERSION}/libspnav-${SPNAV_VERSION}.tar.gz)
@@ -318,24 +352,19 @@ set(JEMALLOC_HASH 3d41fbf006e6ebffd489bdb304d009ae)
set(JEMALLOC_HASH_TYPE MD5)
set(JEMALLOC_FILE jemalloc-${JEMALLOC_VERSION}.tar.bz2)
set(XML2_VERSION 2.9.10)
set(XML2_URI http://xmlsoft.org/sources/libxml2-${XML2_VERSION}.tar.gz)
set(XML2_HASH 10942a1dc23137a8aa07f0639cbfece5)
set(XML2_VERSION 2.10.3)
set(XML2_URI https://download.gnome.org/sources/libxml2/2.10/libxml2-${XML2_VERSION}.tar.xz)
set(XML2_HASH f9edac7fac232b3657a003fd9a5bbe42)
set(XML2_HASH_TYPE MD5)
set(XML2_FILE libxml2-${XML2_VERSION}.tar.gz)
set(TINYXML_VERSION 2_6_2)
set(TINYXML_VERSION_DOTS 2.6.2)
set(TINYXML_URI https://nchc.dl.sourceforge.net/project/tinyxml/tinyxml/${TINYXML_VERSION_DOTS}/tinyxml_${TINYXML_VERSION}.tar.gz)
set(TINYXML_HASH c1b864c96804a10526540c664ade67f0)
set(TINYXML_HASH_TYPE MD5)
set(TINYXML_FILE tinyxml_${TINYXML_VERSION}.tar.gz)
set(XML2_FILE libxml2-${XML2_VERSION}.tar.xz)
set(XML2_CPE "cpe:2.3:a:xmlsoft:libxml2:${XML2_VERSION}:*:*:*:*:*:*:*")
set(YAMLCPP_VERSION 0.6.3)
set(YAMLCPP_URI https://codeload.github.com/jbeder/yaml-cpp/tar.gz/yaml-cpp-${YAMLCPP_VERSION})
set(YAMLCPP_HASH b45bf1089a382e81f6b661062c10d0c2)
set(YAMLCPP_HASH_TYPE MD5)
set(YAMLCPP_FILE yaml-cpp-${YAMLCPP_VERSION}.tar.gz)
set(YAMLCPP "cpe:2.3:a:yaml-cpp_project:yaml-cpp:${YAMLCPP_VERSION}:*:*:*:*:*:*:*")
set(PYSTRING_VERSION v1.1.3)
set(PYSTRING_URI https://codeload.github.com/imageworks/pystring/tar.gz/refs/tags/${PYSTRING_VERSION})
@@ -343,17 +372,20 @@ set(PYSTRING_HASH f2c68786b359f5e4e62bed53bc4fb86d)
set(PYSTRING_HASH_TYPE MD5)
set(PYSTRING_FILE pystring-${PYSTRING_VERSION}.tar.gz)
set(EXPAT_VERSION 2_4_4)
set(EXPAT_VERSION 2_5_0)
set(EXPAT_VERSION_DOTS 2.5.0)
set(EXPAT_URI https://github.com/libexpat/libexpat/archive/R_${EXPAT_VERSION}.tar.gz)
set(EXPAT_HASH 2d3e81dee94b452369dc6394ff0f8f98)
set(EXPAT_HASH d375fa3571c0abb945873f5061a8f2e2)
set(EXPAT_HASH_TYPE MD5)
set(EXPAT_FILE libexpat-${EXPAT_VERSION}.tar.gz)
set(EXPAT_CPE "cpe:2.3:a:libexpat_project:libexpat:${EXPAT_VERSION_DOTS}:*:*:*:*:*:*:*")
set(PUGIXML_VERSION 1.10)
set(PUGIXML_URI https://github.com/zeux/pugixml/archive/v${PUGIXML_VERSION}.tar.gz)
set(PUGIXML_HASH 0c208b0664c7fb822bf1b49ad035e8fd)
set(PUGIXML_HASH_TYPE MD5)
set(PUGIXML_FILE pugixml-${PUGIXML_VERSION}.tar.gz)
set(PUGIXML_CPE "cpe:2.3:a:pugixml_project:pugixml:${PUGIXML_VERSION}:*:*:*:*:*:*:*")
set(FLEXBISON_VERSION 2.5.24)
set(FLEXBISON_URI http://prdownloads.sourceforge.net/winflexbison/win_flex_bison-${FLEXBISON_VERSION}.zip)
@@ -371,17 +403,26 @@ set(FLEX_FILE flex-${FLEX_VERSION}.tar.gz)
# NOTE: bzip.org domain does no longer belong to BZip 2 project, so we download
# sources from Debian packaging.
#
# NOTE 2: This will *HAVE* to match the version python ships on windows which
# is hardcoded in pythons PCbuild/get_externals.bat. For compliance reasons there
# can be no exceptions to this.
set(BZIP2_VERSION 1.0.8)
set(BZIP2_URI http://http.debian.net/debian/pool/main/b/bzip2/bzip2_${BZIP2_VERSION}.orig.tar.gz)
set(BZIP2_HASH ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269)
set(BZIP2_HASH_TYPE SHA256)
set(BZIP2_FILE bzip2_${BZIP2_VERSION}.orig.tar.gz)
set(BZIP2_CPE "cpe:2.3:a:bzip:bzip2:${BZIP2_VERSION}:*:*:*:*:*:*:*")
# NOTE: This will *HAVE* to match the version python ships on windows which
# is hardcoded in pythons PCbuild/get_externals.bat. For compliance reasons there
# can be no exceptions to this.
set(FFI_VERSION 3.3)
set(FFI_URI https://sourceware.org/pub/libffi/libffi-${FFI_VERSION}.tar.gz)
set(FFI_HASH 72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056)
set(FFI_HASH_TYPE SHA256)
set(FFI_FILE libffi-${FFI_VERSION}.tar.gz)
set(FFI_CPE "cpe:2.3:a:libffi_project:libffi:${FFI_VERSION}:*:*:*:*:*:*:*")
set(LZMA_VERSION 5.2.5)
set(LZMA_URI https://tukaani.org/xz/xz-${LZMA_VERSION}.tar.bz2)
@@ -389,26 +430,26 @@ set(LZMA_HASH 5117f930900b341493827d63aa910ff5e011e0b994197c3b71c08a20228a42df)
set(LZMA_HASH_TYPE SHA256)
set(LZMA_FILE xz-${LZMA_VERSION}.tar.bz2)
if(BLENDER_PLATFORM_ARM)
# Need at least 1.1.1i for aarch64 support (https://github.com/openssl/openssl/pull/13218)
set(SSL_VERSION 1.1.1i)
set(SSL_URI https://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz)
set(SSL_HASH e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242)
set(SSL_HASH_TYPE SHA256)
set(SSL_FILE openssl-${SSL_VERSION}.tar.gz)
else()
set(SSL_VERSION 1.1.1g)
set(SSL_URI https://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz)
set(SSL_HASH ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46)
set(SSL_HASH_TYPE SHA256)
set(SSL_FILE openssl-${SSL_VERSION}.tar.gz)
endif()
# NOTE: This will *HAVE* to match the version python ships on windows which
# is hardcoded in pythons PCbuild/get_externals.bat. For compliance reasons there
# can be no exceptions to this.
set(SSL_VERSION 1.1.1q)
set(SSL_URI https://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz)
set(SSL_HASH d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca)
set(SSL_HASH_TYPE SHA256)
set(SSL_FILE openssl-${SSL_VERSION}.tar.gz)
set(SSL_CPE "cpe:2.3:a:openssl:openssl:${SSL_VERSION}:*:*:*:*:*:*:*")
set(SQLITE_VERSION 3.31.1)
set(SQLITE_URI https://www.sqlite.org/2018/sqlite-src-3240000.zip)
set(SQLITE_HASH fb558c49ee21a837713c4f1e7e413309aabdd9c7)
# Note: This will *HAVE* to match the version python ships on windows which
# is hardcoded in pythons PCbuild/get_externals.bat for compliance reasons there
# can be no exceptions to this.
set(SQLITE_VERSION 3.37.2)
set(SQLLITE_LONG_VERSION 3370200)
set(SQLITE_URI https://www.sqlite.org/2022/sqlite-autoconf-${SQLLITE_LONG_VERSION}.tar.gz)
set(SQLITE_HASH e56faacadfb4154f8fbd0f2a3f827d13706b70a1)
set(SQLITE_HASH_TYPE SHA1)
set(SQLITE_FILE sqlite-src-3240000.zip)
set(SQLITE_FILE sqlite-autoconf-${SQLLITE_LONG_VERSION}.tar.gz)
set(SQLITE_CPE "cpe:2.3:a:sqlite:sqlite:${SQLITE_VERSION}:*:*:*:*:*:*:*")
set(EMBREE_VERSION 3.13.4)
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
@@ -439,12 +480,14 @@ set(MESA_URI ftp://ftp.freedesktop.org/pub/mesa/mesa-${MESA_VERSION}.tar.xz)
set(MESA_HASH 022c7293074aeeced2278c872db4fa693147c70f8595b076cf3f1ef81520766d)
set(MESA_HASH_TYPE SHA256)
set(MESA_FILE mesa-${MESA_VERSION}.tar.xz)
set(MESA_CPE "cpe:2.3:a:mesa3d:mesa:${MESA_VERSION}:*:*:*:*:*:*:*")
set(NASM_VERSION 2.15.02)
set(NASM_URI https://github.com/netwide-assembler/nasm/archive/nasm-${NASM_VERSION}.tar.gz)
set(NASM_HASH aded8b796c996a486a56e0515c83e414116decc3b184d88043480b32eb0a8589)
set(NASM_HASH_TYPE SHA256)
set(NASM_FILE nasm-${NASM_VERSION}.tar.gz)
set(NASM_PCE "cpe:2.3:a:nasm:nasm:${NASM_VERSION}:*:*:*:*:*:*:*")
set(XR_OPENXR_SDK_VERSION 1.0.22)
set(XR_OPENXR_SDK_URI https://github.com/KhronosGroup/OpenXR-SDK/archive/release-${XR_OPENXR_SDK_VERSION}.tar.gz)
@@ -469,12 +512,14 @@ set(GMP_URI https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.xz)
set(GMP_HASH 0b82665c4a92fd2ade7440c13fcaa42b)
set(GMP_HASH_TYPE MD5)
set(GMP_FILE gmp-${GMP_VERSION}.tar.xz)
set(GMP_CPE "cpe:2.3:a:gmplib:gmp:${GMP_VERSION}:*:*:*:*:*:*:*")
set(POTRACE_VERSION 1.16)
set(POTRACE_URI http://potrace.sourceforge.net/download/${POTRACE_VERSION}/potrace-${POTRACE_VERSION}.tar.gz)
set(POTRACE_HASH 5f0bd87ddd9a620b0c4e65652ef93d69)
set(POTRACE_HASH_TYPE MD5)
set(POTRACE_FILE potrace-${POTRACE_VERSION}.tar.gz)
set(POTRACE_CPE "cpe:2.3:a:icoasoft:potrace:${POTRACE_VERSION}:*:*:*:*:*:*:*")
set(HARU_VERSION 2_3_0)
set(HARU_URI https://github.com/libharu/libharu/archive/RELEASE_${HARU_VERSION}.tar.gz)
@@ -487,15 +532,17 @@ set(ZSTD_URI https://github.com/facebook/zstd/releases/download/v${ZSTD_VERSION}
set(ZSTD_HASH 5194fbfa781fcf45b98c5e849651aa7b3b0a008c6b72d4a0db760f3002291e94)
set(ZSTD_HASH_TYPE SHA256)
set(ZSTD_FILE zstd-${ZSTD_VERSION}.tar.gz)
set(ZSTD_CPE "cpe:2.3:a:facebook:zstandard:${ZSTD_VERSION}:*:*:*:*:*:*:*")
set(SSE2NEON_GIT https://github.com/DLTcollab/sse2neon.git)
set(SSE2NEON_GIT_HASH fe5ff00bb8d19b327714a3c290f3e2ce81ba3525)
set(BROTLI_VERSION v1.0.9)
set(BROTLI_URI https://github.com/google/brotli/archive/refs/tags/${BROTLI_VERSION}.tar.gz)
set(BROTLI_VERSION 1.0.9)
set(BROTLI_URI https://github.com/google/brotli/archive/refs/tags/v${BROTLI_VERSION}.tar.gz)
set(BROTLI_HASH f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46)
set(BROTLI_HASH_TYPE SHA256)
set(BROTLI_FILE brotli-${BROTLI_VERSION}.tar.gz)
set(BROTLI_FILE brotli-v${BROTLI_VERSION}.tar.gz)
set(BROTLI_CPE "cpe:2.3:a:google:brotli:${BROTLI_VERSION}:*:*:*:*:*:*:*")
set(LEVEL_ZERO_VERSION v1.7.15)
set(LEVEL_ZERO_URI https://github.com/oneapi-src/level-zero/archive/refs/tags/${LEVEL_ZERO_VERSION}.tar.gz)

View File

@@ -1,20 +1,48 @@
# SPDX-License-Identifier: GPL-2.0-or-later
ExternalProject_Add(external_xml2
URL file://${PACKAGE_DIR}/${XML2_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${XML2_HASH_TYPE}=${XML2_HASH}
PREFIX ${BUILD_DIR}/xml2
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && ${CONFIGURE_COMMAND}
--prefix=${LIBDIR}/xml2
--disable-shared
--enable-static
--with-pic
--with-python=no
--with-lzma=no
--with-zlib=no
--with-iconv=no
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && make install
INSTALL_DIR ${LIBDIR}/xml2
)
if(WIN32)
set(XML2_EXTRA_ARGS
-DLIBXML2_WITH_ZLIB=OFF
-DLIBXML2_WITH_LZMA=OFF
-DLIBXML2_WITH_PYTHON=OFF
-DLIBXML2_WITH_ICONV=OFF
-DLIBXML2_WITH_TESTS=OFF
-DLIBXML2_WITH_PROGRAMS=OFF
-DBUILD_SHARED_LIBS=OFF
)
ExternalProject_Add(external_xml2
URL file://${PACKAGE_DIR}/${XML2_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${XML2_HASH_TYPE}=${XML2_HASH}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/xml2 ${DEFAULT_CMAKE_FLAGS} ${XML2_EXTRA_ARGS}
PREFIX ${BUILD_DIR}/xml2
INSTALL_DIR ${LIBDIR}/xml2
)
else()
ExternalProject_Add(external_xml2
URL file://${PACKAGE_DIR}/${XML2_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${XML2_HASH_TYPE}=${XML2_HASH}
PREFIX ${BUILD_DIR}/xml2
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && ${CONFIGURE_COMMAND}
--prefix=${LIBDIR}/xml2
--disable-shared
--enable-static
--with-pic
--with-python=no
--with-lzma=no
--with-zlib=no
--with-iconv=no
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && make install
INSTALL_DIR ${LIBDIR}/xml2
)
endif()
if(WIN32 AND BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_xml2 after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/xml2/include ${HARVEST_TARGET}/xml2/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/xml2/lib/libxml2s.lib ${HARVEST_TARGET}/xml2/lib/libxml2s.lib
DEPENDEES install
)
endif()

View File

@@ -1,96 +1,114 @@
strict graph {
graph[autosize = false, size = "25.7,8.3!", resolution = 300, overlap = false, splines = false, outputorder=edgesfirst ];
node [style=filled fillcolor=white];
external_alembic -- external_boost;
external_alembic -- external_zlib;
graph[autosize = false, size = "25.7,8.3!", resolution = 300];
external_alembic -- external_openexr;
external_alembic -- external_imath;
external_blosc -- external_zlib;
external_blosc -- external_pthreads;
external_boost -- Make_Python_Environment;
external_clang -- ll;
external_boost -- external_python;
external_boost -- external_numpy;
external_dpcpp -- external_python;
external_dpcpp -- external_python_site_packages;
external_dpcpp -- external_vcintrinsics;
external_dpcpp -- external_openclheaders;
external_dpcpp -- external_icdloader;
external_dpcpp -- external_mp11;
external_dpcpp -- external_level_zero;
external_dpcpp -- external_spirvheaders;
external_embree -- external_tbb;
external_ffmpeg -- external_zlib;
external_ffmpeg -- external_faad;
external_ffmpeg -- external_openjpeg;
external_ffmpeg -- external_xvidcore;
external_ffmpeg -- external_x264;
external_ffmpeg -- external_opus;
external_ffmpeg -- external_vpx;
external_ffmpeg -- external_theora;
external_ffmpeg -- external_vorbis;
external_ffmpeg -- external_ogg;
external_ffmpeg -- external_lame;
external_ffmpeg -- external_aom;
external_ffmpeg -- external_zlib_mingw;
external_numpy -- Make_Python_Environment;
external_ffmpeg -- external_nasm;
external_freetype -- external_brotli;
external_freetype -- external_zlib;
external_gmpxx -- external_gmp;
external_igc_llvm -- external_igc_opencl_clang;
external_igc_spirv_translator -- external_igc_opencl_clang;
external_igc -- external_igc_vcintrinsics;
external_igc -- external_igc_llvm;
external_igc -- external_igc_opencl_clang;
external_igc -- external_igc_vcintrinsics;
external_igc -- external_igc_spirv_headers;
external_igc -- external_igc_spirv_tools;
external_igc -- external_igc_spirv_translator;
external_igc -- external_flex;
external_ispc -- ll;
external_ispc -- external_python;
external_ispc -- external_flexbison;
external_ispc -- external_flex;
ll -- external_xml2;
ll -- external_python;
external_mesa -- ll;
external_numpy -- external_python;
external_numpy -- external_python_site_packages;
external_ocloc -- external_igc;
external_ocloc -- external_gmmlib;
external_opencollada -- external_xml2;
external_opencolorio -- external_boost;
external_opencolorio -- external_tinyxml;
external_opencolorio -- external_yamlcpp;
external_opencolorio -- external_expat;
external_opencolorio -- external_imath;
external_opencolorio -- external_pystring;
external_openexr -- external_zlib;
external_openimagedenoise -- external_tbb;
external_openimagedenoise -- external_ispc;
external_openimagedenoise -- external_python;
external_openimageio -- external_png;
external_openimageio -- external_zlib;
external_openimageio -- external_openexr;
external_openimageio -- external_openexr;
external_openimageio -- external_imath;
external_openimageio -- external_jpeg;
external_openimageio -- external_boost;
external_openimageio -- external_tiff;
external_openimageio -- external_opencolorio;
external_openimageio -- external_pugixml;
external_openimageio -- external_fmt;
external_openimageio -- external_robinmap;
external_openimageio -- external_openjpeg;
external_openimageio -- external_webp;
external_openimageio -- external_opencolorio_extra;
external_openmp -- external_clang;
external_openmp -- ll;
external_openpgl -- external_tbb;
external_opensubdiv -- external_tbb;
openvdb -- external_tbb;
openvdb -- external_boost;
openvdb -- external_openexr;
openvdb -- external_openexr;
openvdb -- external_zlib;
openvdb -- external_blosc;
external_osl -- external_boost;
external_osl -- ll;
external_osl -- external_clang;
external_osl -- external_openexr;
external_osl -- external_openexr;
external_osl -- external_zlib;
external_osl -- external_flexbison;
external_osl -- external_openimageio;
external_osl -- external_pugixml;
external_osl -- external_flexbison;
external_osl -- external_flex;
external_png -- external_zlib;
external_python_site_packages -- Make_Python_Environment;
external_python -- external_bzip2;
external_python -- external_ffi;
external_python -- external_lzma;
external_python -- external_ssl;
external_python -- external_sqlite;
external_python -- external_zlib;
external_python_site_packages -- external_python;
external_sndfile -- external_ogg;
external_sndfile -- external_vorbis;
external_sndfile -- external_flac;
external_theora -- external_vorbis;
external_theora -- external_ogg;
external_tiff -- external_zlib;
external_usd -- external_tbb;
external_usd -- external_boost;
external_usd -- external_opensubdiv;
external_vorbis -- external_ogg;
blender-- external_ffmpeg;
blender-- external_alembic;
blender-- external_openjpeg;
blender-- external_opencolorio;
blender-- external_openexr;
blender-- external_opensubdiv;
blender-- openvdb;
blender-- external_osl;
blender-- external_boost;
blender-- external_jpeg;
blender-- external_png;
blender-- external_python;
blender-- external_sndfile;
blender-- external_iconv;
blender-- external_fftw3;
external_python-- external_python_site_packages;
external_python_site_packages-- requests;
external_python_site_packages-- idna;
external_python_site_packages-- chardet;
external_python_site_packages-- urllib3;
external_python_site_packages-- certifi;
external_python-- external_numpy;
external_usd-- external_boost;
external_usd-- external_tbb;
blender-- external_opencollada;
blender-- external_sdl;
blender-- external_freetype;
blender-- external_pthreads;
blender-- external_zlib;
blender-- external_openal;
blender-- external_usd;
external_wayland -- external_expat;
external_wayland -- external_xml2;
external_wayland -- external_ffi;
external_wayland_protocols -- external_wayland;
external_x264 -- external_nasm;
}

View File

@@ -0,0 +1,18 @@
diff -Naur libaom-3.4.0/build/cmake/aom_configure.cmake external_aom/build/cmake/aom_configure.cmake
--- libaom-3.4.0/build/cmake/aom_configure.cmake 2022-06-17 11:46:18 -0600
+++ external_aom/build/cmake/aom_configure.cmake 2022-10-16 15:35:54 -0600
@@ -15,8 +15,12 @@
include(FindGit)
include(FindPerl)
-include(FindThreads)
-
+# Blender: This will drag in a dep on libwinpthreads which we prefer
+# not to have, aom will fallback on a native win32 thread wrapper
+# if pthreads are not found.
+if(NOT WIN32)
+ include(FindThreads)
+endif()
include("${AOM_ROOT}/build/cmake/aom_config_defaults.cmake")
include("${AOM_ROOT}/build/cmake/aom_experiment_deps.cmake")
include("${AOM_ROOT}/build/cmake/aom_optimization.cmake")

View File

@@ -68,34 +68,18 @@
+
return ret;
}
--- a/libavcodec/rl.c
+++ b/libavcodec/rl.c
@@ -71,17 +71,19 @@
av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size)
{
int i, q;
- VLC_TYPE table[1500][2] = {{0}};
+ VLC_TYPE (*table)[2] = av_calloc(sizeof(VLC_TYPE), 1500 * 2);
VLC vlc = { .table = table, .table_allocated = static_size };
- av_assert0(static_size <= FF_ARRAY_ELEMS(table));
+ av_assert0(static_size < 1500);
init_vlc(&vlc, 9, rl->n + 1, &rl->table_vlc[0][1], 4, 2, &rl->table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC);
diff --git a/libavcodec/x86/simple_idct.asm b/libavcodec/x86/simple_idct.asm
index dcf0da6df121..982b2f0bbba1 100644
--- a/libavcodec/x86/simple_idct.asm
+++ b/libavcodec/x86/simple_idct.asm
@@ -25,9 +25,9 @@
for (q = 0; q < 32; q++) {
int qmul = q * 2;
int qadd = (q - 1) | 1;
%include "libavutil/x86/x86util.asm"
- if (!rl->rl_vlc[q])
+ if (!rl->rl_vlc[q]){
+ av_free(table);
return;
+ }
-%if ARCH_X86_32
SECTION_RODATA
if (q == 0) {
qmul = 1;
@@ -113,4 +115,5 @@
rl->rl_vlc[q][i].run = run;
}
}
+ av_free(table);
}
+%if ARCH_X86_32
cextern pb_80
wm1010: dw 0, 0xffff, 0, 0xffff

View File

@@ -0,0 +1,15 @@
--- a/mpz/inp_raw.c Tue Dec 22 23:49:51 2020 +0100
+++ b/mpz/inp_raw.c Thu Oct 21 19:06:49 2021 +0200
@@ -88,8 +88,11 @@
abs_csize = ABS (csize);
+ if (UNLIKELY (abs_csize > ~(mp_bitcnt_t) 0 / 8))
+ return 0; /* Bit size overflows */
+
/* round up to a multiple of limbs */
- abs_xsize = BITS_TO_LIMBS (abs_csize*8);
+ abs_xsize = BITS_TO_LIMBS ((mp_bitcnt_t) abs_csize * 8);
if (abs_xsize != 0)
{

View File

@@ -130,3 +130,28 @@ index 715d903..24423ce 100644
{
string id = node.attribute("id").value();
size_t line = node.line();
diff -Naur a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -274,7 +274,7 @@
add_subdirectory(${EXTERNAL_LIBRARIES}/UTF)
add_subdirectory(common/libBuffer)
add_subdirectory(${EXTERNAL_LIBRARIES}/MathMLSolver)
-add_subdirectory(${EXTERNAL_LIBRARIES}/zlib)
+#add_subdirectory(${EXTERNAL_LIBRARIES}/zlib)
# building OpenCOLLADA libs
add_subdirectory(COLLADABaseUtils)
@@ -284,10 +284,10 @@
add_subdirectory(COLLADAStreamWriter)
# building COLLADAValidator app
-add_subdirectory(COLLADAValidator)
+#add_subdirectory(COLLADAValidator)
# DAE validator app
-add_subdirectory(DAEValidator)
+#add_subdirectory(DAEValidator)
# Library export
install(EXPORT LibraryExport DESTINATION ${OPENCOLLADA_INST_CMAKECONFIG} FILE OpenCOLLADATargets.cmake)

View File

@@ -14,3 +14,15 @@ index 7b894a45..92618215 100644
)
if(CMAKE_TOOLCHAIN_FILE)
set(pystring_CMAKE_ARGS
--- a/src/OpenColorIO/FileRules.cpp
+++ b/src/OpenColorIO/FileRules.cpp
@@ -7,6 +7,9 @@
#include <regex>
#include <sstream>
+/* NOTE: this has been applied up-stream, this edit can be removed after upgrading OpenColorIO. */
+#include <cstring>
+
#include <OpenColorIO/OpenColorIO.h>
#include "CustomKeys.h"

View File

@@ -1,8 +1,34 @@
diff -Naur OpenShadingLanguage-Release-1.9.9/src/include/OSL/llvm_util.h external_osl/src/include/OSL/llvm_util.h
--- OpenShadingLanguage-Release-1.9.9/src/include/OSL/llvm_util.h 2018-05-01 16:39:02 -0600
+++ external_osl/src/include/OSL/llvm_util.h 2018-08-25 14:05:00 -0600
@@ -33,6 +33,8 @@
diff -Naur OpenShadingLanguage-1.12.6.2/CMakeLists.txt external_osl/CMakeLists.txt
--- OpenShadingLanguage-1.12.6.2/CMakeLists.txt 2022-09-30 17:43:53 -0600
+++ external_osl/CMakeLists.txt 2022-10-15 14:49:26 -0600
@@ -101,6 +101,11 @@
CACHE STRING "Directory where OptiX PTX files will be installed")
set (CMAKE_DEBUG_POSTFIX "" CACHE STRING "Library naming postfix for Debug builds (e.g., '_debug')")
+set (USE_OIIO_STATIC ON CACHE BOOL "If OIIO is built static")
+if (USE_OIIO_STATIC)
+ add_definitions ("-DOIIO_STATIC_BUILD=1")
+ add_definitions ("-DOIIO_STATIC_DEFINE=1")
+endif ()
set (OSL_NO_DEFAULT_TEXTURESYSTEM OFF CACHE BOOL "Do not use create a raw OIIO::TextureSystem")
if (OSL_NO_DEFAULT_TEXTURESYSTEM)
diff -Naur OpenShadingLanguage-1.12.6.2/src/cmake/externalpackages.cmake external_osl/src/cmake/externalpackages.cmake
--- OpenShadingLanguage-1.12.6.2/src/cmake/externalpackages.cmake 2022-09-30 17:43:53 -0600
+++ external_osl/src/cmake/externalpackages.cmake 2022-10-15 14:49:26 -0600
@@ -77,6 +77,7 @@
checked_find_package (ZLIB REQUIRED) # Needed by several packages
+checked_find_package (PNG REQUIRED) # Needed since OIIO needs it
# IlmBase & OpenEXR
checked_find_package (OpenEXR REQUIRED
diff -Naur OpenShadingLanguage-1.12.6.2/src/include/OSL/llvm_util.h external_osl/src/include/OSL/llvm_util.h
--- OpenShadingLanguage-1.12.6.2/src/include/OSL/llvm_util.h 2022-09-30 17:43:53 -0600
+++ external_osl/src/include/OSL/llvm_util.h 2022-10-15 15:37:24 -0600
@@ -9,6 +9,8 @@
#include <unordered_set>
#include <vector>
+#define OSL_HAS_BLENDER_CLEANUP_FIX
@@ -10,58 +36,17 @@ diff -Naur OpenShadingLanguage-Release-1.9.9/src/include/OSL/llvm_util.h externa
#ifdef LLVM_NAMESPACE
namespace llvm = LLVM_NAMESPACE;
#endif
@@ -487,6 +489,7 @@
std::string func_name (llvm::Function *f);
static size_t total_jit_memory_held ();
+ static void Cleanup ();
private:
class MemoryManager;
diff -Naur OpenShadingLanguage-Release-1.9.9/src/liboslexec/llvm_util.cpp external_osl/src/liboslexec/llvm_util.cpp
--- OpenShadingLanguage-Release-1.9.9/src/liboslexec/llvm_util.cpp 2018-05-01 16:39:02 -0600
+++ external_osl/src/liboslexec/llvm_util.cpp 2018-08-25 14:04:27 -0600
@@ -140,7 +140,10 @@
};
@@ -101,6 +103,6 @@
ScopedJitMemoryUser();
~ScopedJitMemoryUser();
};
-
+void LLVM_Util::Cleanup ()
+{
+ if(jitmm_hold) jitmm_hold->clear();
+}
size_t
LLVM_Util::total_jit_memory_held ()
diff -Naur org/CMakeLists.txt external_osl/CMakeLists.txt
--- org/CMakeLists.txt 2020-12-01 12:37:15 -0700
+++ external_osl/CMakeLists.txt 2021-01-20 13:26:50 -0700
@@ -84,6 +84,11 @@
CACHE STRING "Directory where OptiX PTX files will be installed")
set (CMAKE_DEBUG_POSTFIX "" CACHE STRING "Library naming postfix for Debug builds (e.g., '_debug')")
+set (USE_OIIO_STATIC ON CACHE BOOL "If OIIO is built static")
+if (USE_OIIO_STATIC)
+ add_definitions ("-DOIIO_STATIC_BUILD=1")
+ add_definitions ("-DOIIO_STATIC_DEFINE=1")
+endif ()
set (OSL_NO_DEFAULT_TEXTURESYSTEM OFF CACHE BOOL "Do not use create a raw OIIO::TextureSystem")
if (OSL_NO_DEFAULT_TEXTURESYSTEM)
diff -Naur external_osl_orig/src/cmake/externalpackages.cmake external_osl/src/cmake/externalpackages.cmake
--- external_osl_orig/src/cmake/externalpackages.cmake 2021-06-01 13:44:18 -0600
+++ external_osl/src/cmake/externalpackages.cmake 2021-06-28 07:44:32 -0600
@@ -80,6 +80,7 @@
checked_find_package (ZLIB REQUIRED) # Needed by several packages
+checked_find_package (PNG REQUIRED) # Needed since OIIO needs it
# IlmBase & OpenEXR
checked_find_package (OpenEXR REQUIRED
diff -Naur external_osl_orig/src/liboslcomp/oslcomp.cpp external_osl/src/liboslcomp/oslcomp.cpp
--- external_osl_orig/src/liboslcomp/oslcomp.cpp 2021-06-01 13:44:18 -0600
+++ external_osl/src/liboslcomp/oslcomp.cpp 2021-06-28 09:11:06 -0600
+ static void Cleanup ();
/// Set debug level
void debug(int d) { m_debug = d; }
diff -Naur OpenShadingLanguage-1.12.6.2/src/liboslcomp/oslcomp.cpp external_osl/src/liboslcomp/oslcomp.cpp
--- OpenShadingLanguage-1.12.6.2/src/liboslcomp/oslcomp.cpp 2022-09-30 17:43:53 -0600
+++ external_osl/src/liboslcomp/oslcomp.cpp 2022-10-15 14:49:26 -0600
@@ -21,6 +21,13 @@
#if !defined(__STDC_CONSTANT_MACROS)
# define __STDC_CONSTANT_MACROS 1
@@ -76,3 +61,20 @@ diff -Naur external_osl_orig/src/liboslcomp/oslcomp.cpp external_osl/src/liboslc
#include <clang/Basic/TargetInfo.h>
#include <clang/Frontend/CompilerInstance.h>
#include <clang/Frontend/TextDiagnosticPrinter.h>
diff -Naur OpenShadingLanguage-1.12.6.2/src/liboslexec/llvm_util.cpp external_osl/src/liboslexec/llvm_util.cpp
--- OpenShadingLanguage-1.12.6.2/src/liboslexec/llvm_util.cpp 2022-09-30 17:43:53 -0600
+++ external_osl/src/liboslexec/llvm_util.cpp 2022-10-15 15:53:11 -0600
@@ -182,6 +180,13 @@
++jit_mem_hold_users;
}
+void
+LLVM_Util::Cleanup()
+{
+ if (jitmm_hold)
+ jitmm_hold->clear();
+}
+
LLVM_Util::ScopedJitMemoryUser::~ScopedJitMemoryUser()
{

View File

@@ -1,24 +0,0 @@
diff -Naur orig/PCbuild/get_externals.bat Python-3.10.2/PCbuild/get_externals.bat
--- orig/PCbuild/get_externals.bat 2022-01-13 11:52:14 -0700
+++ Python-3.10.2/PCbuild/get_externals.bat 2022-08-17 11:24:42 -0600
@@ -51,7 +51,7 @@
echo.Fetching external libraries...
set libraries=
-set libraries=%libraries% bzip2-1.0.6
+set libraries=%libraries% bzip2-1.0.8
if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi-3.3.0
if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1m
set libraries=%libraries% sqlite-3.35.5.0
diff -Naur orig/PCbuild/python.props external_python/PCbuild/python.props
--- orig/PCbuild/python.props 2022-01-13 11:52:14 -0700
+++ external_python/PCbuild/python.props 2022-08-17 11:38:38 -0600
@@ -58,7 +58,7 @@
<ExternalsDir Condition="$(ExternalsDir) == ''">$([System.IO.Path]::GetFullPath(`$(PySourcePath)externals`))</ExternalsDir>
<ExternalsDir Condition="!HasTrailingSlash($(ExternalsDir))">$(ExternalsDir)\</ExternalsDir>
<sqlite3Dir>$(ExternalsDir)sqlite-3.35.5.0\</sqlite3Dir>
- <bz2Dir>$(ExternalsDir)bzip2-1.0.6\</bz2Dir>
+ <bz2Dir>$(ExternalsDir)bzip2-1.0.8\</bz2Dir>
<lzmaDir>$(ExternalsDir)xz-5.2.2\</lzmaDir>
<libffiDir>$(ExternalsDir)libffi-3.3.0\</libffiDir>
<libffiOutDir>$(ExternalsDir)libffi-3.3.0\$(ArchName)\</libffiOutDir>

View File

@@ -1,42 +0,0 @@
--- src/Makefile.in 2017-09-26 01:28:47.000000000 +0300
+++ src/Makefile.in 2017-09-26 01:19:06.000000000 +0300
@@ -513,7 +513,7 @@
libcommon_la_SOURCES = common.c file_io.c command.c pcm.c ulaw.c alaw.c \
float32.c double64.c ima_adpcm.c ms_adpcm.c gsm610.c dwvw.c vox_adpcm.c \
interleave.c strings.c dither.c cart.c broadcast.c audio_detect.c \
- ima_oki_adpcm.c ima_oki_adpcm.h alac.c chunk.c ogg.c chanmap.c \
+ ima_oki_adpcm.c ima_oki_adpcm.h alac.c chunk.c ogg.c chanmap.c \
windows.c id3.c $(WIN_VERSION_FILE)
@@ -719,10 +719,10 @@
$(AM_V_CCLD)$(LINK) $(GSM610_libgsm_la_OBJECTS) $(GSM610_libgsm_la_LIBADD) $(LIBS)
libcommon.la: $(libcommon_la_OBJECTS) $(libcommon_la_DEPENDENCIES) $(EXTRA_libcommon_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libcommon_la_OBJECTS) $(libcommon_la_LIBADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(libcommon_la_OBJECTS) $(libcommon_la_LIBADD) $(LIBS) $(EXTERNAL_XIPH_LIBS)
libsndfile.la: $(libsndfile_la_OBJECTS) $(libsndfile_la_DEPENDENCIES) $(EXTRA_libsndfile_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libsndfile_la_LINK) -rpath $(libdir) $(libsndfile_la_OBJECTS) $(libsndfile_la_LIBADD) $(LIBS)
+ $(AM_V_CCLD)$(libsndfile_la_LINK) -rpath $(libdir) $(libsndfile_la_OBJECTS) $(libsndfile_la_LIBADD) $(LIBS) $(EXTERNAL_XIPH_LIBS)
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
@@ -924,7 +924,7 @@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsndfile_la_CPPFLAGS) $(CPPFLAGS) $(libsndfile_la_CFLAGS) $(CFLAGS) -c -o libsndfile_la-dwd.lo `test -f 'dwd.c' || echo '$(srcdir)/'`dwd.c
libsndfile_la-flac.lo: flac.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsndfile_la_CPPFLAGS) $(CPPFLAGS) $(libsndfile_la_CFLAGS) $(CFLAGS) -MT libsndfile_la-flac.lo -MD -MP -MF $(DEPDIR)/libsndfile_la-flac.Tpo -c -o libsndfile_la-flac.lo `test -f 'flac.c' || echo '$(srcdir)/'`flac.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsndfile_la_CPPFLAGS) $(CPPFLAGS) $(libsndfile_la_CFLAGS) $(CFLAGS) $(EXTERNAL_XIPH_CFLAGS) -MT libsndfile_la-flac.lo -MD -MP -MF $(DEPDIR)/libsndfile_la-flac.Tpo -c -o libsndfile_la-flac.lo `test -f 'flac.c' || echo '$(srcdir)/'`flac.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsndfile_la-flac.Tpo $(DEPDIR)/libsndfile_la-flac.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flac.c' object='libsndfile_la-flac.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@@ -1092,7 +1092,7 @@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsndfile_la_CPPFLAGS) $(CPPFLAGS) $(libsndfile_la_CFLAGS) $(CFLAGS) -c -o libsndfile_la-rf64.lo `test -f 'rf64.c' || echo '$(srcdir)/'`rf64.c
libsndfile_la-ogg_vorbis.lo: ogg_vorbis.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsndfile_la_CPPFLAGS) $(CPPFLAGS) $(libsndfile_la_CFLAGS) $(CFLAGS) -MT libsndfile_la-ogg_vorbis.lo -MD -MP -MF $(DEPDIR)/libsndfile_la-ogg_vorbis.Tpo -c -o libsndfile_la-ogg_vorbis.lo `test -f 'ogg_vorbis.c' || echo '$(srcdir)/'`ogg_vorbis.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsndfile_la_CPPFLAGS) $(CPPFLAGS) $(libsndfile_la_CFLAGS) $(CFLAGS) $(EXTERNAL_XIPH_CFLAGS) -MT libsndfile_la-ogg_vorbis.lo -MD -MP -MF $(DEPDIR)/libsndfile_la-ogg_vorbis.Tpo -c -o libsndfile_la-ogg_vorbis.lo `test -f 'ogg_vorbis.c' || echo '$(srcdir)/'`ogg_vorbis.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsndfile_la-ogg_vorbis.Tpo $(DEPDIR)/libsndfile_la-ogg_vorbis.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ogg_vorbis.c' object='libsndfile_la-ogg_vorbis.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@

View File

@@ -1,14 +0,0 @@
Only in external_sqlite_orig: config.log
diff -ru external_sqlite_orig/config.sub external_sqlite/config.sub
--- external_sqlite_orig/config.sub 2020-07-10 14:06:42.000000000 +0200
+++ external_sqlite/config.sub 2020-07-10 14:10:24.000000000 +0200
@@ -314,6 +314,7 @@
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
+ | aarch64-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
Only in external_sqlite: mksourceid
Only in external_sqlite: sqlite3session.h

View File

@@ -0,0 +1,10 @@
--- ./test/v3ext.c 2022-07-05 11:08:33.000000000 +0200
+++ ./test/v3ext.c 2022-10-18 13:58:05.000000000 +0200
@@ -8,6 +8,7 @@
*/
#include <stdio.h>
+#include <string.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
#include <openssl/pem.h>

View File

@@ -71,21 +71,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenSubdiv DEFAULT_MSG
IF(OPENSUBDIV_FOUND)
SET(OPENSUBDIV_LIBRARIES ${_opensubdiv_LIBRARIES})
SET(OPENSUBDIV_INCLUDE_DIRS ${OPENSUBDIV_INCLUDE_DIR})
# Find available compute controllers.
FIND_PACKAGE(OpenMP)
IF(OPENMP_FOUND)
SET(OPENSUBDIV_HAS_OPENMP TRUE)
ELSE()
SET(OPENSUBDIV_HAS_OPENMP FALSE)
ENDIF()
OPENSUBDIV_CHECK_CONTROLLER("tbbEvaluator.h" OPENSUBDIV_HAS_TBB)
OPENSUBDIV_CHECK_CONTROLLER("clEvaluator.h" OPENSUBDIV_HAS_OPENCL)
OPENSUBDIV_CHECK_CONTROLLER("cudaEvaluator.h" OPENSUBDIV_HAS_CUDA)
OPENSUBDIV_CHECK_CONTROLLER("glXFBEvaluator.h" OPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK)
OPENSUBDIV_CHECK_CONTROLLER("glComputeEvaluator.h" OPENSUBDIV_HAS_GLSL_COMPUTE)
ENDIF()
MARK_AS_ADVANCED(

View File

@@ -48,7 +48,7 @@ if(MSVC)
else()
set(PACKAGE_ARCH windows32)
endif()
else(MSVC)
else()
set(PACKAGE_ARCH ${CMAKE_SYSTEM_PROCESSOR})
endif()

View File

@@ -113,7 +113,7 @@ endif()
if(WITH_PYTHON)
# Use precompiled libraries by default.
set(PYTHON_VERSION 3.10)
SET(PYTHON_VERSION 3.10 CACHE STRING "Python Version (major and minor only)")
if(NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
# Normally cached but not since we include them with blender.
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")

View File

@@ -16,9 +16,16 @@ if(NOT DEFINED LIBDIR)
# Choose the best suitable libraries.
if(EXISTS ${LIBDIR_NATIVE_ABI})
set(LIBDIR ${LIBDIR_NATIVE_ABI})
set(WITH_LIBC_MALLOC_HOOK_WORKAROUND True)
elseif(EXISTS ${LIBDIR_CENTOS7_ABI})
set(LIBDIR ${LIBDIR_CENTOS7_ABI})
set(WITH_CXX11_ABI OFF)
if(WITH_MEM_JEMALLOC)
# jemalloc provides malloc hooks.
set(WITH_LIBC_MALLOC_HOOK_WORKAROUND False)
else()
set(WITH_LIBC_MALLOC_HOOK_WORKAROUND True)
endif()
if(CMAKE_COMPILER_IS_GNUCC AND
CMAKE_C_COMPILER_VERSION VERSION_LESS 9.3)

View File

@@ -378,7 +378,6 @@ if(WITH_OPENCOLLADA)
optimized ${OPENCOLLADA}/lib/opencollada/OpenCOLLADAStreamWriter.lib
optimized ${OPENCOLLADA}/lib/opencollada/MathMLSolver.lib
optimized ${OPENCOLLADA}/lib/opencollada/GeneratedSaxParser.lib
optimized ${OPENCOLLADA}/lib/opencollada/xml.lib
optimized ${OPENCOLLADA}/lib/opencollada/buffer.lib
optimized ${OPENCOLLADA}/lib/opencollada/ftoa.lib
@@ -388,10 +387,14 @@ if(WITH_OPENCOLLADA)
debug ${OPENCOLLADA}/lib/opencollada/OpenCOLLADAStreamWriter_d.lib
debug ${OPENCOLLADA}/lib/opencollada/MathMLSolver_d.lib
debug ${OPENCOLLADA}/lib/opencollada/GeneratedSaxParser_d.lib
debug ${OPENCOLLADA}/lib/opencollada/xml_d.lib
debug ${OPENCOLLADA}/lib/opencollada/buffer_d.lib
debug ${OPENCOLLADA}/lib/opencollada/ftoa_d.lib
)
if(EXISTS ${LIBDIR}/xml2/lib/libxml2s.lib) # 3.4 libraries
list(APPEND OPENCOLLADA_LIBRARIES ${LIBDIR}/xml2/lib/libxml2s.lib)
else()
list(APPEND OPENCOLLADA_LIBRARIES ${OPENCOLLADA}/lib/opencollada/xml.lib)
endif()
list(APPEND OPENCOLLADA_LIBRARIES ${OPENCOLLADA}/lib/opencollada/UTF.lib)
@@ -497,7 +500,7 @@ if(WITH_JACK)
endif()
if(WITH_PYTHON)
set(PYTHON_VERSION 3.10) # CACHE STRING)
SET(PYTHON_VERSION 3.10 CACHE STRING "Python Version (major and minor only)")
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
set(PYTHON_LIBRARY ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/libs/python${_PYTHON_VERSION_NO_DOTS}.lib)
@@ -692,11 +695,11 @@ endif()
if(WITH_IMAGE_OPENJPEG)
set(OPENJPEG ${LIBDIR}/openjpeg)
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include/openjpeg-2.4)
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include/openjpeg-2.5)
if(NOT EXISTS "${OPENJPEG_INCLUDE_DIRS}")
# when not found, could be an older lib folder with openjpeg 2.3
# to ease the transition period, fall back if 2.4 is not found.
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include/openjpeg-2.3)
# when not found, could be an older lib folder with openjpeg 2.4
# to ease the transition period, fall back if 2.5 is not found.
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include/openjpeg-2.4)
endif()
set(OPENJPEG_LIBRARIES ${OPENJPEG}/lib/openjp2.lib)
endif()
@@ -713,12 +716,6 @@ if(WITH_OPENSUBDIV)
debug ${OPENSUBDIV_LIBPATH}/osdCPU_d.lib
debug ${OPENSUBDIV_LIBPATH}/osdGPU_d.lib
)
set(OPENSUBDIV_HAS_OPENMP TRUE)
set(OPENSUBDIV_HAS_TBB FALSE)
set(OPENSUBDIV_HAS_OPENCL TRUE)
set(OPENSUBDIV_HAS_CUDA FALSE)
set(OPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK TRUE)
set(OPENSUBDIV_HAS_GLSL_COMPUTE TRUE)
endif()
endif()

View File

@@ -55,7 +55,7 @@ buildbot:
cuda11:
version: '11.4.1'
hip:
version: '5.2.21440'
version: '5.3.22480'
optix:
version: '7.3.0'
cmake:

View File

@@ -36,7 +36,16 @@ def parse_arguments():
parser.add_argument("--svn-command", default="svn")
parser.add_argument("--svn-branch", default=None)
parser.add_argument("--git-command", default="git")
# NOTE: Both old and new style command line flags, so that the Buildbot can use the new style.
# It is not possible to know from the Buildbot which style to use when building patches.
#
# Acts as an alias: `use_centos_libraries or use_linux_libraries`.
parser.add_argument("--use-centos-libraries", action="store_true")
parser.add_argument("--use-linux-libraries", action="store_true")
parser.add_argument("--architecture", type=str, choices=("x86_64", "amd64", "arm64",))
return parser.parse_args()
@@ -45,6 +54,16 @@ def get_blender_git_root():
# Setup for precompiled libraries and tests from svn.
def get_effective_architecture(args):
if args.architecture:
return args.architecture
# Check platform.version to detect arm64 with x86_64 python binary.
if "ARM64" in platform.version():
return "arm64"
return platform.machine().lower()
def svn_update(args, release_version):
svn_non_interactive = [args.svn_command, '--non-interactive']
@@ -53,11 +72,12 @@ def svn_update(args, release_version):
svn_url = make_utils.svn_libraries_base_url(release_version, args.svn_branch)
# Checkout precompiled libraries
architecture = get_effective_architecture(args)
if sys.platform == 'darwin':
if platform.machine() == 'x86_64':
lib_platform = "darwin"
elif platform.machine() == 'arm64':
if architecture == 'arm64':
lib_platform = "darwin_arm64"
elif architecture == 'x86_64':
lib_platform = "darwin"
else:
lib_platform = None
elif sys.platform == 'win32':
@@ -65,7 +85,7 @@ def svn_update(args, release_version):
# this script is bundled as part of the precompiled libraries. However it
# is used by the buildbot.
lib_platform = "win64_vc15"
elif args.use_centos_libraries:
elif args.use_centos_libraries or args.use_linux_libraries:
lib_platform = "linux_centos7_x86_64"
else:
# No precompiled libraries for Linux.
@@ -229,14 +249,15 @@ if __name__ == "__main__":
blender_skip_msg = ""
submodules_skip_msg = ""
# Test if we are building a specific release version.
branch = make_utils.git_branch(args.git_command)
if branch == 'HEAD':
sys.stderr.write('Blender git repository is in detached HEAD state, must be in a branch\n')
sys.exit(1)
tag = make_utils.git_tag(args.git_command)
release_version = make_utils.git_branch_release_version(branch, tag)
blender_version = make_utils. parse_blender_version()
if blender_version.cycle != 'alpha':
major = blender_version.version // 100
minor = blender_version.version % 100
branch = f"blender-v{major}.{minor}-release"
release_version = f"{major}.{minor}"
else:
branch = 'main'
release_version = None
if not args.no_libraries:
svn_update(args, release_version)

View File

@@ -9,6 +9,7 @@ import re
import shutil
import subprocess
import sys
from pathlib import Path
def call(cmd, exit_on_error=True, silent=False):
@@ -101,3 +102,52 @@ def command_missing(command):
return shutil.which(command) is None
else:
return False
class BlenderVersion:
def __init__(self, version, patch, cycle):
# 293 for 2.93.1
self.version = version
# 1 for 2.93.1
self.patch = patch
# 'alpha', 'beta', 'release', maybe others.
self.cycle = cycle
def is_release(self) -> bool:
return self.cycle == "release"
def __str__(self) -> str:
"""Convert to version string.
>>> str(BlenderVersion(293, 1, "alpha"))
'2.93.1-alpha'
>>> str(BlenderVersion(327, 0, "release"))
'3.27.0'
"""
version_major = self.version // 100
version_minor = self.version % 100
as_string = f"{version_major}.{version_minor}.{self.patch}"
if self.is_release():
return as_string
return f"{as_string}-{self.cycle}"
def parse_blender_version() -> BlenderVersion:
blender_srcdir = Path(__file__).absolute().parent.parent.parent
version_path = blender_srcdir / "source/blender/blenkernel/BKE_blender_version.h"
version_info = {}
line_re = re.compile(r"^#define (BLENDER_VERSION[A-Z_]*)\s+([0-9a-z]+)$")
with version_path.open(encoding="utf-8") as version_file:
for line in version_file:
match = line_re.match(line.strip())
if not match:
continue
version_info[match.group(1)] = match.group(2)
return BlenderVersion(
int(version_info["BLENDER_VERSION"]),
int(version_info["BLENDER_VERSION_PATCH"]),
version_info["BLENDER_VERSION_CYCLE"],
)

View File

@@ -27,6 +27,7 @@
#include <memory>
#include <vector>
#include <unordered_map>
#include <string>
AUD_NAMESPACE_BEGIN

View File

@@ -253,7 +253,7 @@ static int hipewHipInit(void) {
/* Default installation path. */
const char *hip_paths[] = {"", NULL};
#else
const char *hip_paths[] = {"/opt/rocm/hip/lib/libamdhip64.so", NULL};
const char *hip_paths[] = {"libamdhip64.so", "/opt/rocm/hip/lib/libamdhip64.so", NULL};
#endif
static int initialized = 0;
static int result = 0;

View File

@@ -13,7 +13,7 @@ def _configure_argument_parser():
action='store_true')
parser.add_argument("--cycles-device",
help="Set the device to use for Cycles, overriding user preferences and the scene setting."
"Valid options are 'CPU', 'CUDA', 'OPTIX', 'HIP' or 'METAL'."
"Valid options are 'CPU', 'CUDA', 'OPTIX', 'HIP', 'ONEAPI', or 'METAL'."
"Additionally, you can append '+CPU' to any GPU type for hybrid rendering.",
default=None)
return parser

View File

@@ -91,7 +91,7 @@ class AddPresetPerformance(AddPresetBase, Operator):
preset_menu = "CYCLES_PT_performance_presets"
preset_defines = [
"render = bpy.context.scene.render"
"render = bpy.context.scene.render",
"cycles = bpy.context.scene.cycles"
]

View File

@@ -1558,9 +1558,9 @@ class CyclesPreferences(bpy.types.AddonPreferences):
import sys
col.label(text="Requires Intel GPU with Xe-HPG architecture", icon='BLANK1')
if sys.platform.startswith("win"):
col.label(text="and Windows driver version 101.3268 or newer", icon='BLANK1')
col.label(text="and Windows driver version 101.3430 or newer", icon='BLANK1')
elif sys.platform.startswith("linux"):
col.label(text="and Linux driver version xx.xx.23570 or newer", icon='BLANK1')
col.label(text="and Linux driver version xx.xx.23904 or newer", icon='BLANK1')
elif device_type == 'METAL':
col.label(text="Requires Apple Silicon with macOS 12.2 or newer", icon='BLANK1')
col.label(text="or AMD with macOS 12.3 or newer", icon='BLANK1')

View File

@@ -72,6 +72,11 @@ bool BlenderImageLoader::load_metadata(const ImageDeviceFeatures &, ImageMetaDat
metadata.colorspace = u_colorspace_raw;
}
else {
/* In some cases (e.g. T94135), the colorspace setting in Blender gets updated as part of the
* metadata queries in this function, so update the colorspace setting here. */
PointerRNA colorspace_ptr = b_image.colorspace_settings().ptr;
metadata.colorspace = get_enum_identifier(colorspace_ptr, "name");
if (metadata.channels == 1) {
metadata.type = IMAGE_DATA_TYPE_BYTE;
}

View File

@@ -224,27 +224,24 @@ static void export_pointcloud_motion(PointCloud *pointcloud,
const int num_points = pointcloud->num_points();
float3 *mP = attr_mP->data_float3() + motion_step * num_points;
bool have_motion = false;
int num_motion_points = 0;
const array<float3> &pointcloud_points = pointcloud->get_points();
const int b_points_num = b_pointcloud.points.length();
BL::FloatVectorAttribute b_attr_position = find_position_attribute(b_pointcloud);
std::optional<BL::FloatAttribute> b_attr_radius = find_radius_attribute(b_pointcloud);
for (int i = 0; i < num_points; i++) {
if (num_motion_points < num_points) {
const float3 co = get_float3(b_attr_position.data[i].vector());
const float radius = b_attr_radius ? b_attr_radius->data[i].value() : 0.0f;
float3 P = co;
P.w = radius;
mP[num_motion_points] = P;
have_motion = have_motion || (P != pointcloud_points[num_motion_points]);
num_motion_points++;
}
for (int i = 0; i < std::min(num_points, b_points_num); i++) {
const float3 co = get_float3(b_attr_position.data[i].vector());
const float radius = b_attr_radius ? b_attr_radius->data[i].value() : 0.0f;
float3 P = co;
P.w = radius;
mP[i] = P;
have_motion = have_motion || (P != pointcloud_points[i]);
}
/* In case of new attribute, we verify if there really was any motion. */
if (new_attribute) {
if (num_motion_points != num_points || !have_motion) {
if (b_points_num != num_points || !have_motion) {
pointcloud->attributes.remove(ATTR_STD_MOTION_VERTEX_POSITION);
}
else if (motion_step > 0) {

View File

@@ -657,6 +657,7 @@ void BlenderSession::bake(BL::Depsgraph &b_depsgraph_,
session->set_display_driver(nullptr);
session->set_output_driver(make_unique<BlenderOutputDriver>(b_engine));
session->full_buffer_written_cb = [&](string_view filename) { full_buffer_written(filename); };
/* Sync scene. */
BL::Object b_camera_override(b_engine.camera_override());
@@ -698,6 +699,10 @@ void BlenderSession::bake(BL::Depsgraph &b_depsgraph_,
BufferParams buffer_params;
buffer_params.width = bake_width;
buffer_params.height = bake_height;
buffer_params.window_width = bake_width;
buffer_params.window_height = bake_height;
/* Unique layer name for multi-image baking. */
buffer_params.layer = string_printf("bake_%d\n", bake_id++);
/* Update session. */
session->reset(session_params, buffer_params);
@@ -711,8 +716,6 @@ void BlenderSession::bake(BL::Depsgraph &b_depsgraph_,
session->start();
session->wait();
}
session->set_output_driver(nullptr);
}
void BlenderSession::synchronize(BL::Depsgraph &b_depsgraph_)

View File

@@ -146,6 +146,8 @@ class BlenderSession {
BlenderDisplayDriver *display_driver_ = nullptr;
vector<string> full_buffer_files_;
int bake_id = 0;
};
CCL_NAMESPACE_END

View File

@@ -205,7 +205,9 @@ static void set_default_value(ShaderInput *input,
}
case SocketType::INT: {
if (b_sock.type() == BL::NodeSocket::type_BOOLEAN) {
node->set(socket, get_boolean(b_sock.ptr, "default_value"));
/* Make sure to call the int overload of set() since this is an integer socket as far as
* Cycles is concerned. */
node->set(socket, get_boolean(b_sock.ptr, "default_value") ? 1 : 0);
}
else {
node->set(socket, get_int(b_sock.ptr, "default_value"));

View File

@@ -679,14 +679,18 @@ void BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, BL::ViewLayer &b_v
}
/* Cryptomatte stores two ID/weight pairs per RGBA layer.
* User facing parameter is the number of pairs. */
* User facing parameter is the number of pairs.
*
* NOTE: Name channels lowercase rgba so that compression rules check in OpenEXR DWA code uses
* loseless compression. Reportedly this naming is the only one which works good from the
* interoperability point of view. Using xyzw naming is not portable. */
int crypto_depth = divide_up(min(16, b_view_layer.pass_cryptomatte_depth()), 2);
scene->film->set_cryptomatte_depth(crypto_depth);
CryptomatteType cryptomatte_passes = CRYPT_NONE;
if (b_view_layer.use_pass_cryptomatte_object()) {
for (int i = 0; i < crypto_depth; i++) {
string passname = cryptomatte_prefix + string_printf("Object%02d", i);
b_engine.add_pass(passname.c_str(), 4, "RGBA", b_view_layer.name().c_str());
b_engine.add_pass(passname.c_str(), 4, "rgba", b_view_layer.name().c_str());
pass_add(scene, PASS_CRYPTOMATTE, passname.c_str());
}
cryptomatte_passes = (CryptomatteType)(cryptomatte_passes | CRYPT_OBJECT);
@@ -694,7 +698,7 @@ void BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, BL::ViewLayer &b_v
if (b_view_layer.use_pass_cryptomatte_material()) {
for (int i = 0; i < crypto_depth; i++) {
string passname = cryptomatte_prefix + string_printf("Material%02d", i);
b_engine.add_pass(passname.c_str(), 4, "RGBA", b_view_layer.name().c_str());
b_engine.add_pass(passname.c_str(), 4, "rgba", b_view_layer.name().c_str());
pass_add(scene, PASS_CRYPTOMATTE, passname.c_str());
}
cryptomatte_passes = (CryptomatteType)(cryptomatte_passes | CRYPT_MATERIAL);
@@ -702,7 +706,7 @@ void BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, BL::ViewLayer &b_v
if (b_view_layer.use_pass_cryptomatte_asset()) {
for (int i = 0; i < crypto_depth; i++) {
string passname = cryptomatte_prefix + string_printf("Asset%02d", i);
b_engine.add_pass(passname.c_str(), 4, "RGBA", b_view_layer.name().c_str());
b_engine.add_pass(passname.c_str(), 4, "rgba", b_view_layer.name().c_str());
pass_add(scene, PASS_CRYPTOMATTE, passname.c_str());
}
cryptomatte_passes = (CryptomatteType)(cryptomatte_passes | CRYPT_ASSET);

View File

@@ -496,7 +496,7 @@ bool BVHMetal::build_BLAS_pointcloud(Progress &progress,
num_motion_steps = pointcloud->get_motion_steps();
}
const size_t num_aabbs = num_motion_steps;
const size_t num_aabbs = num_motion_steps * num_points;
MTLResourceOptions storage_mode;
if (device.hasUnifiedMemory) {
@@ -757,6 +757,10 @@ bool BVHMetal::build_TLAS(Progress &progress,
}
}
if (num_instances == 0) {
return false;
}
/*------------------------------------------------*/
BVH_status("Building TLAS | %7d instances", (int)num_instances);
/*------------------------------------------------*/

View File

@@ -301,6 +301,9 @@ void MetalDevice::make_source(MetalPipelineType pso_type, const uint kernel_feat
MD5Hash md5;
md5.append(baked_constants);
md5.append(source);
if (use_metalrt) {
md5.append(std::to_string(kernel_features & METALRT_FEATURE_MASK));
}
source_md5[pso_type] = md5.get_hex();
}
@@ -335,6 +338,14 @@ bool MetalDevice::compile_and_load(MetalPipelineType pso_type)
MTLCompileOptions *options = [[MTLCompileOptions alloc] init];
#if defined(MAC_OS_VERSION_13_0)
if (@available(macos 13.0, *)) {
if (device_vendor == METAL_GPU_INTEL) {
[options setOptimizationLevel:MTLLibraryOptimizationLevelSize];
}
}
#endif
options.fastMathEnabled = YES;
if (@available(macOS 12.0, *)) {
options.languageVersion = MTLLanguageVersion2_4;

View File

@@ -54,6 +54,10 @@ enum MetalPipelineType {
PSO_NUM
};
# define METALRT_FEATURE_MASK \
(KERNEL_FEATURE_HAIR | KERNEL_FEATURE_HAIR_THICK | KERNEL_FEATURE_POINTCLOUD | \
KERNEL_FEATURE_OBJECT_MOTION)
const char *kernel_type_as_string(MetalPipelineType pso_type);
struct MetalKernelPipeline {
@@ -67,9 +71,7 @@ struct MetalKernelPipeline {
KernelData kernel_data_;
bool use_metalrt;
bool metalrt_hair;
bool metalrt_hair_thick;
bool metalrt_pointcloud;
uint32_t metalrt_features = 0;
int threads_per_threadgroup;

View File

@@ -225,12 +225,9 @@ void ShaderCache::load_kernel(DeviceKernel device_kernel,
/* metalrt options */
request.pipeline->use_metalrt = device->use_metalrt;
request.pipeline->metalrt_hair = device->use_metalrt &&
(device->kernel_features & KERNEL_FEATURE_HAIR);
request.pipeline->metalrt_hair_thick = device->use_metalrt &&
(device->kernel_features & KERNEL_FEATURE_HAIR_THICK);
request.pipeline->metalrt_pointcloud = device->use_metalrt &&
(device->kernel_features & KERNEL_FEATURE_POINTCLOUD);
request.pipeline->metalrt_features = device->use_metalrt ?
(device->kernel_features & METALRT_FEATURE_MASK) :
0;
{
thread_scoped_lock lock(cache_mutex);
@@ -267,9 +264,13 @@ MetalKernelPipeline *ShaderCache::get_best_pipeline(DeviceKernel kernel, const M
/* metalrt options */
bool use_metalrt = device->use_metalrt;
bool metalrt_hair = use_metalrt && (device->kernel_features & KERNEL_FEATURE_HAIR);
bool metalrt_hair_thick = use_metalrt && (device->kernel_features & KERNEL_FEATURE_HAIR_THICK);
bool metalrt_pointcloud = use_metalrt && (device->kernel_features & KERNEL_FEATURE_POINTCLOUD);
bool device_metalrt_hair = use_metalrt && device->kernel_features & KERNEL_FEATURE_HAIR;
bool device_metalrt_hair_thick = use_metalrt &&
device->kernel_features & KERNEL_FEATURE_HAIR_THICK;
bool device_metalrt_pointcloud = use_metalrt &&
device->kernel_features & KERNEL_FEATURE_POINTCLOUD;
bool device_metalrt_motion = use_metalrt &&
device->kernel_features & KERNEL_FEATURE_OBJECT_MOTION;
MetalKernelPipeline *best_pipeline = nullptr;
for (auto &pipeline : collection) {
@@ -278,9 +279,16 @@ MetalKernelPipeline *ShaderCache::get_best_pipeline(DeviceKernel kernel, const M
continue;
}
if (pipeline->use_metalrt != use_metalrt || pipeline->metalrt_hair != metalrt_hair ||
pipeline->metalrt_hair_thick != metalrt_hair_thick ||
pipeline->metalrt_pointcloud != metalrt_pointcloud) {
bool pipeline_metalrt_hair = pipeline->metalrt_features & KERNEL_FEATURE_HAIR;
bool pipeline_metalrt_hair_thick = pipeline->metalrt_features & KERNEL_FEATURE_HAIR_THICK;
bool pipeline_metalrt_pointcloud = pipeline->metalrt_features & KERNEL_FEATURE_POINTCLOUD;
bool pipeline_metalrt_motion = use_metalrt &&
pipeline->metalrt_features & KERNEL_FEATURE_OBJECT_MOTION;
if (pipeline->use_metalrt != use_metalrt || pipeline_metalrt_hair != device_metalrt_hair ||
pipeline_metalrt_hair_thick != device_metalrt_hair_thick ||
pipeline_metalrt_pointcloud != device_metalrt_pointcloud ||
pipeline_metalrt_motion != device_metalrt_motion) {
/* wrong combination of metalrt options */
continue;
}
@@ -308,22 +316,31 @@ MetalKernelPipeline *ShaderCache::get_best_pipeline(DeviceKernel kernel, const M
bool MetalKernelPipeline::should_use_binary_archive() const
{
if (auto str = getenv("CYCLES_METAL_DISABLE_BINARY_ARCHIVES")) {
if (atoi(str) != 0) {
/* Don't archive if we have opted out by env var. */
/* Issues with binary archives in older macOS versions. */
if (@available(macOS 13.0, *)) {
if (auto str = getenv("CYCLES_METAL_DISABLE_BINARY_ARCHIVES")) {
if (atoi(str) != 0) {
/* Don't archive if we have opted out by env var. */
return false;
}
}
/* Workaround for Intel GPU having issue using Binary Archives */
MetalGPUVendor gpu_vendor = MetalInfo::get_device_vendor(mtlDevice);
if (gpu_vendor == METAL_GPU_INTEL) {
return false;
}
}
if (pso_type == PSO_GENERIC) {
/* Archive the generic kernels. */
return true;
}
if (pso_type == PSO_GENERIC) {
/* Archive the generic kernels. */
return true;
}
if (device_kernel >= DEVICE_KERNEL_INTEGRATOR_SHADE_BACKGROUND &&
device_kernel <= DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW) {
/* Archive all shade kernels - they take a long time to compile. */
return true;
if (device_kernel >= DEVICE_KERNEL_INTEGRATOR_SHADE_BACKGROUND &&
device_kernel <= DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW) {
/* Archive all shade kernels - they take a long time to compile. */
return true;
}
}
/* The remaining kernels are all fast to compile. They may get cached by the system shader cache,
@@ -342,6 +359,8 @@ static MTLFunctionConstantValues *GetConstantValues(KernelData const *data = nul
if (!data) {
data = &zero_data;
}
int zero_int = 0;
[constant_values setConstantValue:&zero_int type:MTLDataType_int atIndex:Kernel_DummyConstant];
# define KERNEL_STRUCT_MEMBER(parent, _type, name) \
[constant_values setConstantValue:&data->parent.name \
@@ -372,10 +391,7 @@ void MetalKernelPipeline::compile()
MTLFunctionDescriptor *func_desc = [MTLIntersectionFunctionDescriptor functionDescriptor];
func_desc.name = entryPoint;
if (pso_type == PSO_SPECIALIZED_SHADE) {
func_desc.constantValues = GetConstantValues(&kernel_data_);
}
else if (pso_type == PSO_SPECIALIZED_INTERSECT) {
if (pso_type != PSO_GENERIC) {
func_desc.constantValues = GetConstantValues(&kernel_data_);
}
else {
@@ -420,6 +436,13 @@ void MetalKernelPipeline::compile()
const char *function_name = function_names[i];
desc.name = [@(function_name) copy];
if (pso_type != PSO_GENERIC) {
desc.constantValues = GetConstantValues(&kernel_data_);
}
else {
desc.constantValues = GetConstantValues();
}
NSError *error = NULL;
rt_intersection_function[i] = [mtlLibrary newFunctionWithDescriptor:desc error:&error];
@@ -440,6 +463,10 @@ void MetalKernelPipeline::compile()
NSArray *table_functions[METALRT_TABLE_NUM] = {nil};
NSArray *linked_functions = nil;
bool metalrt_hair = use_metalrt && (metalrt_features & KERNEL_FEATURE_HAIR);
bool metalrt_hair_thick = use_metalrt && (metalrt_features & KERNEL_FEATURE_HAIR_THICK);
bool metalrt_pointcloud = use_metalrt && (metalrt_features & KERNEL_FEATURE_POINTCLOUD);
if (use_metalrt) {
id<MTLFunction> curve_intersect_default = nil;
id<MTLFunction> curve_intersect_shadow = nil;
@@ -677,7 +704,8 @@ void MetalKernelPipeline::compile()
newIntersectionFunctionTableWithDescriptor:ift_desc];
/* Finally write the function handles into this pipeline's table */
for (int i = 0; i < 2; i++) {
int size = (int)[table_functions[table] count];
for (int i = 0; i < size; i++) {
id<MTLFunctionHandle> handle = [pipeline
functionHandleWithFunction:table_functions[table][i]];
[intersection_func_table[table] setFunction:handle atIndex:i];

View File

@@ -110,6 +110,12 @@ vector<id<MTLDevice>> const &MetalInfo::get_usable_devices()
usable |= (vendor == METAL_GPU_AMD);
}
#if defined(MAC_OS_VERSION_13_0)
if (@available(macos 13.0, *)) {
usable |= (vendor == METAL_GPU_INTEL);
}
#endif
if (usable) {
metal_printf("- %s\n", device_name.c_str());
[device retain];

View File

@@ -26,9 +26,12 @@ class HdCyclesVolumeLoader : public VDBImageLoader {
HdCyclesVolumeLoader(const std::string &filePath, const std::string &gridName)
: VDBImageLoader(gridName)
{
/* Disably delay loading and file copying, this has poor performance
* on network drivers. */
const bool delay_load = false;
openvdb::io::File file(filePath);
file.setCopyMaxBytes(0);
if (file.open()) {
if (file.open(delay_load)) {
grid = file.readGrid(gridName);
}
}

View File

@@ -191,6 +191,12 @@ bool PassAccessor::get_render_tile_pixels(const RenderBuffers *render_buffers,
* had the computation done. */
if (pass_info.num_components == 3) {
get_pass_float3(render_buffers, buffer_params, destination);
/* Use alpha for colors passes. */
if (type == PASS_DIFFUSE_COLOR || type == PASS_GLOSSY_COLOR ||
type == PASS_TRANSMISSION_COLOR) {
num_written_components = destination.num_components;
}
}
else if (pass_info.num_components == 4) {
if (destination.num_components == 3) {

View File

@@ -43,8 +43,11 @@ PathTrace::PathTrace(Device *device,
/* Create path tracing work in advance, so that it can be reused by incremental sampling as much
* as possible. */
device_->foreach_device([&](Device *path_trace_device) {
path_trace_works_.emplace_back(PathTraceWork::create(
path_trace_device, film, device_scene, &render_cancel_.is_requested));
unique_ptr<PathTraceWork> work = PathTraceWork::create(
path_trace_device, film, device_scene, &render_cancel_.is_requested);
if (work) {
path_trace_works_.emplace_back(std::move(work));
}
});
work_balance_infos_.resize(path_trace_works_.size());

View File

@@ -23,6 +23,10 @@ unique_ptr<PathTraceWork> PathTraceWork::create(Device *device,
if (device->info.type == DEVICE_CPU) {
return make_unique<PathTraceWorkCPU>(device, film, device_scene, cancel_requested_flag);
}
if (device->info.type == DEVICE_DUMMY) {
/* Dummy devices can't perform any work. */
return nullptr;
}
return make_unique<PathTraceWorkGPU>(device, film, device_scene, cancel_requested_flag);
}

View File

@@ -17,6 +17,9 @@ void work_balance_do_initial(vector<WorkBalanceInfo> &work_balance_infos)
work_balance_infos[0].weight = 1.0;
return;
}
else if (num_infos == 0) {
return;
}
/* There is no statistics available, so start with an equal distribution. */
const double weight = 1.0 / num_infos;

View File

@@ -563,13 +563,22 @@ if(WITH_CYCLES_HIP_BINARIES AND WITH_CYCLES_DEVICE_HIP)
if(WIN32)
set(hip_command ${CMAKE_COMMAND})
set(hip_flags
-E env "HIP_PATH=${HIP_ROOT_DIR}" "PATH=${HIP_PERL_DIR}"
-E env "HIP_PATH=${HIP_ROOT_DIR}"
${HIP_HIPCC_EXECUTABLE}.bat)
else()
set(hip_command ${HIP_HIPCC_EXECUTABLE})
set(hip_flags)
endif()
# There's a bug in the compiler causing some scenes to fail to render on Vega cards
# A workaround currently is to set -O1 opt level during kernel compilation for these
# cards Remove this when a newer compiler is available with fixes.
if(WIN32 AND (${arch} MATCHES "gfx90[a-z0-9]+"))
set(hip_opt_flags "-O1")
else()
set(hip_opt_flags)
endif()
set(hip_flags
${hip_flags}
--amdgpu-target=${arch}
@@ -586,6 +595,7 @@ if(WITH_CYCLES_HIP_BINARIES AND WITH_CYCLES_DEVICE_HIP)
-Wno-unused-value
--hipcc-func-supp
-ffast-math
${hip_opt_flags}
-o ${CMAKE_CURRENT_BINARY_DIR}/${hip_file})
if(WITH_NANOVDB)

View File

@@ -229,7 +229,7 @@ ccl_device_inline
/* Always use baked shadow transparency for curves. */
if (isect.type & PRIMITIVE_CURVE) {
*r_throughput *= intersection_curve_shadow_transparency(
kg, isect.object, isect.prim, isect.u);
kg, isect.object, isect.prim, isect.type, isect.u);
if (*r_throughput < CURVE_SHADOW_TRANSPARENCY_CUTOFF) {
return true;

View File

@@ -190,10 +190,8 @@ ccl_device_inline int intersection_find_attribute(KernelGlobals kg,
/* Cut-off value to stop transparent shadow tracing when practically opaque. */
#define CURVE_SHADOW_TRANSPARENCY_CUTOFF 0.001f
ccl_device_inline float intersection_curve_shadow_transparency(KernelGlobals kg,
const int object,
const int prim,
const float u)
ccl_device_inline float intersection_curve_shadow_transparency(
KernelGlobals kg, const int object, const int prim, const int type, const float u)
{
/* Find attribute. */
const int offset = intersection_find_attribute(kg, object, ATTR_STD_SHADOW_TRANSPARENCY);
@@ -204,7 +202,7 @@ ccl_device_inline float intersection_curve_shadow_transparency(KernelGlobals kg,
/* Interpolate transparency between curve keys. */
const KernelCurve kcurve = kernel_data_fetch(curves, prim);
const int k0 = kcurve.first_key + PRIMITIVE_UNPACK_SEGMENT(kcurve.type);
const int k0 = kcurve.first_key + PRIMITIVE_UNPACK_SEGMENT(type);
const int k1 = k0 + 1;
const float f0 = kernel_data_fetch(attributes_float, offset + k0);

View File

@@ -49,11 +49,11 @@ KERNEL_STRUCT_BEGIN(KernelBVH, bvh)
KERNEL_STRUCT_MEMBER(bvh, int, root)
KERNEL_STRUCT_MEMBER(bvh, int, have_motion)
KERNEL_STRUCT_MEMBER(bvh, int, have_curves)
KERNEL_STRUCT_MEMBER(bvh, int, have_points)
KERNEL_STRUCT_MEMBER(bvh, int, have_volumes)
KERNEL_STRUCT_MEMBER(bvh, int, bvh_layout)
KERNEL_STRUCT_MEMBER(bvh, int, use_bvh_steps)
KERNEL_STRUCT_MEMBER(bvh, int, curve_subdivisions)
KERNEL_STRUCT_MEMBER(bvh, int, pad1)
KERNEL_STRUCT_MEMBER(bvh, int, pad2)
KERNEL_STRUCT_END(KernelBVH)
/* Film. */

View File

@@ -252,7 +252,7 @@ ccl_device void kernel_embree_filter_occluded_func(const RTCFilterFunctionNArgum
/* Always use baked shadow transparency for curves. */
if (current_isect.type & PRIMITIVE_CURVE) {
ctx->throughput *= intersection_curve_shadow_transparency(
kg, current_isect.object, current_isect.prim, current_isect.u);
kg, current_isect.object, current_isect.prim, current_isect.type, current_isect.u);
if (ctx->throughput < CURVE_SHADOW_TRANSPARENCY_CUTOFF) {
ctx->opaque_hit = true;

View File

@@ -79,7 +79,8 @@ ccl_device_intersect bool scene_intersect(KernelGlobals kg,
metal::raytracing::ray r(ray->P, ray->D, ray->tmin, ray->tmax);
metalrt_intersector_type metalrt_intersect;
if (!kernel_data.bvh.have_curves) {
bool triangle_only = !kernel_data.bvh.have_curves && !kernel_data.bvh.have_points;
if (triangle_only) {
metalrt_intersect.assume_geometry_type(metal::raytracing::geometry_type::triangle);
}
@@ -177,7 +178,9 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals kg,
metalrt_intersector_type metalrt_intersect;
metalrt_intersect.force_opacity(metal::raytracing::forced_opacity::non_opaque);
if (!kernel_data.bvh.have_curves) {
bool triangle_only = !kernel_data.bvh.have_curves && !kernel_data.bvh.have_points;
if (triangle_only) {
metalrt_intersect.assume_geometry_type(metal::raytracing::geometry_type::triangle);
}
@@ -205,7 +208,9 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals kg,
if (lcg_state) {
*lcg_state = payload.lcg_state;
}
*local_isect = payload.local_isect;
if (local_isect) {
*local_isect = payload.local_isect;
}
return payload.result;
}
@@ -240,7 +245,9 @@ ccl_device_intersect bool scene_intersect_shadow_all(KernelGlobals kg,
metalrt_intersector_type metalrt_intersect;
metalrt_intersect.force_opacity(metal::raytracing::forced_opacity::non_opaque);
if (!kernel_data.bvh.have_curves) {
bool triangle_only = !kernel_data.bvh.have_curves && !kernel_data.bvh.have_points;
if (triangle_only) {
metalrt_intersect.assume_geometry_type(metal::raytracing::geometry_type::triangle);
}
@@ -307,7 +314,9 @@ ccl_device_intersect bool scene_intersect_volume(KernelGlobals kg,
metalrt_intersector_type metalrt_intersect;
metalrt_intersect.force_opacity(metal::raytracing::forced_opacity::non_opaque);
if (!kernel_data.bvh.have_curves) {
bool triangle_only = !kernel_data.bvh.have_curves && !kernel_data.bvh.have_points;
if (triangle_only) {
metalrt_intersect.assume_geometry_type(metal::raytracing::geometry_type::triangle);
}

View File

@@ -29,28 +29,13 @@ using namespace metal::raytracing;
/* Qualifiers */
/* Inline everything for Apple GPUs. This gives ~1.1x speedup and 10% spill
* reduction for integator_shade_surface. However it comes at the cost of
* longer compile times (~4.5 minutes on M1 Max) and is disabled for that
* reason, until there is a user option to manually enable it. */
#if 0 // defined(__KERNEL_METAL_APPLE__)
# define ccl_device __attribute__((always_inline))
# define ccl_device_inline __attribute__((always_inline))
# define ccl_device_forceinline __attribute__((always_inline))
# define ccl_device_noinline __attribute__((always_inline))
#define ccl_device
#define ccl_device_inline ccl_device __attribute__((always_inline))
#define ccl_device_forceinline ccl_device __attribute__((always_inline))
#if defined(__KERNEL_METAL_APPLE__)
# define ccl_device_noinline ccl_device
#else
# define ccl_device
# define ccl_device_inline ccl_device
# define ccl_device_forceinline ccl_device
# if defined(__KERNEL_METAL_APPLE__)
# define ccl_device_noinline ccl_device
# else
# define ccl_device_noinline ccl_device __attribute__((noinline))
# endif
# define ccl_device_noinline ccl_device __attribute__((noinline))
#endif
#define ccl_device_noinline_cpu ccl_device

View File

@@ -34,21 +34,48 @@ class MetalKernelContext {
kernel_assert(0);
return 0;
}
#ifdef __KERNEL_METAL_INTEL__
template<typename TextureType, typename CoordsType>
inline __attribute__((__always_inline__))
auto ccl_gpu_tex_object_read_intel_workaround(TextureType texture_array,
const uint tid, const uint sid,
CoordsType coords) const
{
switch(sid) {
default:
case 0: return texture_array[tid].tex.sample(sampler(address::repeat, filter::nearest), coords);
case 1: return texture_array[tid].tex.sample(sampler(address::clamp_to_edge, filter::nearest), coords);
case 2: return texture_array[tid].tex.sample(sampler(address::clamp_to_zero, filter::nearest), coords);
case 3: return texture_array[tid].tex.sample(sampler(address::repeat, filter::linear), coords);
case 4: return texture_array[tid].tex.sample(sampler(address::clamp_to_edge, filter::linear), coords);
case 5: return texture_array[tid].tex.sample(sampler(address::clamp_to_zero, filter::linear), coords);
}
}
#endif
// texture2d
template<>
inline __attribute__((__always_inline__))
float4 ccl_gpu_tex_object_read_2D(ccl_gpu_tex_object_2D tex, float x, float y) const {
const uint tid(tex);
const uint sid(tex >> 32);
#ifndef __KERNEL_METAL_INTEL__
return metal_ancillaries->textures_2d[tid].tex.sample(metal_samplers[sid], float2(x, y));
#else
return ccl_gpu_tex_object_read_intel_workaround(metal_ancillaries->textures_2d, tid, sid, float2(x, y));
#endif
}
template<>
inline __attribute__((__always_inline__))
float ccl_gpu_tex_object_read_2D(ccl_gpu_tex_object_2D tex, float x, float y) const {
const uint tid(tex);
const uint sid(tex >> 32);
#ifndef __KERNEL_METAL_INTEL__
return metal_ancillaries->textures_2d[tid].tex.sample(metal_samplers[sid], float2(x, y)).x;
#else
return ccl_gpu_tex_object_read_intel_workaround(metal_ancillaries->textures_2d, tid, sid, float2(x, y)).x;
#endif
}
// texture3d
@@ -57,14 +84,22 @@ class MetalKernelContext {
float4 ccl_gpu_tex_object_read_3D(ccl_gpu_tex_object_3D tex, float x, float y, float z) const {
const uint tid(tex);
const uint sid(tex >> 32);
#ifndef __KERNEL_METAL_INTEL__
return metal_ancillaries->textures_3d[tid].tex.sample(metal_samplers[sid], float3(x, y, z));
#else
return ccl_gpu_tex_object_read_intel_workaround(metal_ancillaries->textures_3d, tid, sid, float3(x, y, z));
#endif
}
template<>
inline __attribute__((__always_inline__))
float ccl_gpu_tex_object_read_3D(ccl_gpu_tex_object_3D tex, float x, float y, float z) const {
const uint tid(tex);
const uint sid(tex >> 32);
#ifndef __KERNEL_METAL_INTEL__
return metal_ancillaries->textures_3d[tid].tex.sample(metal_samplers[sid], float3(x, y, z)).x;
#else
return ccl_gpu_tex_object_read_intel_workaround(metal_ancillaries->textures_3d, tid, sid, float3(x, y, z)).x;
#endif
}
# include "kernel/device/gpu/image.h"

View File

@@ -182,20 +182,20 @@ bool metalrt_shadow_all_hit(constant KernelParamsMetal &launch_params_metal,
const float u = barycentrics.x;
const float v = barycentrics.y;
int type = 0;
if (intersection_type == METALRT_HIT_TRIANGLE) {
type = kernel_data_fetch(objects, object).primitive_type;
}
const int prim_type = kernel_data_fetch(objects, object).primitive_type;
int type = prim_type;
# ifdef __HAIR__
else {
const KernelCurveSegment segment = kernel_data_fetch(curve_segments, prim);
type = segment.type;
prim = segment.prim;
/* Filter out curve endcaps */
if (u == 0.0f || u == 1.0f) {
/* continue search */
return true;
if (intersection_type != METALRT_HIT_TRIANGLE) {
if ( (prim_type == PRIMITIVE_CURVE_THICK || prim_type == PRIMITIVE_CURVE_RIBBON)) {
const KernelCurveSegment segment = kernel_data_fetch(curve_segments, prim);
type = segment.type;
prim = segment.prim;
/* Filter out curve endcaps */
if (u == 0.0f || u == 1.0f) {
/* continue search */
return true;
}
}
}
# endif
@@ -228,7 +228,7 @@ bool metalrt_shadow_all_hit(constant KernelParamsMetal &launch_params_metal,
/* Always use baked shadow transparency for curves. */
if (type & PRIMITIVE_CURVE) {
float throughput = payload.throughput;
throughput *= context.intersection_curve_shadow_transparency(nullptr, object, prim, u);
throughput *= context.intersection_curve_shadow_transparency(nullptr, object, prim, type, u);
payload.throughput = throughput;
payload.num_hits += 1;
@@ -279,7 +279,7 @@ bool metalrt_shadow_all_hit(constant KernelParamsMetal &launch_params_metal,
INTEGRATOR_STATE_ARRAY_WRITE(state, shadow_isect, record_index, prim) = prim;
INTEGRATOR_STATE_ARRAY_WRITE(state, shadow_isect, record_index, object) = object;
INTEGRATOR_STATE_ARRAY_WRITE(state, shadow_isect, record_index, type) = type;
/* Continue tracing. */
# endif /* __TRANSPARENT_SHADOWS__ */
#endif /* __SHADOW_RECORD_ALL__ */
@@ -327,7 +327,8 @@ inline TReturnType metalrt_visibility_test(
TReturnType result;
#ifdef __HAIR__
if (intersection_type == METALRT_HIT_BOUNDING_BOX) {
const int type = kernel_data_fetch(objects, object).primitive_type;
if (intersection_type == METALRT_HIT_BOUNDING_BOX && (type == PRIMITIVE_CURVE_THICK || type == PRIMITIVE_CURVE_RIBBON)) {
/* Filter out curve endcaps. */
if (u == 0.0f || u == 1.0f) {
result.accept = false;
@@ -463,7 +464,12 @@ ccl_device_inline void metalrt_intersection_curve_shadow(
const float ray_tmax,
thread BoundingBoxIntersectionResult &result)
{
# ifdef __VISIBILITY_FLAG__
const uint visibility = payload.visibility;
if ((kernel_data_fetch(objects, object).visibility & visibility) == 0) {
return;
}
# endif
Intersection isect;
isect.t = ray_tmax;
@@ -685,7 +691,12 @@ ccl_device_inline void metalrt_intersection_point_shadow(
const float ray_tmax,
thread BoundingBoxIntersectionResult &result)
{
# ifdef __VISIBILITY_FLAG__
const uint visibility = payload.visibility;
if ((kernel_data_fetch(objects, object).visibility & visibility) == 0) {
return;
}
# endif
Intersection isect;
isect.t = ray_tmax;

View File

@@ -196,9 +196,15 @@ ccl_always_inline float3 make_float3(float x)
* include oneAPI headers, which transitively include math.h headers which will cause redefinitions
* of the math defines because math.h also uses them and having them defined before math.h include
* is actually UB. */
/* Use fast math functions - get them from sycl::native namespace for native math function
* implementations */
#define cosf(x) sycl::native::cos(((float)(x)))
/* sycl::native::cos precision is not sufficient and -ffast-math lets
* the current DPC++ compiler overload sycl::cos with it.
* We work around this issue by directly calling the spirv implementation which
* provides greater precision. */
#if defined(__SYCL_DEVICE_ONLY__) && defined(__SPIR__)
# define cosf(x) __spirv_ocl_cos(((float)(x)))
#else
# define cosf(x) sycl::cos(((float)(x)))
#endif
#define sinf(x) sycl::native::sin(((float)(x)))
#define powf(x, y) sycl::native::powr(((float)(x)), ((float)(y)))
#define tanf(x) sycl::native::tan(((float)(x)))

View File

@@ -668,9 +668,9 @@ bool oneapi_enqueue_kernel(KernelContext *kernel_context,
/* Compute-runtime (ie. NEO) version is what gets returned by sycl/L0 on Windows
* since Windows driver 101.3268. */
/* The same min compute-runtime version is currently required across Windows and Linux.
* For Windows driver 101.3268, compute-runtime version is 23570. */
static const int lowest_supported_driver_version_win = 1013268;
static const int lowest_supported_driver_version_neo = 23570;
* For Windows driver 101.3430, compute-runtime version is 23904. */
static const int lowest_supported_driver_version_win = 1013430;
static const int lowest_supported_driver_version_neo = 23904;
static int parse_driver_build_version(const sycl::device &device)
{

View File

@@ -202,7 +202,7 @@ extern "C" __global__ void __anyhit__kernel_optix_shadow_all_hit()
/* Always use baked shadow transparency for curves. */
if (type & PRIMITIVE_CURVE) {
float throughput = __uint_as_float(optixGetPayload_1());
throughput *= intersection_curve_shadow_transparency(nullptr, object, prim, u);
throughput *= intersection_curve_shadow_transparency(nullptr, object, prim, type, u);
optixSetPayload_1(__float_as_uint(throughput));
optixSetPayload_2(uint16_pack_to_uint(num_recorded_hits, num_hits + 1));

View File

@@ -348,7 +348,9 @@ ccl_device_inline void kernel_accum_emission_or_background_pass(
}
# endif /* __DENOISING_FEATURES__ */
if (lightgroup != LIGHTGROUP_NONE && kernel_data.film.pass_lightgroup != PASS_UNUSED) {
const bool is_shadowcatcher = (path_flag & PATH_RAY_SHADOW_CATCHER_HIT) != 0;
if (!is_shadowcatcher && lightgroup != LIGHTGROUP_NONE &&
kernel_data.film.pass_lightgroup != PASS_UNUSED) {
kernel_write_pass_float3(buffer + kernel_data.film.pass_lightgroup + 3 * lightgroup,
contribution);
}
@@ -357,13 +359,12 @@ ccl_device_inline void kernel_accum_emission_or_background_pass(
/* Directly visible, write to emission or background pass. */
pass_offset = pass;
}
else if (kernel_data.kernel_features & KERNEL_FEATURE_LIGHT_PASSES) {
else if (is_shadowcatcher) {
/* Don't write any light passes for shadow catcher, for easier
* compositing back together of the combined pass. */
if (path_flag & PATH_RAY_SHADOW_CATCHER_HIT) {
return;
}
return;
}
else if (kernel_data.kernel_features & KERNEL_FEATURE_LIGHT_PASSES) {
if (path_flag & PATH_RAY_SURFACE_PASS) {
/* Indirectly visible through reflection. */
const float3 diffuse_weight = INTEGRATOR_STATE(state, path, pass_diffuse_weight);

View File

@@ -42,8 +42,8 @@ ccl_device_forceinline void kernel_write_denoising_features_surface(
if (kernel_data.film.pass_denoising_depth != PASS_UNUSED) {
const float3 denoising_feature_throughput = INTEGRATOR_STATE(
state, path, denoising_feature_throughput);
const float denoising_depth = ensure_finite(average(denoising_feature_throughput) *
sd->ray_length);
const float depth = sd->ray_length - INTEGRATOR_STATE(state, ray, tmin);
const float denoising_depth = ensure_finite(average(denoising_feature_throughput) * depth);
kernel_write_pass_float(buffer + kernel_data.film.pass_denoising_depth, denoising_depth);
}

View File

@@ -235,6 +235,21 @@ ccl_device_inline void film_get_pass_pixel_float3(ccl_global const KernelFilmCon
pixel[0] = f.x;
pixel[1] = f.y;
pixel[2] = f.z;
/* Optional alpha channel. */
if (kfilm_convert->num_components >= 4) {
if (kfilm_convert->pass_combined != PASS_UNUSED) {
float scale, scale_exposure;
film_get_scale_and_scale_exposure(kfilm_convert, buffer, &scale, &scale_exposure);
ccl_global const float *in_combined = buffer + kfilm_convert->pass_combined;
const float alpha = in_combined[3] * scale;
pixel[3] = film_transparency_to_alpha(alpha);
}
else {
pixel[3] = 1.0f;
}
}
}
/* --------------------------------------------------------------------

View File

@@ -89,7 +89,7 @@ ccl_device_noinline void motion_triangle_shader_setup(KernelGlobals kg,
float u = sd->u;
float v = sd->v;
float w = 1.0f - u - v;
sd->N = (w * normals[0] + u * normals[1] + v * normals[2]);
sd->N = safe_normalize(w * normals[0] + u * normals[1] + v * normals[2]);
}
}

View File

@@ -113,7 +113,7 @@ ccl_device bool integrator_init_from_bake(KernelGlobals kg,
if (prim == -1) {
/* Accumulate transparency for empty pixels. */
kernel_accum_transparent(kg, state, 0, 1.0f, buffer);
return false;
return true;
}
prim += kernel_data.bake.tri_offset;
@@ -160,6 +160,13 @@ ccl_device bool integrator_init_from_bake(KernelGlobals kg,
u = v;
v = 1.0f - tmp - v;
const float tmpdx = dudx;
const float tmpdy = dudy;
dudx = dvdx;
dudy = dvdy;
dvdx = -tmpdx - dvdx;
dvdy = -tmpdy - dvdy;
/* Position and normal on triangle. */
const int object = kernel_data.bake.object_index;
float3 P, Ng;

View File

@@ -185,8 +185,7 @@ ccl_device_inline void integrate_distant_lights(KernelGlobals kg,
/* Write to render buffer. */
const float3 throughput = INTEGRATOR_STATE(state, path, throughput);
kernel_accum_emission(
kg, state, throughput * light_eval, render_buffer, kernel_data.background.lightgroup);
kernel_accum_emission(kg, state, throughput * light_eval, render_buffer, ls.group);
}
}
}

View File

@@ -17,6 +17,8 @@
#include "kernel/osl/globals.h"
#include "kernel/osl/services.h"
#include "kernel/osl/shader.h"
#include "kernel/util/differential.h"
// clang-format on
#include "scene/attribute.h"
@@ -199,13 +201,20 @@ void OSLShader::eval_surface(const KernelGlobalsCPU *kg,
(void)found;
assert(found);
differential3 dP;
memcpy(&sd->P, data, sizeof(float) * 3);
memcpy(&sd->dP.dx, data + 3, sizeof(float) * 3);
memcpy(&sd->dP.dy, data + 6, sizeof(float) * 3);
memcpy(&dP.dx, data + 3, sizeof(float) * 3);
memcpy(&dP.dy, data + 6, sizeof(float) * 3);
object_position_transform(kg, sd, &sd->P);
object_dir_transform(kg, sd, &sd->dP.dx);
object_dir_transform(kg, sd, &sd->dP.dy);
object_dir_transform(kg, sd, &dP.dx);
object_dir_transform(kg, sd, &dP.dy);
const float dP_radius = differential_make_compact(dP);
make_orthonormals(sd->Ng, &sd->dP.dx, &sd->dP.dy);
sd->dP.dx *= dP_radius;
sd->dP.dy *= dP_radius;
globals->P = TO_VEC3(sd->P);
globals->dPdx = TO_VEC3(sd->dP.dx);

View File

@@ -122,6 +122,7 @@ shader node_image_texture(int use_mapping = 0,
vector Nob = transform("world", "object", N);
/* project from direction vector to barycentric coordinates in triangles */
vector signed_Nob = Nob;
Nob = vector(fabs(Nob[0]), fabs(Nob[1]), fabs(Nob[2]));
Nob /= (Nob[0] + Nob[1] + Nob[2]);
@@ -184,9 +185,10 @@ shader node_image_texture(int use_mapping = 0,
float tmp_alpha;
if (weight[0] > 0.0) {
point UV = point((signed_Nob[0] < 0.0) ? 1.0 - p[1] : p[1], p[2], 0.0);
Color += weight[0] * image_texture_lookup(filename,
p[1],
p[2],
UV[0],
UV[1],
tmp_alpha,
compress_as_srgb,
ignore_alpha,
@@ -198,9 +200,10 @@ shader node_image_texture(int use_mapping = 0,
Alpha += weight[0] * tmp_alpha;
}
if (weight[1] > 0.0) {
point UV = point((signed_Nob[1] > 0.0) ? 1.0 - p[0] : p[0], p[2], 0.0);
Color += weight[1] * image_texture_lookup(filename,
p[0],
p[2],
UV[0],
UV[1],
tmp_alpha,
compress_as_srgb,
ignore_alpha,
@@ -212,9 +215,10 @@ shader node_image_texture(int use_mapping = 0,
Alpha += weight[1] * tmp_alpha;
}
if (weight[2] > 0.0) {
point UV = point((signed_Nob[2] > 0.0) ? 1.0 - p[1] : p[1], p[0], 0.0);
Color += weight[2] * image_texture_lookup(filename,
p[1],
p[0],
UV[0],
UV[1],
tmp_alpha,
compress_as_srgb,
ignore_alpha,

View File

@@ -21,16 +21,19 @@ ccl_device_noinline void svm_node_enter_bump_eval(KernelGlobals kg,
const AttributeDescriptor desc = find_attribute(kg, sd, ATTR_STD_POSITION_UNDISPLACED);
if (desc.offset != ATTR_STD_NOT_FOUND) {
float3 P, dPdx, dPdy;
P = primitive_surface_attribute_float3(kg, sd, desc, &dPdx, &dPdy);
differential3 dP;
float3 P = primitive_surface_attribute_float3(kg, sd, desc, &dP.dx, &dP.dy);
object_position_transform(kg, sd, &P);
object_dir_transform(kg, sd, &dPdx);
object_dir_transform(kg, sd, &dPdy);
object_dir_transform(kg, sd, &dP.dx);
object_dir_transform(kg, sd, &dP.dy);
const float dP_radius = differential_make_compact(dP);
sd->P = P;
sd->dP.dx = dPdx;
sd->dP.dy = dPdy;
make_orthonormals(sd->Ng, &sd->dP.dx, &sd->dP.dy);
sd->dP.dx *= dP_radius;
sd->dP.dy *= dP_radius;
}
}

View File

@@ -193,8 +193,27 @@ bool OIIOImageLoader::load_pixels(const ImageMetaData &metadata,
return false;
}
const bool do_associate_alpha = associate_alpha &&
spec.get_int_attribute("oiio:UnassociatedAlpha", 0);
bool do_associate_alpha = false;
if (associate_alpha) {
do_associate_alpha = spec.get_int_attribute("oiio:UnassociatedAlpha", 0);
if (!do_associate_alpha && spec.alpha_channel != -1) {
/* Workaround OIIO not detecting TGA file alpha the same as Blender (since #3019).
* We want anything not marked as premultiplied alpha to get associated. */
if (strcmp(in->format_name(), "targa") == 0) {
do_associate_alpha = spec.get_int_attribute("targa:alpha_type", -1) != 4;
}
/* OIIO DDS reader never sets UnassociatedAlpha attribute. */
if (strcmp(in->format_name(), "dds") == 0) {
do_associate_alpha = true;
}
/* Workaround OIIO bug that sets oiio:UnassociatedAlpha on the last layer
* but not composite image that we read. */
if (strcmp(in->format_name(), "psd") == 0) {
do_associate_alpha = true;
}
}
}
switch (metadata.type) {
case IMAGE_DATA_TYPE_BYTE:

View File

@@ -57,7 +57,8 @@ struct UpdateObjectTransformState {
/* Flags which will be synchronized to Integrator. */
bool have_motion;
bool have_curves;
// bool have_points;
bool have_points;
bool have_volumes;
/* ** Scheduling queue. ** */
Scene *scene;
@@ -545,6 +546,12 @@ void ObjectManager::device_update_object_transform(UpdateObjectTransformState *s
if (geom->geometry_type == Geometry::HAIR) {
state->have_curves = true;
}
if (geom->geometry_type == Geometry::POINTCLOUD) {
state->have_points = true;
}
if (geom->geometry_type == Geometry::VOLUME) {
state->have_volumes = true;
}
/* Light group. */
auto it = scene->lightgroups.find(ob->lightgroup);
@@ -591,6 +598,8 @@ void ObjectManager::device_update_transforms(DeviceScene *dscene, Scene *scene,
state.need_motion = scene->need_motion();
state.have_motion = false;
state.have_curves = false;
state.have_points = false;
state.have_volumes = false;
state.scene = scene;
state.queue_start_object = 0;
@@ -658,6 +667,8 @@ void ObjectManager::device_update_transforms(DeviceScene *dscene, Scene *scene,
dscene->data.bvh.have_motion = state.have_motion;
dscene->data.bvh.have_curves = state.have_curves;
dscene->data.bvh.have_points = state.have_points;
dscene->data.bvh.have_volumes = state.have_volumes;
dscene->objects.clear_modified();
dscene->object_motion_pass.clear_modified();

View File

@@ -183,7 +183,7 @@ class VolumeMeshBuilder {
typename GridType::ValueOnIter iter = copy->beginValueOn();
for (; iter; ++iter) {
if (iter.getValue() < ValueType(volume_clipping)) {
if (openvdb::math::Abs(iter.getValue()) < ValueType(volume_clipping)) {
iter.setValueOff();
}
}
@@ -294,6 +294,14 @@ void VolumeMeshBuilder::create_mesh(vector<float3> &vertices,
#endif
}
#ifdef WITH_OPENVDB
static bool is_non_empty_leaf(const openvdb::MaskGrid::TreeType &tree, const openvdb::Coord coord)
{
auto *leaf_node = tree.probeLeaf(coord);
return (leaf_node && !leaf_node->isEmpty());
}
#endif
void VolumeMeshBuilder::generate_vertices_and_quads(vector<ccl::int3> &vertices_is,
vector<QuadData> &quads)
{
@@ -306,6 +314,10 @@ void VolumeMeshBuilder::generate_vertices_and_quads(vector<ccl::int3> &vertices_
unordered_map<size_t, int> used_verts;
for (auto iter = tree.cbeginLeaf(); iter; ++iter) {
if (iter->isEmpty()) {
continue;
}
openvdb::CoordBBox leaf_bbox = iter->getNodeBoundingBox();
/* +1 to convert from exclusive to include bounds. */
leaf_bbox.max() = leaf_bbox.max().offsetBy(1);
@@ -333,27 +345,27 @@ void VolumeMeshBuilder::generate_vertices_and_quads(vector<ccl::int3> &vertices_
static const int LEAF_DIM = openvdb::MaskGrid::TreeType::LeafNodeType::DIM;
auto center = leaf_bbox.min() + openvdb::Coord(LEAF_DIM / 2);
if (!tree.probeLeaf(openvdb::Coord(center.x() - LEAF_DIM, center.y(), center.z()))) {
if (!is_non_empty_leaf(tree, openvdb::Coord(center.x() - LEAF_DIM, center.y(), center.z()))) {
create_quad(corners, vertices_is, quads, resolution, used_verts, QUAD_X_MIN);
}
if (!tree.probeLeaf(openvdb::Coord(center.x() + LEAF_DIM, center.y(), center.z()))) {
if (!is_non_empty_leaf(tree, openvdb::Coord(center.x() + LEAF_DIM, center.y(), center.z()))) {
create_quad(corners, vertices_is, quads, resolution, used_verts, QUAD_X_MAX);
}
if (!tree.probeLeaf(openvdb::Coord(center.x(), center.y() - LEAF_DIM, center.z()))) {
if (!is_non_empty_leaf(tree, openvdb::Coord(center.x(), center.y() - LEAF_DIM, center.z()))) {
create_quad(corners, vertices_is, quads, resolution, used_verts, QUAD_Y_MIN);
}
if (!tree.probeLeaf(openvdb::Coord(center.x(), center.y() + LEAF_DIM, center.z()))) {
if (!is_non_empty_leaf(tree, openvdb::Coord(center.x(), center.y() + LEAF_DIM, center.z()))) {
create_quad(corners, vertices_is, quads, resolution, used_verts, QUAD_Y_MAX);
}
if (!tree.probeLeaf(openvdb::Coord(center.x(), center.y(), center.z() - LEAF_DIM))) {
if (!is_non_empty_leaf(tree, openvdb::Coord(center.x(), center.y(), center.z() - LEAF_DIM))) {
create_quad(corners, vertices_is, quads, resolution, used_verts, QUAD_Z_MIN);
}
if (!tree.probeLeaf(openvdb::Coord(center.x(), center.y(), center.z() + LEAF_DIM))) {
if (!is_non_empty_leaf(tree, openvdb::Coord(center.x(), center.y(), center.z() + LEAF_DIM))) {
create_quad(corners, vertices_is, quads, resolution, used_verts, QUAD_Z_MAX);
}
}

View File

@@ -43,6 +43,10 @@ Session::Session(const SessionParams &params_, const SceneParams &scene_params)
device = Device::create(params.device, stats, profiler);
if (device->have_error()) {
progress.set_error(device->error_message());
}
scene = new Scene(scene_params, device);
/* Configure path tracer. */
@@ -436,8 +440,7 @@ int2 Session::get_effective_tile_size() const
const int image_width = buffer_params_.width;
const int image_height = buffer_params_.height;
/* No support yet for baking with tiles. */
if (!params.use_auto_tile || scene->bake_manager->get_baking()) {
if (!params.use_auto_tile) {
return make_int2(image_width, image_height);
}

View File

@@ -7,6 +7,7 @@
#include "graph/node.h"
#include "scene/background.h"
#include "scene/bake.h"
#include "scene/film.h"
#include "scene/integrator.h"
#include "scene/scene.h"
@@ -367,7 +368,9 @@ void TileManager::update(const BufferParams &params, const Scene *scene)
node_to_image_spec_atttributes(
&write_state_.image_spec, &denoise_params, ATTR_DENOISE_SOCKET_PREFIX);
if (adaptive_sampling.use) {
/* Not adaptive sampling overscan yet for baking, would need overscan also
* for buffers read from the output driver. */
if (adaptive_sampling.use && !scene->bake_manager->get_baking()) {
overscan_ = 4;
}
else {

View File

@@ -417,15 +417,11 @@ ccl_device_inline int floor_to_int(float f)
return float_to_int(floorf(f));
}
ccl_device_inline int quick_floor_to_int(float x)
{
return float_to_int(x) - ((x < 0) ? 1 : 0);
}
ccl_device_inline float floorfrac(float x, ccl_private int *i)
{
*i = quick_floor_to_int(x);
return x - *i;
float f = floorf(x);
*i = float_to_int(f);
return x - f;
}
ccl_device_inline int ceil_to_int(float f)

View File

@@ -535,18 +535,6 @@ ccl_device_inline float3 pow(float3 v, float e)
return make_float3(powf(v.x, e), powf(v.y, e), powf(v.z, e));
}
ccl_device_inline int3 quick_floor_to_int3(const float3 a)
{
#ifdef __KERNEL_SSE__
int3 b = int3(_mm_cvttps_epi32(a.m128));
int3 isneg = int3(_mm_castps_si128(_mm_cmplt_ps(a.m128, _mm_set_ps1(0.0f))));
/* Unsaturated add 0xffffffff is the same as subtract -1. */
return b + isneg;
#else
return make_int3(quick_floor_to_int(a.x), quick_floor_to_int(a.y), quick_floor_to_int(a.z));
#endif
}
ccl_device_inline bool isfinite_safe(float3 v)
{
return isfinite_safe(v.x) && isfinite_safe(v.y) && isfinite_safe(v.z);

View File

@@ -5,6 +5,8 @@
#ifndef __UTIL_SSEF_H__
#define __UTIL_SSEF_H__
#include <math.h>
#include "util/ssei.h"
CCL_NAMESPACE_BEGIN
@@ -521,7 +523,7 @@ __forceinline const ssef round_zero(const ssef &a)
__forceinline const ssef floor(const ssef &a)
{
# ifdef __KERNEL_NEON__
return vrndnq_f32(a);
return vrndmq_f32(a);
# else
return _mm_round_ps(a, _MM_FROUND_TO_NEG_INF);
# endif
@@ -534,6 +536,12 @@ __forceinline const ssef ceil(const ssef &a)
return _mm_round_ps(a, _MM_FROUND_TO_POS_INF);
# endif
}
# else
/* Non-SSE4.1 fallback, needed for floorfrac. */
__forceinline const ssef floor(const ssef &a)
{
return _mm_set_ps(floorf(a.f[3]), floorf(a.f[2]), floorf(a.f[1]), floorf(a.f[0]));
}
# endif
__forceinline ssei truncatei(const ssef &a)
@@ -541,20 +549,11 @@ __forceinline ssei truncatei(const ssef &a)
return _mm_cvttps_epi32(a.m128);
}
/* This is about 25% faster than straightforward floor to integer conversion
* due to better pipelining.
*
* Unsaturated add 0xffffffff (a < 0) is the same as subtract -1.
*/
__forceinline ssei floori(const ssef &a)
{
return truncatei(a) + cast((a < 0.0f).m128);
}
__forceinline ssef floorfrac(const ssef &x, ssei *i)
{
*i = floori(x);
return x - ssef(*i);
ssef f = floor(x);
*i = truncatei(f);
return x - f;
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -11,7 +11,7 @@ CCL_NAMESPACE_BEGIN
ccl_device_forceinline float3 transform_inverse_cross(const float3 a, const float3 b)
{
#ifdef __AVX2__
#if defined(__AVX2__) && defined(__KERNEL_SSE2__)
const ssef sse_a = (const __m128 &)a;
const ssef sse_b = (const __m128 &)b;
const ssef r = shuffle<1, 2, 0, 3>(

View File

@@ -739,6 +739,13 @@ extern unsigned int GHOST_GetContextDefaultOpenGLFramebuffer(GHOST_ContextHandle
*/
extern unsigned int GHOST_GetDefaultOpenGLFramebuffer(GHOST_WindowHandle windowhandle);
/**
* Use multitouch gestures if supported.
* \param systemhandle: The handle to the system.
* \param use: Enable or disable.
*/
extern void GHOST_SetMultitouchGestures(GHOST_SystemHandle systemhandle, const bool use);
/**
* Set which tablet API to use. Only affects Windows, other platforms have a single API.
* \param systemhandle: The handle to the system.

View File

@@ -420,6 +420,12 @@ class GHOST_ISystem {
*/
virtual GHOST_TSuccess getButtonState(GHOST_TButton mask, bool &isDown) const = 0;
/**
* Enable multitouch gestures if supported.
* \param use: Enable or disable.
*/
virtual void setMultitouchGestures(const bool use) = 0;
/**
* Set which tablet API to use. Only affects Windows, other platforms have a single API.
* \param api: Enum indicating which API to use.

View File

@@ -735,6 +735,12 @@ GHOST_TSuccess GHOST_InvalidateWindow(GHOST_WindowHandle windowhandle)
return window->invalidate();
}
void GHOST_SetMultitouchGestures(GHOST_SystemHandle systemhandle, const bool use)
{
GHOST_ISystem *system = GHOST_ISystem::getSystem();
return system->setMultitouchGestures(use);
}
void GHOST_SetTabletAPI(GHOST_SystemHandle systemhandle, GHOST_TTabletAPI api)
{
GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;

View File

@@ -200,7 +200,8 @@ static void makeAttribList(std::vector<NSOpenGLPixelFormatAttribute> &attribs,
bool coreProfile,
bool stereoVisual,
bool needAlpha,
bool softwareGL)
bool softwareGL,
bool increasedSamplerLimit)
{
attribs.clear();
@@ -217,6 +218,12 @@ static void makeAttribList(std::vector<NSOpenGLPixelFormatAttribute> &attribs,
else {
attribs.push_back(NSOpenGLPFAAccelerated);
attribs.push_back(NSOpenGLPFANoRecovery);
/* Attempt to initialise device with extended sampler limit.
* Resolves EEVEE purple rendering artifacts on macOS. */
if (increasedSamplerLimit) {
attribs.push_back((NSOpenGLPixelFormatAttribute)400);
}
}
if (stereoVisual)
@@ -232,82 +239,126 @@ static void makeAttribList(std::vector<NSOpenGLPixelFormatAttribute> &attribs,
GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext()
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@autoreleasepool {
#ifdef GHOST_OPENGL_ALPHA
static const bool needAlpha = true;
static const bool needAlpha = true;
#else
static const bool needAlpha = false;
static const bool needAlpha = false;
#endif
/* Command-line argument would be better. */
static bool softwareGL = getenv("BLENDER_SOFTWAREGL");
/* Command-line argument would be better. */
static bool softwareGL = getenv("BLENDER_SOFTWAREGL");
std::vector<NSOpenGLPixelFormatAttribute> attribs;
attribs.reserve(40);
makeAttribList(attribs, m_coreProfile, m_stereoVisual, needAlpha, softwareGL);
NSOpenGLPixelFormat *pixelFormat = nil;
std::vector<NSOpenGLPixelFormatAttribute> attribs;
bool increasedSamplerLimit = false;
NSOpenGLPixelFormat *pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:&attribs[0]];
if (pixelFormat == nil) {
goto error;
}
/* Attempt to initialize device with increased sampler limit.
* If this is unsupported and initialization fails, initialize GL Context as normal.
*
* NOTE: This is not available when using the SoftwareGL path, or for Intel-based
* platforms. */
if (!softwareGL) {
if (@available(macos 11.0, *)) {
increasedSamplerLimit = true;
}
}
const int max_ctx_attempts = increasedSamplerLimit ? 2 : 1;
for (int ctx_create_attempt = 0; ctx_create_attempt < max_ctx_attempts; ctx_create_attempt++) {
m_openGLContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat
shareContext:s_sharedOpenGLContext];
[pixelFormat release];
attribs.clear();
attribs.reserve(40);
makeAttribList(
attribs, m_coreProfile, m_stereoVisual, needAlpha, softwareGL, increasedSamplerLimit);
[m_openGLContext makeCurrentContext];
pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:&attribs[0]];
if (pixelFormat == nil) {
/* If pixel format creation fails when testing increased sampler limit,
* attempt intialisation again with feature disabled, otherwise, fail. */
if (increasedSamplerLimit) {
increasedSamplerLimit = false;
continue;
}
return GHOST_kFailure;
}
if (m_debug) {
GLint major = 0, minor = 0;
glGetIntegerv(GL_MAJOR_VERSION, &major);
glGetIntegerv(GL_MINOR_VERSION, &minor);
fprintf(stderr, "OpenGL version %d.%d%s\n", major, minor, softwareGL ? " (software)" : "");
fprintf(stderr, "Renderer: %s\n", glGetString(GL_RENDERER));
}
/* Attempt to create context. */
m_openGLContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat
shareContext:s_sharedOpenGLContext];
[pixelFormat release];
if (m_openGLContext == nil) {
/* If context creation fails when testing increased sampler limit,
* attempt re-creation with feature disabled. Otherwise, error. */
if (increasedSamplerLimit) {
increasedSamplerLimit = false;
continue;
}
/* Default context creation attempt failed. */
return GHOST_kFailure;
}
/* Created GL context successfully, activate. */
[m_openGLContext makeCurrentContext];
/* When increasing sampler limit, verify created context is a supported configuration. */
if (increasedSamplerLimit) {
const char *vendor = (const char *)glGetString(GL_VENDOR);
const char *renderer = (const char *)glGetString(GL_RENDERER);
/* If generated context type is unsupported, release existing context and
* fallback to creating a normal context below. */
if (strstr(vendor, "Intel") || strstr(renderer, "Software")) {
[m_openGLContext release];
m_openGLContext = nil;
increasedSamplerLimit = false;
continue;
}
}
}
if (m_debug) {
GLint major = 0, minor = 0;
glGetIntegerv(GL_MAJOR_VERSION, &major);
glGetIntegerv(GL_MINOR_VERSION, &minor);
fprintf(stderr, "OpenGL version %d.%d%s\n", major, minor, softwareGL ? " (software)" : "");
fprintf(stderr, "Renderer: %s\n", glGetString(GL_RENDERER));
}
#ifdef GHOST_WAIT_FOR_VSYNC
{
GLint swapInt = 1;
/* Wait for vertical-sync, to avoid tearing artifacts. */
[m_openGLContext setValues:&swapInt forParameter:NSOpenGLCPSwapInterval];
}
{
GLint swapInt = 1;
/* Wait for vertical-sync, to avoid tearing artifacts. */
[m_openGLContext setValues:&swapInt forParameter:NSOpenGLCPSwapInterval];
}
#endif
initContextGLEW();
initContextGLEW();
if (m_metalView) {
if (m_defaultFramebuffer == 0) {
/* Create a virtual frame-buffer. */
[m_openGLContext makeCurrentContext];
metalInitFramebuffer();
if (m_metalView) {
if (m_defaultFramebuffer == 0) {
/* Create a virtual frame-buffer. */
[m_openGLContext makeCurrentContext];
metalInitFramebuffer();
initClearGL();
}
}
else if (m_openGLView) {
[m_openGLView setOpenGLContext:m_openGLContext];
[m_openGLContext setView:m_openGLView];
initClearGL();
}
[m_openGLContext flushBuffer];
if (s_sharedCount == 0)
s_sharedOpenGLContext = m_openGLContext;
s_sharedCount++;
}
else if (m_openGLView) {
[m_openGLView setOpenGLContext:m_openGLContext];
[m_openGLContext setView:m_openGLView];
initClearGL();
}
[m_openGLContext flushBuffer];
if (s_sharedCount == 0)
s_sharedOpenGLContext = m_openGLContext;
s_sharedCount++;
[pool drain];
return GHOST_kSuccess;
error:
[pixelFormat release];
[pool drain];
return GHOST_kFailure;
}
GHOST_TSuccess GHOST_ContextCGL::releaseNativeHandles()

View File

@@ -318,7 +318,7 @@ GHOST_TSuccess GHOST_ContextGLX::releaseNativeHandles()
GHOST_TSuccess GHOST_ContextGLX::setSwapInterval(int interval)
{
if (!GLXEW_EXT_swap_control) {
if (GLXEW_EXT_swap_control) {
::glXSwapIntervalEXT(m_display, m_window, interval);
return GHOST_kSuccess;
}

View File

@@ -30,6 +30,7 @@ GHOST_System::GHOST_System()
#ifdef WITH_INPUT_NDOF
m_ndofManager(0),
#endif
m_multitouchGestures(true),
m_tabletAPI(GHOST_kTabletAutomatic),
m_is_debug_enabled(false)
{
@@ -307,6 +308,11 @@ GHOST_TSuccess GHOST_System::getButtonState(GHOST_TButton mask, bool &isDown) co
return success;
}
void GHOST_System::setMultitouchGestures(const bool use)
{
m_multitouchGestures = use;
}
void GHOST_System::setTabletAPI(GHOST_TTabletAPI api)
{
m_tabletAPI = api;

Some files were not shown because too many files have changed in this diff Show More