1
1

Compare commits

...

506 Commits

Author SHA1 Message Date
aa9b976e9f Merge branch 'master' into temp-gpencil-automask 2022-11-08 16:29:56 +01:00
bbb1d3e5e7 Merge branch 'blender-v3.4-release' 2022-11-08 16:28:11 +01:00
0a7308a0f1 Fix: improve CD_ASSIGN handling when adding custom data layer
Previously, the code would incorrectly free the passed in custom data
layer even when `CD_ASSIGN` was not used. Now the function actually
supports assigning the data to the layer. This only fixes the case for
custom data layer types that only support a single layer like `CD_MEDGE`.

Informally reviewed by Hans Goudey.
2022-11-08 16:26:42 +01:00
6a14ca18d0 Merge branch 'blender-v3.4-release' 2022-11-08 16:26:09 +01:00
c3391d537b Fix T101894: only do FCurve-select if no keys have been touched previously
Change the behaviour of circle select on FCurves:
- Before any key is touched, the behaviour is as it was (key included in
  circle-select area → select it; otherwise → select entire curve)
- If any key has been touched, an internal option
  (`use_curve_selection`) is  flipped and selecting the entire curve is
  disallowed.

This ensures that once a key changes selection state, it's no longer
possible to select the entire curve. This allows dragging over keys and
subsequently drag over a keyless part of the curve.

Reviewed By: RiggingDojo, troopy28

Maniphest Tasks: T101894

Differential Revision: https://developer.blender.org/D16307
2022-11-08 16:12:38 +01:00
c73ae711bf BLI: new basic CacheMutex
This patch introduces a new `CacheMutex` which makes it easy to implement
lazily computed caches in e.g. `Curves`. For more details see `BLI_cache_mutex.hh`.

Differential Revision: https://developer.blender.org/D16419
2022-11-08 15:50:49 +01:00
32f58c0a92 Cleanup: fix compiler warning with openjpeg 2.5 2022-11-08 14:33:24 +01:00
Edward
1d71f82033 Texture Paint: sync adding a new texture slot to the Image Editor
When changing the texture paint slot index or activating a Texture Node, the texture displayed in the Image Editor changes accordingly.
This patch syncs the Image Editor when a new texture paint slot was added, which currently is not the case.

Also deduplicates some code.
2022-11-08 14:28:44 +01:00
77c4d3154b Merge branch 'blender-v3.4-release' 2022-11-08 13:47:43 +01:00
09faf8a449 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-08 13:40:14 +01:00
Brecht Van Lommel
e1b3d91127 Refactor: replace Cycles sse/avx types by vectorized float4/int4/float8/int8
The distinction existed for legacy reasons, to easily port of Embree
intersection code without affecting the main vector types. However we are now
using SIMD for these types as well, so no good reason to keep the distinction.

Also more consistently pass these vector types by value in inline functions.
Previously it was partially changed for functions used by Metal to avoid having
to add address space qualifiers, simple to do it everywhere.

Also removes function declarations for vector math headers, serves no real
purpose.

Differential Revision: https://developer.blender.org/D16146
2022-11-08 12:28:40 +01:00
32ec0521c5 Merge branch 'blender-v3.4-release' 2022-11-08 12:18:12 +01:00
82ba205646 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-08 12:17:56 +01:00
c047042adf Merge branch 'blender-v3.4-release' 2022-11-08 12:03:07 +01:00
0d945fe20e Fix deprecation warnings about printf() on macOS
The new Xcode 14.1 brings the new Apple Clang compiler which
considers sprintf unsafe and geenrates deprecation warnings
suggesting to sue snprintf instead. This only happens for C++
code by default, and C code can still use sprintf without any
warning.

This changes does the following:

- Whenever is trivial replace sprintf() with BLI_snprintf.
- For all other cases use the newly introduced BLI_sprintf
  which is a wrapper around sprintf() but without warning.

There is a discouragement note in the BLI_sprintf comment to
suggest use of BLI_snprintf when the size is known.

Differential Revision: https://developer.blender.org/D16410
2022-11-08 12:01:01 +01:00
dc609d9f1f Fix T100988: flickering when using sculpt brush in drag dot mode
Differential Revision: https://developer.blender.org/D16305
2022-11-08 11:46:44 +01:00
f12236d1e3 Merge branch 'blender-v3.4-release' 2022-11-08 11:34:38 +01:00
1f3be45f1f Fix T102242: Underline shortcut keys not working/appearing in sub-menu
Upon closer inspection, looks like `UI_BLOCK_NUMSELECT` was previously
set for all code paths and 99e5024e97 removed it from one.
2022-11-08 11:34:12 +01:00
871375f222 PyAPI: add invalid objects check for RNA struct keys()/values()/items() 2022-11-08 17:17:30 +11:00
8b151982fe Merge branch 'blender-v3.4-release' 2022-11-08 17:00:46 +11:00
642ff82f74 Cleanup: format, remove commented code & unused variable 2022-11-08 16:58:37 +11:00
3c1fb9aea1 Workaround crash generating Python API documentation
Avoid accessing freed memory from dynamically allocated EnumPropertyItem
arrays. Rely on the memory being held by the iterator which isn't the
case when it was converted to a tuple.
2022-11-08 16:52:30 +11:00
fddcdcc20c Merge branch 'blender-v3.4-release' 2022-11-08 12:18:52 +11:00
9d1380e0a9 Merge branch 'blender-v3.4-release' 2022-11-08 12:18:48 +11:00
452865c80d Merge branch 'blender-v3.4-release' 2022-11-08 12:18:44 +11:00
8f439bdc2d Fix invalid function signatures for PySequenceMethods callbacks
Function casts hid casting between potentially incompatible type
signatures (using int instead of Py_ssize_t). As it happens this seems
not to have caused any bugs on supported platforms so this change is
mainly for correctness and to avoid problems in the future.
2022-11-08 12:16:28 +11:00
2257a9bfb1 Cleanup: correct type of RNA struct methods
Some BPy_StructRNA methods used BPy_PropertyRNA in their function
signatures, while this didn't case any bugs, it could lead to issues
in the future.
2022-11-08 11:26:33 +11:00
4eb9322eda Cleanup: PyMethodDef formatting
Missed these changes in [0].

Also replace designated initializers in some C code, as it's not used
often and would need to be removed when converting to C++.

[0] e555ede626
2022-11-08 11:13:58 +11:00
3e71220efc Fix support for building with ffmpeg < 5.0
Seems like the new audio channel api was not as backwards compatible as we thought.
Therefore we need to reintroduce the usage of the old api to make older ffmpeg version be able to compile Blender.

This change is only intended to stick around for two releases or so. After that we hope that most Linux distros ship
ffmpeg >=5.0 so we can switch to it.

Reviewed By: Sergey

Differential Revision: http://developer.blender.org/D16408
2022-11-07 17:46:13 +01:00
410b87ca78 Merge branch 'master' into temp-gpencil-automask 2022-11-07 16:12:16 +01:00
1140e001a0 Fix T102329: assert when cutting node tree link 2022-11-07 16:12:07 +01:00
c842a5a187 Fix T101526: assert due to wrong node tree owner id 2022-11-07 15:48:48 +01:00
95631c94c4 Merge branch 'blender-v3.4-release' 2022-11-07 15:30:49 +01:00
84d8698488 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-07 15:30:15 +01:00
52bd198153 Fix T100872: restrict Python API on built-in nodes
Differential Revision: https://developer.blender.org/D16304
2022-11-07 14:43:24 +01:00
8ff71acd84 Fix T102324: reverse curve node breaks crazy space editing 2022-11-07 14:40:35 +01:00
8473b5a592 Fix strict compiler warnings 2022-11-07 14:20:50 +01:00
79d8610d04 Fix T102311: crash when opening node add menu with assets 2022-11-07 14:15:33 +01:00
403fc9a3f1 Merge branch 'blender-v3.4-release' 2022-11-07 08:46:15 -03:00
8f4e52b7e0 Fix T102053: snap fails with instances of geometry nodes
As instances are often generated geometries, we cannot rely on the data
provided by `DupliObject::ob`.

Use `DupliObject::ob_data` when possible.

This required a major refactor in the code as the output variables are
now gathered in context and easier to access.
2022-11-07 08:44:35 -03:00
9ea82ce653 Fix potentially uninitialized memory usage
`nearest_world_tree_co` allows null parameter, so the `index` variable
isn't really needed and doesn't even need to be initialized.
2022-11-07 08:43:15 -03:00
7b845fb984 Transform: remove SnapData cache for meshes
All cache needed is already stored in `Mesh.runtime`.
2022-11-07 08:43:02 -03:00
e555ede626 Cleanup: unify struct declaration style for Python types, update names
Use struct identifiers in comments before the value.
This has some advantages:

- The struct identifiers didn't mix well with other code-comments,
  where other comments were wrapped onto the next line.
- Minor changes could re-align all other comments in the struct.
- PyVarObject_HEAD_INIT & tp_name are no longer placed on the same line.

Remove overly verbose comments copied from PyTypeObject (Python v2.x),
these aren't especially helpful and get outdated.

Also corrected some outdated names:

- PyTypeObject.tp_print -> tp_vectorcall_offset
- PyTypeObject.tp_reserved -> tp_as_async
2022-11-07 22:38:32 +11:00
719332d120 Cleanup: remove unused variable 2022-11-07 22:38:32 +11:00
688b408bbb Fix 'ED_transform_snap_object_project_ray_all' not return 'hit_list'
Missed in rBff4f14b21a42.
2022-11-07 08:38:09 -03:00
888fb0b395 Merge branch 'blender-v3.4-release' 2022-11-07 12:32:36 +01:00
ff4f14b21a Fix T102053: snap fails with instances of geometry nodes
As instances are often generated geometries, we cannot rely on the data
provided by `DupliObject::ob`.

Use `DupliObject::ob_data` when possible.

This required a major refactor in the code as the output variables are
now gathered in context and easier to access.
2022-11-07 08:27:54 -03:00
b2db324f60 Fix potentially uninitialized memory usage
`nearest_world_tree_co` allows null parameter, so the `index` variable
isn't really needed and doesn't even need to be initialized.
2022-11-07 08:27:54 -03:00
cad897de16 Transform: remove SnapData cache for meshes
All cache needed is already stored in `Mesh.runtime`.
2022-11-07 08:27:54 -03:00
ffc0db1994 Fix Curves Smooth modifier appears to be able to act on control points
This is not the case though, the modifier act explicitly on mesh edges,
if no tesselated mesh is provided, it would simpy early out and do
nothing.

Now always disable the "Apply on Spline" option with a tip that this
modifier can only smooth the tesselated curve (not the underlying curve
control points). Similar to rB1a6b51e17502.

Fixes T102060.

Maniphest Tasks: T102060

Differential Revision: https://developer.blender.org/D16386
2022-11-07 12:25:20 +01:00
94930da29b 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-07 12:24:54 +01:00
e031a45d60 Fix T102238: double free when storing attribute on empty geometry 2022-11-07 11:42:26 +01:00
129197f20d Merge branch 'blender-v3.4-release' 2022-11-07 21:33:24 +11:00
186f16e84c Fix T102316: blank color-space menu drop-downs
Regression in [0] needs further investigation
(building docs may crash again).

This effectively reverts [0], however de-duplicating the color-space
enum can be kept.

[0]: 037b771e1a
2022-11-07 21:30:34 +11:00
74140d41b1 Cycles: Apple GPU threadgroup tuning
This patch tunes maximum threads-per-threadgroup and threads-per-block for faster renders on Apple GPUs. Appropriate tuning is selected based on the GPU architecture (M1 or M2). We see a benchmark uplift of around 5-10% on M1 family chips. Similar uplift is expected on M2 with upcoming OS changes. (Ref T101931)

Reviewed By: brecht

Maniphest Tasks: T101931

Differential Revision: https://developer.blender.org/D16299
2022-11-07 10:00:46 +00:00
671c3e1fa4 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-07 10:28:37 +01:00
37ca6e4fd1 Merge branch 'blender-v3.4-release' 2022-11-06 15:45:45 +01:00
25c6444bad Fix T102153: crash when muting node group with active viewer 2022-11-06 15:39:57 +01:00
0697631929 Fix T102144: missing validation of spline resolution 2022-11-06 15:36:53 +01:00
c29c61f840 Fix T102292: deadlock in geometry nodes evaluation with task isolation
As described in the comment on `BLI_task_isolate`, deadlocks can happen
when isolation is used with threading primitives that separate spawning tasks
from executing them. All threads are waiting the tasks to complete but no
thread is able to continue working due to task isolation.

The fix is to not pass lazy-threading hints through task isolations. This way
isolated regions can't create new tasks in a scheduler further up the call stack.
This may lead to minor slowdowns because less threading may be used.
It's generally possible to get rid of the slowdown again by sending the
lazy-threading hint before entering the isolated region.
2022-11-06 15:07:32 +01:00
f4e97bd67d Geometry Nodes: fix missing curve cache 2022-11-06 12:20:26 +01:00
a8865f3402 Fix: Missing initialization curves bounds in set origin operator
It could be changed, but currently curves.bounds_min_max
relies on the initial value of its arguments. Split from D16331.
2022-11-06 10:23:14 +01:00
3852094b35 Cleanup: Nodes: Use const arguments, avoid recursive iteration
Use the node topology cache and avoid modifying the node tree
in a non-threadsafe way to improve the predictability of using
the helper function. Replaces the implementation from
e0d4047136.
2022-11-06 10:23:14 +01:00
Pablo Vazquez
28e952dacd UI: Sort items in Weight Locks menu
Reorder the items in the `Locks` menu:
* Split into three groups: Lock, Unlock, Invert.
* Use icon only in the first item of each group, following the HIG.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D16383
2022-11-06 02:28:48 +01:00
6ef6778215 Fix: Broken debug build after recent cleanup commit
5060f26f50
2022-11-05 21:37:37 +01:00
8b29d6cd75 Cleanup: Remove unused node function 2022-11-05 21:37:37 +01:00
c6725dc507 Cleanup: Use Vector in group input/output node update functions
Also reduce the scope of variables and use ListBase macros
2022-11-05 21:37:37 +01:00
db3bf36770 Sculpt: Fix T102253: Missing call to SCULPT_automasking_node_update 2022-11-05 11:57:39 -07:00
5060f26f50 Cleanup: Move function to legacy mesh conversion file 2022-11-05 18:14:26 +01:00
455d195d55 OBJ Export: Remove edge recalculation
The removed function call removes all attributes from mesh edges
and rebuilds the mesh edge topology. This isn't necessary because
meshes always have edges in the first place.

Exporting a 4 million face grid, this saved 1.5 seconds out of 4
seconds total for the whole export.

Tests files have to be updated, since the edge calculation could
potentially change the order of elements. This is also a fix, since
previously the exporter would delete all attributes on the evaluated
mesh edges.

Differential Revision: https://developer.blender.org/D16391
2022-11-05 16:28:13 +01:00
4ec5a8cbc2 Cleanup: Remove unnecessary node type registraction functions
These functions provided little benefit compared to simply setting
the function pointers directly.
2022-11-05 16:10:27 +01:00
e673f3ba24 Cleanup: Remove redundant assignment of loose edge flag
This is assigned by `BKE_mesh_calc_edges_loose` a few lines below.
2022-11-05 13:26:52 +01:00
38086dcfdc Merge branch 'blender-v3.4-release' 2022-11-05 20:03:46 +11:00
037b771e1a Fix crash building Python API docs
Color space conversion item-function missed checking the context was
NULL to return a static array. This caused freed memory access when
building docs.
2022-11-05 19:57:02 +11:00
412e7d3771 Merge branch 'blender-v3.4-release' 2022-11-05 17:10:23 +11:00
60043a6158 Cleanup: quiet unused argument warning 2022-11-05 17:08:53 +11:00
b3e1540c50 Cleanup: use bools and typed enums for WM_job type & flag
Also use typed enum for the event handler flag.
2022-11-05 14:14:39 +11:00
ae3073323e Cleanup: use bool instead of short for job stop & do_update arguments
Since these values are only ever 0/1, use bool type.
2022-11-05 13:47:01 +11:00
4a313b8252 Cleanup: Move legacy mesh conversions to proper file 2022-11-04 23:28:10 +01:00
23dafa4ad6 Cleanup: OBJ: Simplify access to loose edges
Implementing this with a separate function just added extra code,
there wasn't much benefit to it.
2022-11-04 21:58:15 +01:00
59af0fba9d Merge branch 'blender-v3.4-release' 2022-11-04 21:06:39 +01:00
bba6d28942 Fix T99641: Assert hit when splitting video sequencer area horizontally
Don't draw channels region when height is 0.
2022-11-04 21:01:11 +01:00
4b200b491c Cleanup: Use mesh API functions 2022-11-04 20:37:17 +01:00
10131a6f62 Cleanup: Mesh: Remove redundant edge render flag
Currently there are both "EDGERENDER" and "EDGEDRAW" flags, which are
almost always used together. Both are runtime data and not exposed to
RNA, used to skip drawing some edges after the subdivision surface
modifier. The render flag is a relic of the Blender internal renderer.
This commit removes the render flag and replaces its uses with the
draw flag.
2022-11-04 20:19:52 +01:00
85ce488298 Realtime Compositor: Implement static cache manager
This patch introduces the concept of a Cached Resource that can be
cached across compositor evaluations as well as used by multiple
operations in the same evaluation. Additionally, this patch implements a
new structure for the realtime compositor, the Static Cache Manager,
that manages all the cached resources and deletes them when they are no
longer needed.

This improves responsiveness while adjusting compositor node trees and
also conserves memory usage.

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

Reviewed By: Clement Foucault
2022-11-04 16:14:22 +02:00
943d574185 Merge branch 'blender-v3.4-release' 2022-11-04 21:59:38 +11:00
bb86007018 Fix T102232: bridge edge loop crash
Many connected edge loops could result in two edge loops sharing
vertices. This is more of a workaround, the reason for two edge loops
sharing vertices could be prevented some other way.
Add this check since it's a straightforward solution,
furthered investigation noted as a TODO.
2022-11-04 21:52:01 +11:00
4b2458b457 Merge branch 'blender-v3.4-release' 2022-11-04 19:19:23 +11:00
Evan Wilson
72505da862 Fix T102216: Change min_ff to max_ff in the return of BlendType max
BlendType max incorrectly returns the minimum in BLI_color_mix.hh
This differential fixes it to return the maximum.

Maniphest Tasks: T102216

Ref D16364
2022-11-04 19:18:54 +11:00
d4f0ccb6b4 Cleanup: pass const view_area in sequencer functions 2022-11-04 18:50:31 +11:00
7a7055c186 Cleanup: use bool for render types ok/result_ok 2022-11-04 18:50:31 +11:00
d6b2f4ad8e Merge branch 'blender-v3.4-release' 2022-11-04 00:03:47 -07:00
Colin Basnett
11a705c2d0 Fix T102218: Baked f-curves display incorrectly when normalized
This fixes T102218, where baked f-curves would display incorrectly when normalized.

This bug was a result of the code making no effort to determine the y-range of baked f-curves, so it fell back to a default that looked horrible.

I've added specific handling for finding the y-range of each f-curve (I extracted this functionality out to a new function, `fcurve_scene_coord_range_get`, for organization purposes). In addition, a minor optimization was made to eliminate redundant range-checks when in preview range mode.

{F13838304}

Reviewed By: sybren

Maniphest Tasks: T102218

Differential Revision: https://developer.blender.org/D16363
2022-11-03 23:56:50 -07:00
624c11d69f BLI_path: remove use of BLI_path_normalize in BLI_path_parent_dir
Normalize is no longer necessary as BLI_path_name_at_index skips
redundant path components such as "//" and "/./".

This has the advantage that the path length isn't limited to FILE_MAX.
2022-11-04 17:22:11 +11:00
3d34b8c901 Merge branch 'blender-v3.4-release' 2022-11-04 16:51:18 +11:00
a4ea684bc8 Fix missing call to AttributeWriter::finish with paint vertex selection 2022-11-04 16:49:47 +11:00
ecda9483f1 Merge branch 'blender-v3.4-release' 2022-11-03 23:41:11 -04:00
eb8155ebcd PyDoc: Make rst files more readable
This commit reduces the amount of white space generated and keeps parameter documentation of a single line.

This makes the resulting rst files easier to read in the case of debugging.

This was useful while looking into T97464
2022-11-03 23:36:12 -04:00
e36db7018d Merge branch 'blender-v3.4-release' 2022-11-04 14:00:14 +11:00
c5dde1c345 Cleanup: quiet unused argument warning 2022-11-04 13:59:03 +11:00
3d72c37f7a Fix T101686: WPaint + Pose select fails with GPU depth-picking disabled
Regression in [0], however the primary purpose of that code was to
cycle away from the active object (behavior which was intentionally
removed, see: T96752).

This broke weight-paint + pose-selection (Ctrl-LMB)
when the GPU depth picking preference was disabled.
Causing selection to pick the mesh object instead of the pose bones.
This de-selected the armature, making the pose bones unselectable
instead of selecting the pose bone as intended.

Adding the old code back (restricting it to weight-paint mode)
fixes the bug but reintroduces fairly involved logic unnecessarily.

Instead, prioritize bone selecting when in weight-paint & pose mode
(previously this was only done in pose-mode).

[0]: b1908f2e0b
2022-11-04 13:58:57 +11:00
9dfc134c9d DRW: Fix incorrect logic in state redundancy check
Error introduced by rB3c39a3affee7.
2022-11-03 19:41:36 +01:00
c2a99cb0b6 Merge branch 'blender-v3.4-release' 2022-11-03 19:38:36 +01:00
1452b44352 DRW: PointCloud: Fix memset writting non-trivial type std::mutex
This issue might have produced crashes in some cases similar to
rBafd30e5e3a77.
2022-11-03 19:34:58 +01:00
5081de736a Cleanup: DRW: Fix unused parameters warning 2022-11-03 19:34:58 +01:00
44dd158803 DRW: Command: Fix custom group test being always true 2022-11-03 19:34:58 +01:00
5401e68a61 Merge branch 'blender-v3.4-release' 2022-11-03 12:20:44 -05:00
838d20b990 make float value explicit 2022-11-03 12:18:53 -05:00
0e0b3d6e1a adding defaults for NLA Action scale and repeat
Differential Revision: https://developer.blender.org/D16379
2022-11-03 12:18:53 -05:00
3c39a3affe DRW: Add support for clip plane count as part of the draw state.
This moves the implementation from the View to the draw manager itself.

However, this is not its final place and should be moved to the shader
create info at some point in the future.
For now it is not possible because of possible interaction with the
old draw manager codebase.
2022-11-03 17:03:22 +01:00
dcfe4a302c Merge branch 'blender-v3.4-release' 2022-11-03 16:52:39 +01:00
2c0c431399 Fix T102221: Entering editmode invalidates the driver associated with that mesh
The regression is caused by D13824 0f89bcdbeb.

This fix follows the code from Sybren (D7785) to make object-mode
drivers from shapekey value to work. This intuitively makes sense
since the D13824 made the edit mode evaluation and ownership follow
the object mode more closely.

Differential Revision: https://developer.blender.org/D16380
2022-11-03 16:52:11 +01:00
Brecht Van Lommel
e449bf350c Fix Wayland warning on startup when running X11
On Ubuntu 20.04 running X11, there was this message on every Blender startup:
Unable to find 'wl_proxy_marshal_flags' in 'libwayland-client.so.0'.

The reason is that we build against Wayland protocols 1.21, which in turns requires
Wayland on the distribution to be 1.21+, which is not the case on Ubuntu 20.04.

This simply silences the warning. An improvement would be to explain the user that
their Wayland version is too old when neither X11 or Wayland can be found. Though
that's not trivial and a situation with old Wayland and no XWayland seems unlikely
to happen in practice.

Differential Revision: https://developer.blender.org/D16266
2022-11-03 15:46:44 +01:00
41c692ee2f Fix deprecation warnings in FFmpeg related code
The non-deprecated API dates back to 2017, so it should be safe
to simply migrate to it.

Fixes verbose error prints, making it easier to see actual issues.

Differential Revision: https://developer.blender.org/D16370
2022-11-03 15:18:02 +01:00
74c293863d Cycles: Remove use of sprintf() in MD5 code
The new Xcode declares the `sprintf()` function deprecated and
suggests to sue `snprintf()` as a safer alternative.

This change actually moves away from any formatted printing and
uses inlined byte-to-hex-string conversion which is also safe
and is (unmesurably) faster.

Differential Revision: https://developer.blender.org/D16378
2022-11-03 15:10:37 +01:00
90805c9943 Merge branch 'blender-v3.4-release' 2022-11-03 14:32:27 +01:00
09b9e1e95e Fix T102225: Crash opening menus
Seems to be introduced by 99e5024e97.

The crash is caused by the difference in the expected alignment
of the `uiPopupMenu` which is 16 bytes and the actual alignment
returned by the `MEM_mallocN()` which is 8 bytes due to the memory
head.

Now made it so that `MEM_new()` can be used for types with any
alignment.

Differential Revision: https://developer.blender.org/D16375
2022-11-03 14:32:04 +01:00
a16dd407b3 Revert "Blender 3.4 - Beta"
This reverts commit 666135c32a.
2022-11-03 10:12:46 +01:00
31c52bc34e Merge branch 'blender-v3.4-release' 2022-11-03 10:12:17 +01:00
ba8754cf11 Blender 3.5 Alpha: Start of new release cycle. 2022-11-03 10:11:13 +01:00
666135c32a Blender 3.4 - Beta
* BLENDER_VERSION_CYCLE set to beta
* Update pipeline_config.yaml to point to 3.2 branches and svn tags
* Update and uncomment BLENDER_VERSION in download.cmake
2022-11-03 10:08:10 +01:00
d5ce854fb1 CMake: workaround unsupported cmake_path(IS_PREFIX ..) in v3.20
Add a macro that implements something similar to cmake_path's IS_PREFIX
which isn't supported in older versions of CMake.

This caused the build-bot to fail.
2022-11-03 16:57:38 +11:00
65e4d169ba BLI_path: skip "/./" and "/." in BLI_path_name_at_index
This avoids having to run BLI_path_normalize before calling
BLI_path_name_at_index.
2022-11-03 15:33:08 +11:00
31d43cb0e7 Update RNA to User manual mappings 2022-11-03 00:32:22 -04:00
50c72069b4 Cleanup: replace BLI_join_path with BLI_join_string
There is no need to use path joining logic here.
2022-11-03 14:38:15 +11:00
92b2f4d249 BLI_string: C++ support for string joining macros
C++ doesn't support taking the temporary address of a temporary array,
use inline functions instead.

Also change array joining functions to return the length of the string
instead of returning the pointer (matching BLI_path_join).
2022-11-03 14:32:50 +11:00
5ba045af7b PyDocs: Upgrade Theme to 1.1.0
Updates to kbd and breadcrumbs along with some fixes to API docs that should'nt affect us.
2022-11-02 22:37:39 -04:00
ea94d5723f PyDocs: Upgrade Sphinx to 5.3.0
Trivial changes, should not affect us in anyway.
2022-11-02 22:35:42 -04:00
bb0b04f43a UI: Bevel: Specify the width type as "Width Type" in the status bar.
Part of T102224
2022-11-02 22:14:19 -04:00
6377d00a61 Cleanup: cmake comment line length 2022-11-03 12:11:08 +11:00
b320597697 Tests: don't create byte-code cache when calling Python from SVN
Creating `__pycache__` directories in SVN's lib/ directory can cause
updating SVN to fail. Add the -B flag when TEST_PYTHON_EXE from LIBDIR
is used so so Python doesn't generate this cache.
2022-11-03 11:51:52 +11:00
bad55d56bc Mesh: Parallelize remesh reprojections
In high poly meshes the reprojections after remesh can become slow.
This parallelizes reprojection of face sets, paint mask and vertex paint.
It also adds flags to disable dependency graph updates on
setting remesh options to remove UI lag.

Profiling of remeshing a 3.4M poly mesh (in sculpt mode):
Before: 19.6s
After: 8.7s

Differential Revision: https://developer.blender.org/D15638
2022-11-02 23:23:20 +01:00
a38b98478a Fix empty menu title in some menus (e.g. Text Editor context menu) 2022-11-02 18:01:18 +01:00
15fe7f3d93 Fix arrow key menu navigation using wrong direction
Steps to reproduce were:
* Right click in 3D View (context menu) press up or down arrow.

Or:
* Ctrl+Shift+O (Open Recent menu) press up or down arrow.
2022-11-02 17:57:36 +01:00
31746e1baa Fix memory leak with Freestyle renders after recent changes
Render stored a shallow copy of the scene view layers and views for thread
safety, without proper functions to free it. But with the CoW depsgraph this
scene is already a copy of the original and an additional copy is not needed.

Refactor to use the scene view layers and some other settings directly instead
of making a copy.
2022-11-02 17:16:50 +01:00
07ef428c6c Cycles: Add regression test for util_md5_string 2022-11-02 16:30:13 +01:00
38c7fd36ff Refactor: Rename Object->imat to Object->world_to_object
The goal is to improve clarity and readability, without
introducing big design changes.

Follows the recent obmat to object_to_world refactor: the
similar naming is used, and it is a run-time only rename,
meaning, there is no affect on .blend files.

This patch does not touch the redundant inversions. Those
can be removed in almost (if not all) cases, but it would
be the best to do it as a separate change.

Differential Revision: https://developer.blender.org/D16367
2022-11-02 15:42:23 +01:00
0fc958a174 Fix: Crash adding rest positions to empty mesh
The position attribute might not exist when the mesh is empty, which may
be another problem, but there is no need to count on it here.
2022-11-02 13:59:31 +01:00
bc8b15f1a5 Realtime Compositor: Move shaders to compositor module
This patch moves the GLSL shaders and their infos to the compositor
module as decided by the EEVEE & Viewport module. This is a non
functional change.

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

Reviewed By: Clement Foucault
2022-11-02 13:55:23 +02:00
c394f510a5 Realtime Compositor: Make vectors four dimensional
Currently, the realtime compositor treat vector types as 3D vectors,
which is true for most operations. However, some operations deal with
vector types as 4D vectors that encode two 2D vectors or one 3D vector
with the last component ignored. So this patch expands vector types to
include a fourth component that is only sometimes used.

Since we already stored vectors in RGBA textures, the necessary changes
are straightforward and are mostly concerned with adjusting the Result
class.

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

Reviewed By: Clement Foucault
2022-11-02 13:48:20 +02:00
Csaba Boncsér
14e4c96b64 Nodes: Reuse input sockets when creating new node groups
**Problem**
Currently multiple input sockets are created when a new node group is
made from selected nodes. Some of these are linked from the same source.
It is not convenient to sort out and remove multiple input sockets that
represent the same input. These inputs usually have meaningless names
like 'value', 'x', etc.

**Solution**
Create common input sockets for each link starting from the same input.
Move links inside the new group's node tree and reroute it to connect
the common input socket to the original nodes. This is done by building
up a mapping between the incoming link sources to the input interfaces
created for them. The input interfaces are reused by the rest of the
links having the same source.

This patch also changes the way the input sockets get their names.
Output socket names of the group nodes usually are specific and are
given consciously. Use the output socket names from group nodes instead
of the inputs where the links point to.

Differential Revision: https://developer.blender.org/D15802
2022-11-02 12:34:22 +01:00
5f7ca5462d Geometry Nodes: Add index and value inputs to sample curve node
As described in T92474 and T91650, this patch adds two features to the
sample curve node. First is an index input, to allow choosing the curve
to sample for each point. Second is a custom field input, which is
evaluated on the control points of the curve and then sampled like the
other outputs. There is an "All Curves" option for the old behavior
which takes the length of all curves into account.

For invalid curve indices, the node outputs zeros (default values).
Invalid lengths and factors are clamped.

There have been various discussions about splitting the node up more,
but this is an intuitive combination of options and will work well
enough for current use cases. The node could still be generalized more
in the future.

Keep in mind that the source field is evaluated on curve control points,
not the evaluated points used for sampling. This is necessary so that
fields like "Index" work as expected.

Differential Revision: https://developer.blender.org/D16147
2022-11-02 12:34:22 +01:00
460c9d3d92 Fix use-after-free in asset library storage destruction
Would only appear when more than 4 asset libraries were loaded, because
small buffer optimization would hide the issue.
2022-11-02 11:56:50 +01:00
638bf05a23 Fix BLI_path_parent_dir returning success with a single period as input
While relatively harmless, BLI_path_parent_dir wasn't returning failure
when passed in "./" which wouldn't succeed.

Instead of adding a ".." and normalizing, normalize the path and remove
the last directly. This is simpler than inspecting the resulting path
to see if normalize removed it or not.

Add additional tests which failed previously.
2022-11-02 17:17:28 +11:00
7f1e98839a Tests: enable path tests for WIN32
Tests for BLI_path_normalize, BLI_path_parent_dir & BLI_path_rel
were disabled on WIN32 because of complications with slash direction.

Enable these tests using character replacement to manipulate test data.
2022-11-02 16:15:48 +11:00
52664437fb Cleanup: use doxy sections for path tests 2022-11-02 14:28:00 +11:00
db43aa7729 Fix T102201: File selector shows "\" before folder names on WIN32
Regression in [0] on WIN32 caused joining paths {"//", "path"} to
result in "//\path".
This made the file selector show paths with a "\" prefix.

Add an exception for WIN32 where an initial path of forward slashes
is joined without a back-slash.

[0]: 8f7ab1bf46
2022-11-02 14:11:46 +11:00
5a90bbf716 Cleanup: format 2022-11-02 11:20:06 +11:00
889b3385b5 Cleanup: spelling in comments 2022-11-02 10:18:19 +11:00
cc6f41f8a5 Fix BLI_path_parent_dir failing on paths ending with ".."
The check for BLI_path_normalize having succeeded only checked for a
trailing "../" which isn't correct. This caused going up a directory
in the file selector to do nothing on directories ending with "..".

This also caused an empty path to expand into "../" because
BLI_path_extension_check didn't account for this case.

Resolve using BLI_path_name_at_index which extracts the last component
of the path without having to match the the surrounding slashes.
2022-11-02 07:21:10 +11:00
12f4ac1706 Fix BLI_path_normalize failing with "." and ".." in the path
The logic to go up a directory (using "..") ran before stripping "/./"
from the path. This caused "/a/b/./../" to result in "/a/b/"
instead of "/a/". Now redundant characters are removed before before
checking for ".." in paths.

Include test to ensure this works as expected.
2022-11-02 07:21:10 +11:00
513dfa179f Tests: add BLI_path_parent_dir tests, split BLI_path_normalize tests
Also enable a test that was disabled with a fix FIXME comment but works.
2022-11-02 07:21:10 +11:00
f8699881d6 CMake/MSVC: Disable ASAN for developer builds
ASAN is more often broken than working depending on the MSVC version
you have. As it is causing too many support incidents of people that
unknowingly turned ASAN on by running `make developer` and running
into issues starting blender due to the broken ASAN support in MSVC.

This commit changes the default not enable it for MSVC in the
developer profile. Devs that still want to enable it can do so though
turning WITH_COMPILER_ASAN on in their CMakeCache.txt or by running
`make developer asan`
2022-11-01 12:46:15 -06:00
f66236a827 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-01 18:36:45 +01:00
518d7dbebb UI/Nodes: Update node add menu as assets get loaded
Adds a listener to the node add menu so that it refreshes as assets get
loaded asynchronously.

Followup to cf98518055, also see 99e5024e97 and the previous commit.
2022-11-01 17:43:55 +01:00
78a7d5cfcc UI: Support C defined menu types to listen to notifiers
Needed to dynamically load assets as menu items, see cf98518055 and
99e5024e97. The next commit will add the listener for the node add menu.
2022-11-01 17:43:38 +01:00
bcc2656299 USD IO: replace deprecated primvars API.
Updated the code to use the UsdGeomPrimvarsAPI class to read
and write mesh primvars instead of the now deprecated primvars
accessors in UsdGeomImageable.  This will be required to build
with USD 22.11 in the future, where the deprecated functions
have been removed.
2022-11-01 11:55:58 -04:00
99e5024e97 UI: Support refreshing menu popups
This allows us to asynchronously load items into the menu, see
cf98518055. All menus spawned from Python using the `wm.call_menu`
operator will be affected by this. We could avoid that and only refresh
the menu we need to, but it's worth trying to get this to work as a
general menu feature.

This is a slightly risky change, so keeping an eye open for bugs.
2022-11-01 16:45:31 +01:00
cf98518055 Nodes: Add node group assets in add menu
This patch builds on the work from bdb5754147 to add node group
assets directly in the node editor add menu. Assets are added after
separators to distinguish them, but otherwise they look like any other
node. The catalog trees from all configured libraries are used to build
the menu hierarchy. Only catalogs with matching asset types are used
though.

There are a few limitations of this initial version. For now this only
supports geometry nodes. Support for other built-in node systems just
requires some refactoring of the corresponding add menu though. Lazy
loading will be added in a followup commit. For now there is a label
the first time the menu is opened.

Like the search menu integration, re-saving asset library files in 3.4
is required, if it hasn't been done already.

Implementation wise, there is a some ugly code here. A lot of that is
because the asset system isn't complete. The RNA API doesn't work well
yet, and the system isn't built to interact with multiple libraries at
once. It's also ugly because of the way we combine automatic menu
generation with builtin menus. As noted in a code comment, these two
systems could be merged completely so that the menus for builtin nodes
are also generated in the same way.

Differential Revision: https://developer.blender.org/D16135
2022-11-01 16:09:58 +01:00
e6823f32e9 USD tests: replace deprecated imaging code.
UsdImagingCapsuleAdapter static functions GetMeshPoints() and
GetTopology() have been removed in USD 22.11.  In anticipation
of this upcoming change, I've updated the test code to call
the corresponding virtual functions instead.
2022-11-01 10:32:36 -04:00
108b3ee33e Cleanup: Use bool for binary (true-ish/false-ish) return value 2022-11-01 15:19:49 +01:00
4269559215 Build: bump expat version to 2.5.0 to address CVE-2022-43680 2022-11-01 14:35:21 +01:00
3f91540cef 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-01 12:19:14 +01:00
3136fb886e Command line: Tweaked doc of --gpu-backend.
There was a trailing ')' without any '(' in the generated
documentation.
2022-11-01 11:45:17 +01:00
d2406ad17d Update OCLOC version used on Windows
This only affects Windows since Linux uses pre-compiled
OCLOC version.
2022-11-01 11:28:46 +01:00
f17fbf8065 Refactor: Rename Object->obmat to Object->object_to_world
Motivation is to disambiguate on the naming level what the matrix
actually means. It is very easy to understand the meaning backwards,
especially since in Python the name goes the opposite way (it is
called `world_matrix` in the Python API).

It is important to disambiguate the naming without making developers
to look into the comment in the header file (which is also not super
clear either). Additionally, more clear naming facilitates the unit
verification (or, in this case, space validation) when reading an
expression.

This patch calls the matrix `object_to_world` which makes it clear
from the local code what is it exactly going on. This is only done
on DNA level, and a lot of local variables still follow the old
naming.

A DNA rename is setup in a way that there is no change on the file
level, so there should be no regressions at all.

The possibility is to add `_matrix` or `_mat` suffix to the name
to make it explicit that it is a matrix. Although, not sure if it
really helps the readability, or is it something redundant.

Differential Revision: https://developer.blender.org/D16328
2022-11-01 10:48:18 +01:00
8b2b5b0b83 Fix compilation error on Windows.
Missing return statement in recent commit. Code is disabled by default,
so might not have been noticed.
2022-11-01 09:20:42 +01:00
fe863b59db Fix T102194: unhandled number keys on AZERTY layout under Wayland
Support layouts such as AZERTY where the shift key is held for number
keys. Text entry remains unchanged but these keys now activate shortcuts
as expected.

This matches a fix in X11 for the same problem: T47228.
2022-11-01 14:28:54 +11:00
4d139601ba CMake: mark Wayland variables advanced 2022-11-01 12:48:57 +11:00
afc091c3c4 Cleanup: spelling in comments 2022-11-01 12:24:58 +11:00
ef76a67153 Cleanup: doxy comment formatting 2022-11-01 12:24:04 +11:00
4d78211070 Cleanup: disambiguate naming for Wayland surfaces
Name surfaces for their use.
2022-11-01 11:32:17 +11:00
409070e0d4 GHOST/Wayland: support for multiple seats (one active seat at a time)
This isn't full multi-seat support, instead set the active seat using
pointer/tablet & keyboard enter handlers.

This means that seats beside the first aren't prevented from having
their events handled.
2022-11-01 11:32:17 +11:00
c3e4fa7404 Cleanup: fix translation for rare UV unwrapping with unit scale
Fixes very rare cases where the UV Cylinder Project, UV Sphere Project
and UV From View might not set the translation correctly if the scale
is exactly 1.0.

Mainly fixed because this code might later be reused elsewhere.
2022-11-01 12:50:16 +13:00
5016a8687c deps: openPGL 0.4.1-beta 2022-10-31 16:37:09 -06:00
a8ce926eaa Build: ignore more CVEs from tiff command line tools that we don't use 2022-10-31 20:05:11 +01:00
c082b088ab Fix bpy wheel on buildbot being incomplete on Windows
Need to explicitly install __init__.pyd for the case where the install
folder is different than the build folder.
2022-10-31 19:56:59 +01:00
8bddbc9a94 Fix bpy wheel build error on Windows, where there are no abi flags 2022-10-31 19:33:17 +01:00
6a3af76fbe Geometry Nodes: Use attribute API in deform curves on surface node
Retrieve the surface UV coordinates with the attribute API instead of
the helper function. This allows more flexibility of data types (and
domains), which is helpful especially because geometry nodes
can't write 2D vectors yet.
2022-10-31 19:09:25 +01:00
c39eb09ae5 Nodes: Improve socket node lookup performance
Use the newly added node topology cache to find the node that contains
a socket rather than looping through all nodes every time. The change
improves performance of drawing a some large node trees by 2-3x.
2022-10-31 16:32:32 +01:00
Jeroen Bakker
0e6f2d9fe0 GPU: Add placeholder for Vulkan backend.
This patch adds a placeholder for the vulkan backend.
When activated (`WITH_VULKAN_BACKEND=On` and `--gpu-backend vulkan`)
it might open a blender screen, but nothing should be visible as
none of the functions are implemented or otherwise crash on a nullptr.

This is expected as this is just a placeholder. The goal is to add shader compilation
+validation to this backend as one of the next steps so we can validate
changes to existing shaders on OpenGL, Metal and Vulkan at the same time.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D16338
2022-10-31 16:01:15 +01:00
c2e36c09b9 Fix variable value assigned twice in succession
Error introduced in rBa7aa0f1a0c24

Mentioned in https://pvs-studio.com/en/blog/posts/cpp/1004/

It could cause the absolute snap to the y direction to fail in
some editor.
2022-10-31 06:54:17 -03:00
2b9994257f Merge branch 'master' into temp-gpencil-automask 2022-10-31 09:57:01 +01:00
511ae22264 BLI_path: only operate on native path slashes for BLI_path_name_at_index
Prefer using the native path separator for low level path functions.
2022-10-31 13:21:24 +11:00
8f7ab1bf46 BLI_path: only operate on native path slashes for BLI_path_join
Previously both slashes were considered when joining paths, meaning
slashes that were part of the path name could be stripped before joining
the path.

Prefer using the native path separator for low level path functions,
callers can always convert slashes into the expected direction if they
need. This also matches BLI_path_append behavior.
2022-10-31 13:04:30 +11:00
fe5cbd5eea make_update: support updating "lib" as a single repository
With a full SVN checkout of "../lib", updating all paths is slower
than running an update on the whole repository at once.

Also collect paths and run the update in separate passes, this avoids
some duplicate checks such as checking the svn command exists.
2022-10-31 12:57:17 +11:00
5042f895ce make_update: add type hints 2022-10-31 12:54:36 +11:00
06abc9509d Cleanup: quiet warning building with MSVC (_CONCAT redefined)
This is defined by a system header (xatomic.h) with MSVC.
2022-10-31 11:15:38 +11:00
8c6d4aa103 Fix T102126 Regression: Grease Pencil: Broken 2D Layering
This was because `stroke_id` was not using `vertex_start`.
But since `vertex_start` is not 1 based like it used to be, we need to add
1 to it to avoid a fragment depth of `0.0` which would be equal to the
background and not render.
2022-10-30 17:31:01 +01:00
da365bc2ad Fix T102163: GPencil:Set start point Operator make stroke deleted
There were two problems:

* The stroke was deleted if the last point was selected. Now
the stroke is flipped because is faster.

* If the second point was selected, the first point was removed
because the internal api, removed one point strokes by
default.  This was done becaus ethe tools that used this API
did not need one point strokes as result. Now this optional 
and keep one point strokes.
2022-10-30 16:15:23 +01:00
77749eff87 DRW: Manager: Add possibility to record a framebuffer change inside a pass
This is a convenience when one needs to often change the current framebuffer
and avoid the overhead of creating many Main/Simple passes.
2022-10-30 15:00:28 +01:00
486e281644 Fix T102160: Regression: GPencil gradient fill not working
Was caused by uvs not being sourced from the correct buffer.
2022-10-30 13:00:38 +01:00
117e17fb22 DRW: Manager: Allow custom draw command in PassMain
This allows using drawcalls with non default vertex range.
These calls will be culled like any other instance by the GPU culling
pipeline. But they will not be batched together since the vertex range
is part of the group.
2022-10-30 12:36:33 +01:00
9bd38750b3 Cleanup: replace BLI string copy & append with BLI_path_join(..)
Copying and appending is unnecessarily verbose with each call having to
pass in the buffer size.
2022-10-30 15:56:28 +11:00
5392f220f0 BLI_path: add BLI_path_append_dir (appends and ensures trailing slash)
Avoid copying the string then calling BLI_path_slash_ensure afterwards.
2022-10-30 15:56:23 +11:00
d66f24cfe3 Fix potential buffer overflow with BLI_path_slash_ensure use
BLI_path_slash_ensure was appending to fixed sized buffers without
a size check.
2022-10-30 15:34:02 +11:00
5d77c3a6a5 Fix T102132: Directory selection fails to add trailing slash
Regression in [0], accessing the path from the file selector relied on
BLI_join_dirfile adding a trailing "/" when the filename was empty.

[0]: 9f6a045e23
2022-10-30 15:24:41 +11:00
d1d2f002c7 make.bat: skip SVN update when running make code_update
regression from rB116d7b0042bba7d6cabd8e04c7d020ac3816caf3
2022-10-29 11:25:33 -06:00
78fe6d7ab1 NLA: Push down Action names the Track after the Action
When pushing down an Action to a new NLA track, the track is now named
after the Action.
2022-10-29 17:08:12 +02:00
2c9fe719e6 Cleanup: use STREQ macro 2022-10-29 12:07:42 +11:00
Damian Trebilco
f9113b7eb6 Cycles: add Equiangular Cubemap Face camera projection
This can be used for example for VR video formats that use this projection
instead of perspective projection for cubemap faces.

Differential Revision: https://developer.blender.org/D13525
2022-10-28 16:24:03 +02:00
105c8d59cd Cleanup: format 2022-10-28 17:06:21 +11:00
d799388b02 Cleanup: quiet unused argument warnings and minor changes in GHOST 2022-10-28 17:05:13 +11:00
bb16a3af7f Fix error in leaving the tablet pointer set under Wayland
Missed clearing the tablet pointer after updating removing the tablet
manager.
2022-10-28 17:03:39 +11:00
af761021a3 GHOST/Wayland: code-comments
Note issues with track-pad event handling, add some other notes too.
2022-10-28 13:08:41 +11:00
48d8aa7484 Fix failure to clear DND in_use in rare cases under Wayland
If opening a pipe failed, 'data_offer->dnd.in_use' wasn't cleared.
Avoid early return where it duplicates logic in an error prone way.
2022-10-28 12:37:44 +11:00
586d9214b7 Cleanup: use common prefix for static ghost/wayland variables
File level static variable names weren't well distinguished from others.
Use `ghost_wl_` prefix for static variables.
2022-10-28 12:21:42 +11:00
18e0f741c8 GHOST/Wayland: improve code-comments 2022-10-28 12:16:25 +11:00
d447cf9704 Cleanup: use plain 'char *' for mime types in GHOST/Wayland
There wasn't much advantage in using C++ native types as all Wayland
API's deal with C strings.
2022-10-28 12:12:07 +11:00
00533de7d5 Cleanup: move GWL_DataOffer in_use to the 'dnd' struct
It wasn't clear that this is only used for drag & drop,
also don't use an atomic type as all access is guarded by the
drag & drop mutex.
2022-10-28 11:15:25 +11:00
d488a87d70 GHOST/Wayland: postpone reading from the clipboard until needed
A copy of the clipboard was always being, changes would re-read it.
Now read the clipboard on request. This avoids having to keep a copy
of the clipboard in memory as well as the need to keep a thread
to running to read the clipboard for each data-offer.

To prevent a deadlock when pasting from Blender's own clipboard.

- Sending the clipboard (using write(..)) runs in a background thread.
- Reading the clipboard uses a thread that performs round-trips to the
  Wayland server to prevent until the read is complete.

This is an update to [0] that resolves the deadlock.

[0]: c03838dbc8
2022-10-28 10:23:29 +11:00
b544d989d1 GHOST/Wayland: unlock clipboard mutex on failure
When the Wayland pipe can't be opened, don't leave the mutex locked.
Also skip checking wl_data_device_manager when reading from the primary
clipboard.
2022-10-28 09:32:03 +11:00
454dd3f7f0 Cycles: fix up logic in oneAPI devices filtering
CYCLES_ONEAPI_ALL_DEVICES environment variable wasn't working as
intended after 305b92e05f.
2022-10-27 23:09:14 +02:00
Anton Raves
7c3cd63f95 Fix T102085: X11 Startup crash
wl_registry_destroy does not enjoy being fed a null pointer.
Added a null check to keep it out of trouble.
2022-10-27 13:29:03 -06:00
c967bdcbb1 GPencil: Fix MSVC warning in lineart_cpp_bridge.cc
MSVC give a rather large warning when using blender::parallel_sort
without using a lambda for the comparison.

Fixed by using a lambda
2022-10-27 09:16:51 -06:00
a035861d9d Cleanup: Format 2022-10-27 16:55:34 +02:00
8712f952e0 Fix merge issues 2022-10-27 16:50:48 +02:00
28de4468d9 Merge branch 'master' into temp-gpencil-automask 2022-10-27 16:48:44 +02:00
2625c39ce7 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-10-27 16:47:02 +02:00
e75be000e3 GHOST/Wayland: replace deferred registration with an update callback
There were two issues caused by deferred registration (added by [0]),
one crash on startup (T102075), another unreported issue with the GLX/EGL
context failing to initialize. Unfortunately I'm unable to reproduce the
errors but it seems likely deferring interface registration is not well
supported so this commit uses an alternative solution to some interfaces
depending on others for initialization.

Instead of relying on the order of registration, a separate "update"
callback has been added which is called after binding interfaces.
This has the advantage that it can be called when adding/removing
interfaces at run-time to avoid the dangling pointers being left in
locally allocated structures. In practice adding/removing interfaces
happens so rarely (only with "outputs" as far as I'm aware) that this
benefit is theoretical at the moment.

This should resolve T102075.

[0]: 9fe9705bc0
2022-10-27 19:23:46 +11:00
1e7776907c 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-10-26 19:59:55 +02:00
0385e4df3c 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-10-26 19:59:55 +02:00
1840f44666 Fix build error on Windows without precompiled headers
Recent refactoring to use uint relied on indirect includes and precompiled
headers for uint to be defined. Explicitly include BLI_sys_types where this
type is used now.
2022-10-26 19:59:55 +02:00
bc7de854c9 Sculpt: fix T102067: Set material properly in new pbvh draw
Note: Still need to fix PBVH_BMESH.
2022-10-26 19:01:43 +02:00
414d5429fe Cycles: oneAPI: update dg2 target to acm-g10
Reverting 63aec82e8a since IGC dependency
now supports acm-g10 target.
2022-10-26 18:30:48 +02:00
ff89c1793d Cycles: List Level-Zero in oneAPI device requirements in the UI on Linux
Intel documentation for Ubuntu 22.04 does list all runtime components
needed by the driver and oneAPI Cycles device but end-users getting
drivers from (other) sources can easily end-up missing required
Level-Zero Loader and struggle root causing what's wrong in their
system. Calling this requirement out in the UI will hopefull help them.

oneAPI Level-Zero incl. Loader: https://github.com/oneapi-src/level-zero
Common package names: level-zero, level-zero-loader
2022-10-26 14:13:18 +02:00
4b14b33ea8 Cycles: use packed float3 back for oneAPI
This fixes a 15% performance regression silently introduced by
79ab76e156 that aligned the compact
float3 on 16 bytes for oneAPI.
Current change is minimalist, there are further cleanup opportunities
such as removing packed_float3 definition for oneAPI but for some
reason, it cuts the recovered speedup in half, so we're starting with
this small fix for now.

Reviewed by: brecht

Differential Revision: https://developer.blender.org/D16340
2022-10-26 10:53:23 +02:00
633d314b75 Fix T101790: MNEE caustic settings are not visible in the UI when using Metal
This patch fixes T101790 by adding a macOS version check for deciding whether to show the caustics settings in the UI  (MNEE kernels don't compile on macOS < 13.0)

Reviewed By: brecht

Maniphest Tasks: T101790

Differential Revision: https://developer.blender.org/D16339
2022-10-26 09:36:07 +01:00
16acd7e473 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-10-26 09:11:17 +02:00
2186d58d1c 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-10-26 09:10:50 +02:00
49cd04044a Revert "GHOST/Wayland: postpone reading from the clipboard until needed"
This reverts commit c03838dbc8.

Pasting from Blender's own clipboard locked the process.
This needs furhter investigation.
2022-10-26 15:44:31 +11:00
c03838dbc8 GHOST/Wayland: postpone reading from the clipboard until needed
A copy of the clipboard was always being, changes would re-read it.
Now read the clipboard on request. This avoids having to keep a copy
of the clipboard in memory as well as the need to keep a thread
to running to read the clipboard for each data-offer.
2022-10-26 14:15:00 +11:00
4046d9a384 Cleanup: remove GWL_RegisteryAdd_Params.wl_registry
No longer needed now GWL_Display holds a reference to the registry.
2022-10-26 12:18:46 +11:00
e844f706fb GHOST/Wayland: support device add/removal at runtime
Keep the registry listener active at runtime, now plugging/unplugging
monitors at run-time is detected and the associated data stored by
Blender is added/removed as well.

Previously all interfaces were detected at startup, afterwards no
changes were supported.
2022-10-26 12:11:44 +11:00
9fe9705bc0 GHOST/Wayland: use a predictable order for interface registration
Defer interface registration so all known interfaces can be called in
the order defined by the array of supported types.

Without this, the compositor defined the order of registration so it
wasn't possible to rely on registration functions to depend on other
interfaces.

This caused initialization for 'seats' to be moved out of the
register callback to ensure multiple interfaces were initialized.
This isn't good for readability or maintenance since it meant the
add/remove callbacks didn't act on matching data.
2022-10-26 12:11:44 +11:00
14c218b3fd deps_builder: fix hardcoded path
the windows builder has 2 different build folders for the debug and
release libs, hardcoding the path like this leads to an extra 1GB
of downloaded files. The windows builder supplies a single PACKAGE_DIR
for both but gets ignored.

This change promotes PACKAGE_DIR to be cached in CMakeCache so it can
be changed if needed.

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

Reviewed by; brecht, dfelinto
2022-10-25 17:00:48 -06:00
4a87f8107e Cleanup: format 2022-10-26 09:33:22 +13:00
9d18874083 Fix window flickering when moving windows between monitors in Wayland
Moving widows between monitors with different scale set could flicker
in a feedback loop because the bounds of the window resizing could
cause the bounds of the windows to overlap different monitors.

Now the window is resized immediately, instead of letting the change
to the windows surface scale resize the window.
2022-10-26 02:01:01 +11:00
7da85ea35a Fix Cycles build error on 32bit x86 2022-10-25 16:56:35 +02:00
601995c3b8 Cleanup: Curves: Remove GPUTexture wrappers for buffer texture
These are unecessary now that we can bind buffers as textures directly.
2022-10-25 16:44:21 +02:00
7522c05076 Fix T102052 GPencil: stroke outline glitches in object mode
Was caused by an extra point per stroke being drawn.
2022-10-25 16:12:17 +02:00
ffdb41a8bc DRW: Pointcloud: Refactor drawing to remove instancing
This change the attribute binding scheme to something similar to the
curves objects. Attributes are now buffer textures sampled per points.

The actual geometry is now rendered using an index buffer that avoid too
many vertex shader invocation.

Drawcall is wrapped in a DRW function to reduce complexity of future
changes.
2022-10-25 15:50:13 +02:00
fb424db2b7 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-10-25 14:06:02 +02:00
2240ca3e7b 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-10-25 13:42:23 +02:00
78b13ab3db Fix T102048: Tablet cursor remains hidden under KDE/Wayland 2022-10-25 22:27:12 +11:00
c4f9e4afab GHOST/Wayland: swap tablet middle/right mouse buttons
There looks to be an inconsistency between Gnome/KDE here,
match KDE and Gnome applications under X11 (even XWayland)
by making the button closest to the nib MMB, and the other button RMB.
2022-10-25 20:42:46 +11:00
7e3e4751b5 UI: Fix count on node editor/group header when fake user
The number of node groups was including the fake user count.
I was ignoring the Fake User, and how it affects the id->us count.

This problem was present since the initial commit: 84825e4ed2.
2022-10-25 10:15:24 +02:00
9c717dcff8 Merge branch 'master' into temp-gpencil-automask 2022-10-25 09:51:38 +02:00
3e292404d2 Build: fix/workaround for the opencollada.diff not applying on Linux 2022-10-25 17:51:30 +11:00
059d963192 GHOST/Wayland: store fractional scaling in each window instead of DPI
This makes it possible to access the fractional scaling for a window,
there is no need to store the DPI which can be returned by getDPIHint().
2022-10-25 15:56:09 +11:00
dd08b490af Cleanup: move singleton pointers into the system
Avoid top level global pointers, remove the window_manager pointer
and move the clipboard mutex along side the clipboard data.

Also skip updating window DPI if the window doesn't use the output
that changed it's scale.
2022-10-25 15:00:03 +11:00
71079d49e2 Cleanup: move ghost/wayland local methods after type declarations
Also correct prefix naming.
2022-10-25 15:00:02 +11:00
bf0ae05d25 Fix T82412: Space-mouse not registering (WIN32)
Using the 3DConnexion Universal Wireless Receiver on MS-Windows caused
a different ID to be reported. While I'm not sure of the cause of this,
adding the ID doesn't conflict with other devices and fixes the problem.
2022-10-25 13:37:38 +11:00
c1768507a9 Correct naming in 97414fb484 2022-10-25 13:24:56 +11:00
97414fb484 GHOST/Wayland: support adding/removing global objects at runtime
Share logic for adding/removing global objects and freeing them on exit.

Refactor object registration add/remove into an array of callbacks
to localize logic into generic functions for each kind of interface.

Also corrects own error where the primary clipboard manager wasn't
being destroyed on exit.
2022-10-25 13:06:07 +11:00
5d5e0f1b0e GPencil: Fix crash when using circle or rectangle tool
This was caused by a wrongly sized vertex buffer for the stroke buffer.
2022-10-24 21:44:57 +02:00
e2d06eb68a GPencil: Fix missing fills
For some reason stroke_id needs to be the triangle index, not the vertex
index.
2022-10-24 21:44:57 +02:00
954b834053 Fix T102015: AV1 - No valid formats found
I did a poor master merge in D14920 before landing and AV_CODEC_ID_AV1
accidentally ended up in `ffmpeg_format_items` rather than
`ffmpeg_codec_items`
2022-10-24 12:03:41 -06:00
583ae0caaa VSE: Don't use timecodes if not explicitly enabled
UI panel may suggest, that disabling "Proxy & timecode" would cause
timecodes not being used, but this was not the case. Now timecodes will
be used only if the checkbox is checked.
2022-10-24 20:02:32 +02:00
4e9a8109b2 Fix T100571: Subdivision disabled with Orbit Around Selection
The bug has existed since crasy space was implemented.

rBbf8a26b7453d made the error even worse as the
`modifiers_disable_subsurf_temporary` function, which works like a
toggle, did not temporarily re-enable subsurf.

The main problem is that the derived mesh is modified but not marked as
dirty at the end.
2022-10-24 14:59:00 -03:00
a67876103a 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.
2022-10-24 19:46:42 +02:00
5379587772 Fix T101210: invalid internal node links lead to crash
Internal links are run-time/derived data. Therefore it is not necessary
to load them from .blend files where invalid internal links may be stored.
They will be regenerated after a node tree is loaded anyway.
2022-10-24 19:01:14 +02:00
63675b8d70 GPencil: Fix regression (part3) with edit mode introduced in rB0ee9282b5c51
Vertex indexing has not been updated and stroke_start usage was wrong.
Update all `stroke_start` usage.
2022-10-24 18:19:23 +02:00
8dd7b5b26b Cycles: Metal integrator state size tuning
This patch tunes the integrator state sizing for Metal (`num_concurrent_states` and `num_concurrent_busy_states`).

On all GPUs architecture, we adjust the busy:total states ratio to be 1:4 which gives better rendering performance than the previous 1:16 ratio (independent of total state count). This gives a small performance uplift (e.g. 2-3% on M1 Ultra).

Additionally for M2 architectures, we double the overall state size if there is available headroom. Inclusive of the first change, we can expect uplift of close to 10% in future, as this results in larger dispatch sizes and minimises work submission overheads. In order to make an accurate determination of available headroom, we defer the calculation of `num_concurrent_states` and `num_concurrent_busy_states` until the time of integrator state allocation (i.e. after all of the scene data has been allocated). We also refactor `alloc_integrator_soa` to calculate an *exact* single-state-size in a first pass, right before allocating the integrator SoA buffers in a second pass.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D16313
2022-10-24 17:14:33 +01:00
4c6e07230f Pencil: Fix regression (part2) with stroke buffer introduced in rB0ee9282b5c51
`vert_len` was being shadowed and index_min & max wasn't correctly set.
2022-10-24 16:25:04 +02:00
b400717326 GPencil: Fix regression with stroke buffer introduced in rB0ee9282b5c51 2022-10-24 15:28:49 +02:00
a8731718a1 GPencil: Fix regressions introduced in rB0ee9282b5c51
Batching was broken / disabled and starting indices were wrong.
2022-10-24 12:55:41 +02:00
9fc000cc6f 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-10-24 12:20:11 +02:00
0584a88046 Fix T102008: Images are stretched when texture limit is enabled
Currently, if an image exceed the texture limit setup by the user or the
GPU backend, it will be scaled down to satisfy the limit. However,
scaling happens independently per axis, that means the aspect ratio of
the image will not be maintained.

This patch corrects the smaller size to maintain the aspect ratio.

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

Reviews By: Clement Foucault
2022-10-24 12:15:22 +02:00
365cce4750 GPencil: Fix build errors caused by designated initializer in C++ 2022-10-24 12:07:54 +02:00
216e8d887b Cleanup: quiet parentheses warning 2022-10-24 20:32:03 +11:00
0ee9282b5c GPencil: Use indexed rendering instead of instances
This allows using instancing in other ways, like resources indexing.
2022-10-24 11:21:17 +02:00
b27c831e0c GPencil: Port draw_cache_impl_gpencil.cc to C++ 2022-10-24 11:21:17 +02:00
b7c5ce8c2d Transform: limit zero radius Shrink/Fatten to only 1 curve point
rBb70bbfadfece allowed scaling of zero-radius points, but as it behaves
differently from other radius, it may not be suitable for multi-point
transformation.
2022-10-24 00:16:21 -03:00
93afc50ac3 Fix large incremental snap values in uv editor
Regression in rBa7aa0f1a0c24.

The default values of `t->snap` have been changed.
2022-10-23 11:34:51 -03:00
da36efdf48 GHOST: expand GHOST_PRINT/PRINTF without WITH_GHOST_DEBUG
It was too easy accidentally break builds without WITH_GHOST_DEBUG
enabled because the arguments were ignored. Now they are expanded in an
`if (0) {...}` block, so invalid expressions result in errors.
2022-10-23 17:41:04 +11:00
6172258250 Fix build error when WITH_GHOST_DEBUG is enabled 2022-10-23 17:21:22 +11:00
4130cad489 Fix T101607: Changing Image source inadvertently clears file path
This could result in wrong behavior depending on the order in which the
Image.filepath and Image.source fields are set from within Python for
example.

Caused by rB72ab6faf5d80
2022-10-22 22:11:59 -07:00
763ad17769 GHOST/Wayland: support building with older versions of pointer-gestures
Missing support for the hold gesture broke building on the build-bot.
Since this gesture was only logged, it's harmless to leave it off.
2022-10-23 15:24:06 +11:00
ca0f4f8c5c Fix crash on exit when background rendering in wayland
Disable libdecor Wayland requirement which would use an X11 fallback.

While the crash could be investigated, using libdecor at all makes
no sense in background mode.
2022-10-23 14:07:22 +11:00
b70bbfadfe Fix T102000: Curve Shrink Fatten doesn't work for zero radius
Kind of intentional regression on rB2d1fe736fabd.

But the solution now is (theoretically) better than adding a hard coded
threshold.

For cases with zero radius, the new radius is now the offset of the
ratio projected onto the plane of the origin point.
2022-10-22 19:32:06 -03:00
afec1cd333 Cleanup: clang-format 2022-10-22 18:32:06 +02:00
21fdb0d92b 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-10-22 18:17:01 +02:00
588db6152a Transform: remove unreachable code
The node grid snap only works with 2D coordinates, no transformation
matrix and no Objects.

Also rename `applyGridAbsolute` to `node_snap_grid_apply`.
2022-10-22 13:00:40 -03:00
e16cea019e Cleanup: move grid snap functions to files where they are used 2022-10-22 13:00:40 -03:00
a7aa0f1a0c Fix T101991: "Absolute Grid Snap" not working
Error introduced in rB1edebb794b76.

In that commit it was kind of forgotten that the snap to grid is also
used in 3D views.

Also a refactoring and cleanup was applied to simplify the code.
2022-10-22 12:38:48 -03:00
9f56021975 Fix T101930: NLA Actions Stash remove doesn't work on overriden linked data.
Code adding stash track was clearing out track flags, instead of editing
them as it should have...

Note that there are a lot of other weaknesses in action stash code (like
relying on the (translated!!!!!!) name of the track to know whether it's
a stah or not).
2022-10-22 17:19:55 +02:00
8bb211a771 GHOST/Wayland: multi-touch gesture support
Add support for zoom & rotate gestures, hold and swipe may
be used in the future although swipe maps to 2D smooth-scroll for
Gnome & KDE.

Tested to work with Apple track-pad & Wacom tablet on Gnome & KDE.
2022-10-22 18:01:39 +11:00
e54ea0f90e Cleanup: use wl_/wp_ prefix to match native Wayland types 2022-10-22 16:49:19 +11:00
23c05a916c GHOST/Wayland: support changing seat capabilities at run-time 2022-10-22 16:49:19 +11:00
Stephen Seo
59a0b49c10 Video rendering: FFMpeg AV1 codec encoding support
Previously, the Blender video renderer did not have support for
encoding video to AV1 (not to be confused with the container AVI).
The proposed solution is to leverage the existing FFMpeg renderer
to encode to AV1.

Note that avcodec_find_encoder(AV_CODEC_ID_AV1) usually returns
"libaom-av1" which is the "reference implementation" for AV1 encoding
(the default for FFMpeg, and is slow). "libsvtav1" is faster and
preferred so there is extra handling when fetching the AV1 codec for
encoding such that "libsvtav1" is used when possible.

This commit should only affect the options available for video
rendering, which includes the additional AV1 codec to choose from, and
setting "-crf".

Also note that the current release of FFMpeg for ArchLinux does not
support "-crf" for "libsvtav1", but the equivalent option "-qp" is
supported and used as a fallback when "libsvtav1" is used (as
mentioned here: https://trac.ffmpeg.org/wiki/Encode/AV1#SVT-AV1 ).
(Actually, both "-crf" and "-qp" is specified with the same value in
the code. When a release of FFMpeg obtains support for "-crf" for
"libsvtav1" is released, the code shouldn't be needed to change.)

The usage of the AV1 codec should be very similar to the usage of the
H264 codec, but is limited to the "mp4" and "mkv" containers.

This patch pertains to the "VFX & Video" module, as its main purpose
is to supplement the Video Sequencer tool with the additional AV1
codec for encoded video output.

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

Reviewed By: sergey , ISS, zeddb
2022-10-21 20:10:17 -06:00
ea571ddc29 Fix T101969: Crash when using large texture with nonstandard colorspace
When the image colorspace is not data, linear or sRGB, the image will
be converted to float (and colorspace-converted) during loading.

However, if it also needs to be rescaled (due to exceeding the GPU
texture size limit), the resizing assumed that it's still a byte
texture.
2022-10-22 02:51:52 +02:00
04eab0fd01 deps_builder: expose FORCE_CHECK_HASH as an option
The check was already there, but given it was not
exposed as an option it didn't show up in my cmakecache
and i got tired of having to lookup the exact name
all the time.
2022-10-21 12:48:17 -06:00
e7a6917617 Build: add option to error when features can't be enabled
This is to help ensure buildbot builds are correct, while still gracefully
disabling features in user/developer builds.

* Add WITH_STRICT_BUILD_OPTIONS to give an error when features can't be
  enabled due to missing libraries or other reasons. Add new macro
  set_and_warn_library_found used everywhere features were being
  automatically disabled.

* Remove code from Windows and macOS for various libraries that would
  automatically disable features. set_and_warn_library_found could be
  used here also, but we are generally assuming the precompiled libraries
  are complete and only test for availability when libraries are just
  added.

Differential Revision: https://developer.blender.org/D16104
2022-10-21 20:04:47 +02:00
ebe2319692 Build: disable JACK option in macOS releases
It has not actually been enabled there for a long time in official releases,
so this just fixes the warning. Making it work again would be good, but for
now JACK is only supported on Linux.
2022-10-21 20:04:47 +02:00
56d1f0772d 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-21 20:04:47 +02:00
9c20eda0ad Fix T101244: Empty point list in shader batch creation cause error
Allow empty VBOs in Python GPUBatch creation.
2022-10-21 14:24:30 -03:00
116d7b0042 make.bat: update the libraries before calling update_sources.py
The issue we ran into a lot is we have a python script that updates
git+SVN. Which works fine most of the time, except when we have a
python update in SVN, or worse a python version change. Python really
doesn't enjoy having its files being deleted or changed while it is
running and users generally end up with a corrupted lib folder.

This change updates the library folder using svn.exe first before
letting the python script run sidestepping the issue in most cases.

The python script will still run and do the more elaborate work
like updating git and switching SVN branches which could still
run into issues cause python still doesn't like being changed
while running but there's not a whole lot we can about that,
for *most* people however things will just work now.
2022-10-21 09:50:14 -06:00
2c108d5503 Avoid re-compilation of oneAPI AoT kernels when configuration changes
Buildbot infrastructure relies on the fact that it can enable and
disable `WITH_CYCLES_<COMPUTE>_BINARIES` without affecting speed of
incremental builds. This allows buildbot to skip GPU kernels when
doing CI regression tests which do not need GPU kernels, as well as
it allows to move GPU kernels compilation to a separate step where
all the resources are available to the GPU kernel builders.

For the oneAPI compute enabling and disabling AoT kernels has much
higher implications due to the kernels being a part of the device
implementation from the build target perspective.

This change makes it so different target names are used for JIT and
AoT configurations, which allows CMake to more fully benefit from
"caching" the compiled result.

The end goal of this change is to make it so sequential build of the
same code base on the buildbot happens super fast,

Blender binary still needs to be re-linked when the AOT of oneAPI
option is toggled, but that's already the case in the buildbot due
to the WITH_BUILDINFO.

Differential Revision: https://developer.blender.org/D16312
2022-10-21 17:17:51 +02:00
048f1a1b8b GPU: remove unused member from FrameBuffer
Accidentally added in rB2510bd3a5f35d14f5e0e098c79a776916d273223
2022-10-21 11:57:42 -03:00
2c3ee8854f Merge branch 'master' into temp-gpencil-automask 2022-10-21 15:39:53 +02:00
0cfac5b043 Cycles: oneAPI: migrate from deprecated APIs, require libSYCL 6.0+
sycl::info::device::ext_intel_* descriptors are deprecated,
replaced with sycl::ext::intel::info::device:: that are available from
6.0+, for which we now check version in CMake.
2022-10-21 15:36:49 +02:00
305b92e05f Cycles: oneAPI: remove use of SYCL host device
Host device is deprecated in SYCL 2020 spec, cpu device or standard C++
should be used instead.
2022-10-21 15:36:48 +02:00
Edward
4776a74bf7 Fix T101974: Potential memoryleak GHOST_WindowWayland.newDrawingContext
Reviewed By: jbakker

Maniphest Tasks: T101974

Differential Revision: https://developer.blender.org/D16309
2022-10-21 15:35:30 +02:00
ec60c8abe7 SystemInfo: Add active GPU backend.
For debugging it is useful to known the active GPU backend. Although
it could be determined from looking at the extensions, this is easier
to understand when not activly working in this area.
2022-10-21 15:06:07 +02:00
3ccec47841 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-10-21 07:04:21 -06:00
d39f2eed98 GPU: Don't exit after first GPUBackend. 2022-10-21 14:58:27 +02:00
e8c4411035 GPU: Add gpu.platform.backend_type_get function.
Function returns the active GPU backend type.
2022-10-21 14:58:27 +02:00
3225bc2e7f GPU: Fix Metal GLSL compilation errors due to recent changes.
vec.st is legacy OpenGL and should not be used.
2022-10-21 14:58:27 +02:00
f0ebf696cb 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.
2022-10-21 09:53:07 -03:00
899d4ddbd0 Fix: Bokeh blur node flips its bokeh input
The bokeh blur node flipped its bokeh input due to the conceptual
difference between the search window space and the weights texture
space. This patches fixes that by inverting the weights texture to match
the search window.

The variable size option actually flips the bokeh input for the CPU
compositor. It is unclear if this is expected, so we deviate from that
behavior for now.
2022-10-21 14:05:19 +02:00
26f181c6b7 EEVEE: Fix ill defined blend in cubemap array workaround
This fixes some firefly issues on corners of the cubemaps where the
blending factors would go above 1 or below 0.
2022-10-21 13:11:39 +02:00
4bfb99e4d8 Cycles: Bump versions of DPC++, IGC, and dependencies
Patch by Xavier Hallade. Committing next to the actual libraries update
in the svn.
2022-10-21 12:19:54 +02:00
5814e35af1 install_deps: Update OSL for Blender 2.4 release.
As requested by T101403, OSL version is now 1.12.6.2.
2022-10-21 08:51:23 +02:00
a0bbd65d57 Fix T66713: Walk mode doesn't take scene unit scale into account
When changing a scene's unit scale from 1 to something else, 0.1 for
e.g. walk navigation no longer worked properly. Whenever gravity is
enabled, and the user starts to fall or jump, the view-port glitched out
into low earth orbit.

Reviewed By: campbellbarton

Ref D16277
2022-10-21 16:17:22 +11:00
dc09cc13ea deps_builder: add missing OSLNoise library on windows
OSLNoise is a new library, was missing in the debug
configuration on windows.
2022-10-20 18:31:15 -06:00
6515177981 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-10-20 18:29:59 -06:00
ff8c0f062a GHOST/Wayland: code comments, minor improvements
- Clarify how data_offer is used for both the clipboard & drag-and-drop.
- Acquire the clipboards mutex lock before freeing.
- Log a warning when creating a pipe fails.
- Add doxy-sections.
2022-10-21 11:08:03 +11:00
97f4e076c7 Fix: USD & Alembic importers might not initialize material indices
f1c0249f34 incorrectly assumed that the importer functions that
assigned material indices set all of the values, but that isn't true
for all files.
2022-10-20 17:23:54 -05:00
bd1ff201b1 Buildfix for 078e034 missing include 2022-10-20 21:06:44 +02:00
8c361d6f66 deps_builder: fix missing png harvest on windows 2022-10-20 11:46:42 -06:00
5e0e5b1341 Fix T101215: Distribute Points in Volume node does not refresh on frame change 2022-10-20 18:02:14 +02:00
24fd8f729a Fix memory leak when proxy building fails
Leak introduced in recent fix - bf8d4a9bc6.
2022-10-20 17:59:23 +02:00
4b30ee773c Fix T101316: workbench texture mode not working with geometry nodes
The `ED_object_get_active_image` is used from the renderer which deals with
evaluated objects. This means the material api for evaluated objects has
to be used.
2022-10-20 17:34:43 +02:00
3bac6f17f1 install_deps: Update Python, OIIO, openPGL and FFMPEG versions.
Update libraries for Blender 3.4, according to T101403:
* python: 3.10.8
* OIIO: 2.3.20.0
* OpenPGL: 0.4.0-beta
* FFMpeg: 5.1.2
2022-10-20 17:07:53 +02:00
8415bc9c80 Fix T101554: disable viewer node when corresponding modifier is disabled 2022-10-20 16:54:32 +02:00
84825e4ed2 UI: Icon number indicator for data-blocks
Adds the possibility of having a little number on top of icons.

At the moment this is used for:
* Outliner
* Node Editor bread-crumb
* Node Group node header

For the outliner there is almost no functional change. It is mostly a refactor
to handle the indicators as part of the icon shader instead of the outliner
draw code. (note that this was already recently changed in a5d3b648e3).

The difference is that now we use rounded border rectangle instead of
circles, and we can go up to 999 elements.

So for the outliner this shows the number of collapsed elements of a
certain type (e.g., mesh objects inside a collapsed collection).

For the node editors is being used to show the use count for the data-block.
This is important for the node editor, so users know whether the node-group
they are editing (or are about to edit) is used elsewhere. This is
particularly important when the Node Options are hidden, which is the
default for node groups appended from the asset libraries.

---

Note: This can be easily enabled for ID templates which can then be part
of T84669. It just need to call UI_but_icon_indicator_number_set in the
function template_add_button_search_menu.

---

Special thanks Clément Foucault for the help figuring out the shader,
Julian Eisel for the help navigating the UI code, and Pablo Vazquez for
the collaboration in this design solution.

For images showing the result check the Differential Revision.
Differential Revision: https://developer.blender.org/D16284
2022-10-20 16:46:54 +02:00
58e25f11ae Realtime Compositor: Implement normalize node
This patch implements the normalize node for the realtime compositor.

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

Reviewed By: Clement Foucault
2022-10-20 16:32:28 +02:00
9d710374bd Fix T101645: division by zero in fillet node 2022-10-20 16:15:16 +02:00
Monique Dewanchand
f017fdecef ViewLayer: Reduce object duplication syncing
During object duplication the syncing is temporarily disabled.
With {D15885} this isn't useful as when disabled the view_layer
is still accessed to locate bases. This can be improved by first
locating the source bases, then duplicate and sync and locate
the new bases.

This patch removes the resync forbid and improve the times
that resyncing actually must happen.

Reviewed By: mont29

Maniphest Tasks: T73411

Differential Revision: https://developer.blender.org/D15886
2022-10-20 16:14:36 +02:00
66a166d236 GL: Make restart index consistent on older implementation
This prevents weird quirks where the implementation might skip
the ushort max index even in non-indexed draws.
2022-10-20 16:07:14 +02:00
7aaebf31df Cycles: replace (tm) with unicode equivalent in UI
It was already done for (TM) which is present in some GPU names on Windows.
Names on Linux ended up using (tm) instead:
91fec2657a
2022-10-20 15:49:36 +02:00
7f2cd2d969 Realtime Compositor: Implement Tone Map node
This patch implements the tone map node for the realtime compositor
based on the two papers:

Reinhard, Erik, et al. "Photographic tone reproduction for digital
images." Proceedings of the 29th annual conference on Computer graphics
and interactive techniques. 2002.

Reinhard, Erik, and Kate Devlin. "Dynamic range reduction inspired by
photoreceptor physiology." IEEE transactions on visualization and
computer graphics 11.1 (2005): 13-24.

The original implementation should be revisited later due to apparent
incompatibilities with the reference papers, which makes the operation
less useful.

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

Reviewed By: Clement Foucault
2022-10-20 15:02:41 +02:00
fd7a3e2622 Cleanup: compiler warnings 2022-10-20 13:57:59 +02:00
0d7065504e 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-10-20 13:57:45 +02:00
21deba56aa 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-10-20 13:56:01 +02:00
debacbfe5c Build: update OpenPGL hash for re-tagged version without symbols conflicts
Ref D16269, T101403
2022-10-20 13:56:01 +02:00
303dd263e2 Build: update OSL to version 1.12.6.2
Required changes to make OSL pick up the new oslnoise library.

Ref D16269, T101403
2022-10-20 13:56:01 +02:00
a30128a3c1 Fix missing free in 8a43bfd8fd 2022-10-20 22:26:13 +11:00
c81bc09876 GPU: Avoid undocumented/fragile dependency on shader enumerator order
Previously this was using `GPU_SHADER_TEXT` as default value indicating
an "unset" state. This wasn't documented in the definition (and so
D16284 added a new enumerator that broke this). Plus code was assuming
this enumerator would always have the value 0 without specifying this in
the definition either.

In this case it's easy to not rely on the enum value at all, and just
use `std::optional` to add a "unset" state.

Differential Revision: https://developer.blender.org/D16303
2022-10-20 13:17:22 +02:00
8a43bfd8fd GHOST/Wayland: refactor copy/paste buffer storage
- Improve reporting when reading a file descriptor into a buffer fails,
  also check for failure to allocate memory.
- Store buffers with size in a simple struct.
- Use shared utility functions for simple buffer operations.
2022-10-20 22:15:34 +11:00
40afb8ae6a Lib reload/relocate: Improve performances.
Reduce amounts of viewlayer updates during remapping while relocating
libraries. Gives some improvements on relocating process, depending on
complexity of existing scene and reloaded libraries, whether there is
liboverrides to resync, etc., can give up to 10% speedup.
2022-10-20 11:39:59 +02:00
bd9d68e4dc 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-10-20 11:39:59 +02:00
ff157d7eba Fix incorrect shader state after shader interface creation
Use store-current-and-restore-previous OpenGL program in the OpenGL
Shader Interface. This is a better fix for the initial error, which
additionally solves interface artifacts when opening non-default
startyp files on macOS with AMD GPU.
2022-10-20 10:09:32 +02:00
90686ff6f4 Fix WebM naming in the interface
Use the official spelling of the WebM codec. Only affects the interface
string and not the identifier used in the Python API. Should not even
affect translations: the current msgstr's do no translate the original
string.

Reported by Anton Raves, thanks!
2022-10-20 09:52:37 +02:00
b0eff51fb7 GHOST/Wayland: primary clipboard support
Match X11's primary clipboard support
(typically used for MMB to paste the previous selection).
2022-10-20 14:39:04 +11:00
1e1b9eef1b GHOST/Wayland: skip redundant strlen() sending the clipboard 2022-10-20 13:58:42 +11:00
d392e9afea Cleanup: correct prefix for internal wayland utility function 2022-10-20 13:58:42 +11:00
f24dfdcd3c Cleanup: format 2022-10-20 13:57:43 +11:00
c58d6b30ad GHOST/Wayland: correct assert from recent commit
Error in [0], only clear the stored clipboard data source pointer if it
matches the data being cleared.

[0]: 09e3ea49db
2022-10-20 13:57:43 +11:00
e2a93e9c7c Fix T94136: Cycles: No Hair Shadows with Transparent BSDF 2022-10-20 04:47:21 +02:00
3915f5300a Fix T99151: Cycles not updating on Object Type visibility change
Differential Revision: https://developer.blender.org/D16259
2022-10-20 02:36:36 +02:00
3411a96e74 Fix T93382: Blender still generates subsurface render passes
In T93382, the problem was that the Blender-side rendering code was
still generating the subsurface passes because the old render pass
flags were set, even though Cycles doesn't generate them anymore.

After a closer look, it turns out that the entire hardcoded pass
creation code can be removed. We already have an Engine API function
to query the list of render passes from the engine, so we might as
well just call that and create the returned passes.

Turns out that Eevee already did this anyways. On the Cycles side, it
allows to deduplicate a lot of `BlenderSync::sync_render_passes`.
Before, passes were defined in engine.py and in sync.cpp. Now, all
passes that engine.py returns are created automatically, so sync.cpp
only needs to handle a few special cases.

I'm not really concerned about affecting external renderer addons,
since they already needed to handle the old "builtin passes" in
their Engine API implementation anyways to make them show up in the
compositor. So, unless they missed that for like 10 releases, they
should not notice any difference.

Differential Revision: https://developer.blender.org/D16295
2022-10-20 02:23:28 +02:00
e3075f3cf7 Cleanup: simplify uv packing api
Part of a wider set of changes to migrate UV packing from
uv_parametrizer.cc to uvedit_islands.cc.

This allows UV packing improvements including margin calculation,
correctness fixes such as support for non-manifold geometry,
and new packing algorithms including speed and quality improvements.

See for example c2256bf7f7, T82637

This change migrates UV.unwrap and Live UV Unwrap.

Differential Revision: https://developer.blender.org/D16296
2022-10-20 12:44:56 +13:00
21a1c332b0 GHOST/Wayland: update code comment for Gnome-Shell workaround
Note that the bug has been fixed upstream.
2022-10-20 10:03:55 +11:00
09e3ea49db GHOST/Wayland: clear data source pointer when canceled
The external cancel callback destroyed the data source but didn't
clear the pointer. While this didn't cause problems,
avoid keeping references freed pointers.
2022-10-20 10:03:55 +11:00
c67975c6bb Cleanup: use 'wl_' prefix for data_source
Without this the local and wayland native types could be mixed up.
2022-10-20 10:03:55 +11:00
1a11353d34 Cleanup: Remove unused grease pencil / RNA includes 2022-10-19 16:33:44 -05:00
ba6f25dd1b Fix T101907: restore snapping in node editor
Regression from 1edebb794b
2022-10-20 10:10:39 +13:00
bf8d4a9bc6 Fix T101857: Crash when trying to build proxies on read-only filesystem
Skip building if proxy file can't be created.
2022-10-19 21:07:52 +02:00
d046c8c9d7 Fix T101926: Curves: Remove type-specific attributes when deleting
Remove NURBS or Bezier specific attributes after removing points or
curves. In theory we could avoid copying those attributes in the
first place, but that doesn't seem worth the extra complexity here,
since we don't necessarily know the result curve type counts before
copying attributes.
2022-10-19 13:39:23 -05:00
193b456d2d 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-10-19 20:34:53 +02:00
Yann Lanthony
c3d0ba3b33 Fix T101622: Sequencer channels not updating while panning view
`V2D_VIEWSYNC_AREA_VERTICAL` flag was mistakenly set to the sequencer
toolbar region instead of the channels region.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D16155
2022-10-19 20:14:58 +02:00
c14b113746 Fix: Geometry Nodes: Memory leak when deleting instances
The instance attributes assignment operators were broken in multiple
ways: there wasn't a move constructor (probably causing performance
issues), and the destination attributes weren't freed before they
were replaced.
2022-10-19 13:12:20 -05:00
a803dbe7ed Geometry Nodes: Use common utility for copying attribute data
Attribute copying often uses identical logic for copying selected
elements or copying with an index map. Instead of reimplementing
this in each file, use the common implementation in the array_utils
namespace. This makes the commonality more obvious, gives improved
performance (this implementation is multithreaded), reduces binary
size (I observed a 173KB reduction), and probably reduces compile time.
2022-10-19 12:38:48 -05:00
Morteza Mostajab
e6902d19a0 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

Reviewed By: brecht

Maniphest Tasks: T92212

Differential Revision: https://developer.blender.org/D16253
2022-10-19 17:09:38 +01:00
053fc35b01 EEVEE: Depth Of Field: Replace ambiguous select with manual check
This is an attempt to remove a driver bug.
2022-10-19 17:55:51 +02:00
63aec82e8a Cycles: oneAPI: switch back target to dg2
Current version of IGC dependency doesn't yet support acm-g10 target.
2022-10-19 17:47:21 +02:00
bad7340811 Fix control reaches end of non-void function error 2022-10-19 17:32:43 +02:00
96c085d4af Cleanup: WM: Fix missing enumerator case in switch 2022-10-19 17:19:18 +02:00
3d878cd0df 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-10-19 17:08:30 +02:00
ceb0e7fcea Fix (devs-reported) mistake in batch delete code in recent change.
Mistake in own rB358155a8da60, change ended up discarding the case where
we need to also delete IDs using a tagged-to-be-deleted ID in a 'never
NULL' way. Typical example: Whene deleting a Mesh ID, one also needs to
delete all the Objects using that mesh, since obdata pointer is of type
'never NULL'.

Note that luckily, this fix does not affect the performance improvements
from rB358155a8da60.

Noted by Brecht and Clement because of failing unittests, shame on me.
2022-10-19 16:52:48 +02:00
d763e294fc Cycles: oneAPI: fix libsycl.so files harvesting
was missing libsycl.so.5.7.0-16 when using such version.
2022-10-19 16:42:10 +02:00
151b653bd5 Cycles: oneAPI: fix clean Windows ninja builds
Previously, a first build using ninja would throw "ninja: error:
'intern/cycles/kernel/cycles_kernel_oneapi.lib', needed by
'bin/blender.exe', missing and no known rule to make it".
2022-10-19 16:42:10 +02:00
5bfce9a822 Cycles: oneAPI: preload kernels only when not using prebuilt binaries
sycl::build triggers compilation even if prebuilt binaries are
available, we'll have to find a better way in this case.
2022-10-19 16:42:10 +02:00
86bb79e756 Cycles: oneAPI: update dg2 target to acm-g10
"dg2" target is deprecated from the GPU compiler/ocloc.
We switch to targeting acm-g10 instead, for which generated binaries are
compatible with other Arc GPUs.
2022-10-19 16:42:10 +02:00
2943997d2a Cycles: oneAPI: include sycl/sycl.hpp instead of CL/sycl.hpp
Since SYCL 2020 API, sycl/sycl.hpp is the way.
2022-10-19 16:42:10 +02:00
d816bae7bf Cycles: oneAPI: fix check_usm for debug builds 2022-10-19 16:42:10 +02:00
5d67fb0f18 Cycles: oneAPI: fix MSVC_TOOLS_DIR for some build environments
MSVC Tools version doesn't match MSVC Redist version on some systems and
it's not populated when using Ninja outside of Visual Studio shell,
trying another way.
2022-10-19 16:42:10 +02:00
425e7ca342 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-10-19 10:59:17 -03:00
6165395927 Fix T101922: transforming surface points misses redraw
Oversight in rBf8b1483566cc which resulted in fonts/surfaces not having
their draw caches being tagged dirty.

Not only OB_CURVES_LEGACY have their object data of type ID_CU_LEGACY,
but also OB_SURF/OB_FONT objects.

Maniphest Tasks: T101922

Differential Revision: https://developer.blender.org/D16298
2022-10-19 15:45:46 +02:00
Jeroen Bakker
3655eb7ff0 Blender: Add command line argument to switch gpu backends.
Add command line argument to switch gpu backend. Add `--gpu-backend` option to
override the gpu backend selected by Blender.

Values for this option that will be available in releases for now are:
* opengl: Force blender to select OpenGL backend.

During development and depending on compile options additional values can exist:
* metal: Force Blender to select Metal backend.

When this option isn't provided the internal logic for GPU backend selection will be used.
Note that this is at the time of writing the same as always selecting the opengl backend.

Reviewed By: fclem, brecht, MichaelPW

Differential Revision: https://developer.blender.org/D16297
2022-10-19 15:13:26 +02:00
ead3fc4a07 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-19 18:20:47 +05:30
3ac2f15a04 GL: Fix incorrect shader state after shader interface creation
The interface needs to bind the shaders for some parameter setup.
This program change wasn't reflected in the GPUContext.
This was then conflicting with the next shader bind if the next shader was
the same as the shader bound before the interface creation.

Setting the state to the correct shader ensures a rebind if needed.

Fix T101792 New hair curves do not render properly first time in EEVEE with motion blur enabled
2022-10-19 14:40:42 +02:00
f0fba1a2d8 GHOST/Wayland: invert touch-pad scrolling
This should use the system preference for scroll direction eventually,
for now default to a down-motion scrolling down (matching GTK & QT).
2022-10-19 21:48:42 +11:00
ec638d3108 GHOST/Wayland: only prioritize discrete scroll for mouse wheel events
Smooth & discrete scrolling may both be set, instead of always
prioritizing discrete, use discrete scrolling when the source is a
mouse wheel, otherwise prioritize smooth scrolling.
2022-10-19 21:37:14 +11:00
89525fae59 Cleanup: CMake include paths
Remove redundant separators & redundant references to parent paths.
2022-10-19 21:37:10 +11:00
d4b8e9b69f Cleanup: format 2022-10-19 21:32:12 +11:00
b51763a773 Fix T101888: Curves editmode: modifiers "Display in Edit mode" no effect
Add the eModifierMode_Editmode to the required modes for curves modifier
evaluation. Only this way the modifier can be skipped in evaluation.

Maniphest Tasks: T101888

Differential Revision: https://developer.blender.org/D16280
2022-10-19 11:57:43 +02:00
2180e6fc9f Curves: make the "surface_uv_map" a searchable dropdown
The users had to type in a name here, but we can also make it a dropdown
choice with existing UV Maps for convenience:
- dont have to remember a name or copy paste obviously
- shows in red if it was removed / invalid

Came up in T101028

Maniphest Tasks: T101028

Differential Revision: https://developer.blender.org/D15956
2022-10-19 11:56:27 +02:00
e5782df4ab Fix (unreported) error messages about invalid ID usercount when batch-deleting IDs.
Batch-delete by-passes a lot of ID usages handling in to-be-deleted IDs,
so usercount of deleted IDs needs to be manually reset to avoid the
annoying error messages in the console.
2022-10-19 10:27:56 +02:00
358155a8da Make batch ID deletion 100 times faster.
Simplify and optimize remapping handling in bacth ID deletion, by moving
it outside of the initial loop gathering all IDs to be deleted, and and
by using batch remapping code.

Speedup can be over 100 times faster in complex production scenes using
thousands of IDs, when e.g. deleting a whole library.

Examples before/after times on my machine (deleting two different libraries):
lib1:  5.55 sec/0.03 sec
lib2: 13.60 sec/0.13 sec

Found while investigating T101903.
2022-10-19 10:17:33 +02:00
a450a2f2b2 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-19 09:22:02 +02:00
4163c63def Curves sculptmode: fix missing mode and tool in Brush Specials
For consistency with other brush based (paint) systems we should add
these entries in the brushes context menu.
For this, expose the brushes `ob_mode` to RNA and show this (along with
the tool choice) to the appropriate menus.

Differential Revision: https://developer.blender.org/D16287
2022-10-19 08:53:09 +02:00
4d185921f6 Sculpt curves: Fix BKE_paint_object_mode_from_paintmode
Currently harmless (since atm. it is not possible to trigger this part
of the code from curves sculpting), but in a future fix (for T101518), it
would be good to use `BKE_paint_init` (and having the correct ob_mode
for the brush would be nice).

Differential Revision: https://developer.blender.org/D16286
2022-10-19 08:52:27 +02:00
96fa5e1e84 Cleanup: remove unused 'VIEW3D_MT_brush_context_menu_paint_modes'
This was added in rB4c9fe657458f, however that new code never used this
menu (but the existing `VIEW3D_MT_brush_paint_modes` instead).

Differential Revision: https://developer.blender.org/D16285
2022-10-19 08:50:38 +02:00
760a6aa1f5 Fix error in 30d9a6245f
X/Y for mouse wheel events was unintentionally flipped.
2022-10-19 16:35:32 +11:00
30d9a6245f GHOST/Wayland: support high resolution 2D track-pad scroll events
These events are interpreted as MOUSEPAN by Blender.
Tested with a Wacom Intuos5. This isn't full touch support
which is needed to support gestures such as Swipe, Rotate .. etc.
2022-10-19 16:32:32 +11:00
da4bd24c3e Sculpt: Improve performance of face set creation from selection
Skip BMesh conversion and read the selection attribute directly.
With a Ryzen 3700x, my test face of a simple 4 million face grid
became over 4000 times faster, from 2.6s to 0.6ms.
2022-10-18 23:44:16 -05:00
42f37106c5 GHOST/Wayland: add listener for touch events (no touch support yet)
Currently unused as my tablet isn't generating touch events.
This may be useful for development as touch events are logged.
2022-10-19 14:53:48 +11:00
e4c5a46c12 Cleanup: remove NDOF_BUTTON_NONE from the range of usable buttons
This is used to represent unknown state, so there is no need to be
able to store it's pressed state.
2022-10-19 14:07:36 +11:00
c9f1378863 Cleanup: use '_' suffix for private members for NDOF Manager 2022-10-19 13:53:20 +11:00
c247562b07 GHOST/NDOF: various minor changes to NDOF manager
- Use logging for NDOF device output
  (this removes printing on startup buy default).
- Use `ndof_` prefix for button maps.
- Use full sentences.
2022-10-19 13:38:31 +11:00
ab28abcb6b Cleanup: remove the last button from NDOF button enum values
This is only used for comparison, no need to make it part of the enum.
2022-10-19 12:58:36 +11:00
ecda118be4 Fix T101866: Incorrect buttons for space-mouse enterprise
Use key from spacenavd's wiki.

Also add keys: ENTER, DELETE, TAB, SPACE & Views 1-3.
2022-10-19 12:52:58 +11:00
8aca40652a Cleanup: spelling in comments 2022-10-19 12:52:55 +11:00
8115d30dca License headers: add missing license identifiers 2022-10-19 12:52:54 +11:00
be32882e1c Fix T101883: Issue applying modifier to mesh with shape keys
Caused by 21f2bacad9 which misunderstood the logic handling
shape keys in this function. The shape key on the original mesh in the
main data-base should be cleared if the "no-main" mesh doesn't have any
shape key layers and the vertex count has changed. The complexity is
necessary because shape keys are stored differently on original and
evaluated meshes.

Also change to "Warn" because this is expected behavior in some cases,
like when applying a geometry nodes modifier that creates a new mesh
from scratch.
2022-10-18 15:57:57 -05:00
d57352b114 Fix T101893: Auto merge affecting edge crease and bevel weight
None of the special transformations in `special_aftertrans_update__mesh`
are really applicable or useful for edge crease and bevel weight.
2022-10-18 12:51:32 -03:00
91e85230f9 Fix T101660: crash when trying to propagate string attributes in some nodes
String attributes are intentionally not fully supported in geometry nodes
yet because more design work is necessary to decide how they should behave.

For now just disable handling string attributes to avoid crashes.
2022-10-18 17:17:08 +02:00
91ecf47b2c Fix: Sample nearest surface node crash with empty mesh 2022-10-18 10:07:32 -05:00
a2fcfcabd7 Cleanup: add missing CPPType for MStringProperty 2022-10-18 16:50:42 +02:00
7abd79398d Fix T101642: crash when deleting group output inside node group 2022-10-18 16:15:27 +02:00
5c1d2c5a9d Brush: Wrap mtex/mask_tex around functions.
`Brush` has two attributes for holding texture information (`MTex`).
One for color textures (`mtex`) and one for mask textures (`mask_mtex`).

Unfortunately sculpt mode due to reasons used `mtex` to store mask textures.
Changes like brush asset/paint mode require modes/tools to read the mask/color texture from
one place.

To start sanatizing this we isolate the attributes in functions.
`BKE_brush_color_texture_get` and `BKE_brush_mask_texture_get`. All object
paint modes should use these functions.
2022-10-18 16:06:40 +02:00
619ce8392b Depsgraph: wrong copy-on-write update after depsgraph rebuild
Differential Revision: https://developer.blender.org/D16268
2022-10-18 15:49:05 +02:00
489260198e File Browser: Fix slowdown with non-existing ID previews in big files
When the File (or Asset) Browser would display data-blocks without
previews in a heavy .blend file, there would be a drastic slowdown.

See patch for details and comparison videos.

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

Reviewed by: Bastien Montagne
2022-10-18 15:10:59 +02:00
c2fe387244 Build: get make deps working with Xcode command line tools
Deduplicating code with Xcode detection for Blender builds.
2022-10-18 14:17:28 +02:00
Sebastian Herholz
2006c3ed10 Fix T101529: Blender crashes when using Path Guiding 2022-10-18 13:59:12 +02:00
Jason Fielder
aed301704a Metal: MTLBatch and MTLDrawList implementation.
MTLBatch and MTLDrawList implementation enables use of Metal Viewport for UI and Workbench. Includes Vertex descriptor caching and SSBO Vertex Fetch mode draw call submission.

Authored by Apple: Michael Parkin-White

Ref T96261

Reviewed By: fclem

Maniphest Tasks: T96261

Differential Revision: https://developer.blender.org/D16101
2022-10-18 12:47:43 +02:00
e3ab75d17d Merge branch 'master' into temp-gpencil-automask 2022-10-18 10:15:46 +02:00
e47bf05e85 NDOF: use logging for GHOST so users can enable event logging
Previously this was only available as a build options, making it
difficult to get user feedback when NDOF events didn't work as expected.

Now logging can be enabled with:

  blender --log "ghost.ndof.*" --log-level 2 --log-show-basename
2022-10-18 14:54:33 +11:00
1edebb794b UV: support snapping on non-uniform grids
Part of a wider set of changes to Grid and Pixel snapping in the
UV Editor.

This change fixes snapping behavior for non-uniform grids, either
manually specified Fixed grids, or pixel grids where the underlying
image is non-square.

See a24fc6bbc1 for visual changes.

Maniphest Tasks: T78391

Differential Revision: https://developer.blender.org/D16275
2022-10-18 16:05:30 +13:00
c7051192e2 UI: Improve tooltip for texture shading mode
Pointed out in T98506
2022-10-17 22:57:10 -04:00
85875455b9 Fix T101872: Curves sculpt deform node crash with changed curve count
There might be more or fewer curves in the input to the deform curves on
surface node than the original, so the curve's surface UV coordinates
need to be retrieved from the original curves.
2022-10-17 17:08:09 -05:00
161aa5e0d0 Fix T101882: Division by zero in mesh topology nodes
A vertex might be connected to no edges or no faces. Most of these nodes
worked fine in that case, but we might as well make that explicit
and skip the sorting anyway.
2022-10-17 16:51:42 -05:00
e8291f4504 Sculpt: Remove face sets from default cube
As discussed in T101623, since face sets have become optionally stored,
(see b5f7af31d6) the default cube shouldn't have face sets--
they should be created explicitly by the user instead. This may improve
performance when modifying the default cube mesh.
2022-10-17 13:18:25 -05:00
23ea72f051 Cleanup: Move versioning_defaults.c to C++ 2022-10-17 13:18:25 -05:00
603a534f09 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
2022-10-17 21:03:37 +03:00
728451f01a Fix T101871: Realize instances node can skip material indices
The node only created a material index attribute on the result mesh
if it existed on any of the input meshes. But the input meshes might
not have the attribute if they had a single material or no materials.
As a fix, also create the attribute if the result has more than one
material.
2022-10-17 12:21:30 -05:00
Jason Fielder
d3b47fa842 FIX T101445: halo Particles are not working.
color uniform assignment needing to be changed to ucolor was missed.

Ref T101445

Reviewed By: fclem

Maniphest Tasks: T101445

Differential Revision: https://developer.blender.org/D16236
2022-10-17 17:46:51 +02:00
694481095b Fix for T101506: BLF Disable Kerning in Main Font
Disable kerning in our main font to exactly restore the spacing of text
as seen in Blender 3.1 - 3.3

See D16186 for more details.

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

Reviewed by Brecht Van Lommel
2022-10-17 08:35:11 -07:00
67e053b1fb Fix merge error 2022-10-17 16:59:46 +02:00
3150277d0c Merge branch 'master' into temp-gpencil-automask 2022-10-17 16:57:31 +02:00
660c47596e Weight Paint: relax heuristic to determine when final mesh can be used.
Checking for polygon and loop data to be referenced is too fragile
re changes in geometry node implementations. Instead, compare counts
of polygons, face corners and vertices: topology changes are unlikely
to keep all three unchanged.

Ref D15501
2022-10-17 16:48:29 +03:00
1111af5cb4 Sculpt: add versioning for Auto-masking cavity factor default
Also remove automasking_cavity_factor default from RNA for brushes.
Data-blocks set their defaults via `DNA_brush_defaults.h`

Continuation from previous commit and rBdb40b6

Thanks to Dalai for the help!
2022-10-17 14:47:58 +02:00
0a35afbf86 Fix T99565: Cycles reading TGA files with alpha different than Blender
Thanks to Lukas for tracking down the cause in OIIO.
2022-10-17 14:34:25 +02:00
3eaf2b7fc6 Fix OpenPGL and OneAPI being detected by CMake when Cycles is disabled 2022-10-17 14:34:25 +02:00
baa9a00f5f Fix Wayland not being disabled when dependencies are not found 2022-10-17 14:34:25 +02:00
390cf2fe75 Cleanup: compiler warnings 2022-10-17 14:34:25 +02:00
69e7274d4f Brush: Fix mismatch in DNA Brush defaults
Missed changing the DNA brush default in rBdb40b6

Thanks to SteffenD for reporting in blender.chat!
2022-10-17 14:11:21 +02:00
e96ad822b3 Fix AssetCatalogTest failure on WIN32
Recent changes to path handling (most likely [0]) caused
AssetCatalogTest.create_catalog_after_loading_file to fail on WIN32.

The test relied on the resulting path to be joined with "/" as a path
separator. The resulting path used both forward and back-slashes.
While these do work for some API's on WIN32, mixing both in a file path
isn't expected behavior in most cases, so update the tests to use native
slash direction for file-paths.

[0]: 9f6a045e23
2022-10-17 21:27:05 +11:00
Iliya Katueshenock
a6b83617e9 Fix T101705: crash when connecting reroute to multi-input socket
Differential Revision: https://developer.blender.org/D16203
2022-10-17 12:00:09 +02:00
e5425b566d Geometry Nodes: separate Instances from InstancesComponent
This makes instance handling more consistent with all the other geometry
component types. For example, `MeshComponent` contains a `Mesh *` and
now `InstancesComponent` has a `Instances *`.

Differential Revision: https://developer.blender.org/D16137
2022-10-17 11:39:58 +02:00
Pablo Vazquez
db40b62252 Sculpt: Auto-masking UI improvements
Add auto-masking as a popover in the header while in Sculpt mode,
following the design in T101593.

These properties were present in the Options panel (and popover),
they have been removed from there.

Moreover, this commit makes the auto-masking section in Brush settings
match the new popover.

In the future this popover can be used for other modes that support
auto-masking such as Grease Pencil.

See D16145 for details and screenshots.

Reviewed By: JulienKaspar

Differential Revision: https://developer.blender.org/D16145
2022-10-17 11:23:16 +02:00
11bb38e887 Make sure all dependency graphs are updated on particles system copy 2022-10-17 11:03:21 +02:00
89effac57e Fix T101851: Duplicating a particle system crashes 2022-10-17 11:02:13 +02:00
3e35beae61 Cleanup: correct doc-string & remove unused define
Minor edits to recent commits.
2022-10-17 12:41:56 +11:00
94ce176e75 Cleanup: renaming GHOST/Wayland functions & private members
- Use `_` suffix for private members.
- Use `wl_` prefix for Wayland native types to help distinguish
  them from local types.
- Replace single character names `d` & `w` with `display` `window`.
- Rename `selection` to `clipboard`. Using the primary selection as a
  clipboard is a separate and as yet unsupported feature.
2022-10-17 12:25:40 +11:00
9f6a045e23 Cleanup: replace BLI_join_dirfile with BLI_path_join
These functions are almost identical, the main difference being
BLI_join_dirfile didn't trim existing slashes when joining paths
however this isn't an important difference that warrants a separate
function.
2022-10-17 11:38:54 +11:00
1d1cade9a9 BLI_path: remove trailing NULL argument to BLI_path_join
Using varargs had the disadvantages, replace with a macro which has
some advantages.

- Arguments are type checked.
- Less verbose.
- Unintended NULL arguments would silently terminate joining paths.
- Passing in a NULL argument warns with GCC.
2022-10-17 11:16:41 +11:00
2f3f208901 Cleanup: spelling in comments, unused arg warning 2022-10-17 11:16:39 +11:00
6ad04a031c Cycles: Fix floor intrinsic for ARM Neon 2022-10-17 01:13:43 +02:00
25e84334f7 Sculpt: Fix T101864: Mask initialization not updating multires data
BKE_sculpt_mask_layers_ensure now takes a depsgraph argument and
will evaluate the depsgraph if a multires mask layer is added.
This is necassary to update the multires runtime data so that
pbvh knows it has a grids mask layer.

Also added code to update pbvh->gridkey.
2022-10-16 13:24:26 -07:00
Monique Dewanchand
4c320e2639 Fix T101394: Ensure all viewlayers on scene copy.
When a scene copy is called, all viewlayers are ensured before they are
copied. In case of multiple viewlayers, a viewlayer can be out of sync.
This triggers an assert in the BKE_view_layer_copy_data.

Reviewed By: mont29

Maniphest Tasks: T101394

Differential Revision: https://developer.blender.org/D16214
2022-10-16 11:24:07 +02:00
0c50f9c4aa 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-16 02:34:10 +02:00
b898330c37 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-15 23:11:20 +02:00
ebe9804cfa Cleanup: comment out unused lambda parameter 2022-10-14 23:03:10 -07:00
b7ea79fde7 Sculpt: Fix face set relax being too strong 2022-10-14 23:00:13 -07:00
c207571d44 Sculpt: Fix draw artifacts when drawing multires mask 2022-10-14 22:51:45 -07:00
010c10febe Sculpt: Ensure faces are uniquely assigned to PBVHNodes
PBVH_FACES and PBVH_GRIDS do not store faces directly in nodes;
instead they store 'primitives', which are tesselation triangles
for PBVH_FACES and grids (which are per-loop) for PBVH_GRIDS.

Primitives from the same face could sometimes end up in different
PBVH nodes.  This is now prevented in two ways:

* All primitives of the same face are given the same boundary
  during PBVH build.  This prevents them from being swapped
  away from each other during partitioning.
* build_sub adjusts the final partition midpoint to fall
  between primitives of different faces.
2022-10-14 22:08:36 -07:00
bc06fcca47 Sculpt: do not validate PBVH draw data in mesh_batch_cache_valid
Turns out PBVH drawing and normal mesh batches are not mutually
exclusive inside the draw cache; there are edge cases with modifiers
and instancing where you need both, and forcing one or the other
inside this function leads to memory corruption.
2022-10-14 15:00:42 -07:00
7a005e089d Sculpt: fix crash when instancing sculpt objects 2022-10-14 15:00:42 -07:00
2111fab88a Fix: Missing part of previous BMesh bug fix
Missed actually using the variables from 6f190c669f.
2022-10-14 16:26:49 -05:00
6c4b72b135 Fix T101746: Node copy and paste changes multi-input socket order
The multi-input indices have to be copied, and updated after
pasting in case all original connected nodes weren't copied.
2022-10-14 14:18:59 -05:00
Sebastian Herholz
a90b0eb772 Deps: Updating OpenPGL 0.4.0 hash value 2022-10-14 21:10:55 +02:00
e3de5af135 Fix wrong Cycles default radius for motion blurred point clouds
Missing from recent commit to change the default in a6db2c2.
2022-10-14 19:51:28 +02:00
9e77f5f17f Fix T101803: Max length Operator bl_idname is truncated 1 character.
There were quite a few issues here:
* Bad usage of nagic number leading to confusing code
* Forgetting to take into accoun final `NULL` char
* RNA code thinkin `bl_idname` is python version, when it is actually
  BL/C version.
2022-10-14 18:35:28 +02:00
4112f0241b Fix: Draw: Initialize StencilSet in the correct order
tmp
2022-10-14 17:00:13 +02:00
7437b6b4bc Merge branch 'master' into temp-gpencil-automask 2022-10-14 16:28:18 +02:00
Jun Mizutani
f940ecde7a Cleanup: Fix wrong comment of breadcrumb tree path
The breadcrumb of tree path in node editor is displayed on the top of the editor.

Reviewed by: PratikPB2123

Diff: https://developer.blender.org/D14994
2022-10-14 19:19:47 +05:30
Charlie Jolly
84d70de25a Fix: Muted curves connect to the Fac socket
Resolve by setting no_muted_links() on Factor sockets.

Same issue as T101613

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D16153
2022-10-14 14:21:58 +01:00
58324f0c86 Cycles: oneAPI: Make test kernel more representative
Test kernel will now test functionalities related to kernel execution
with USM memory allocations instead of with SYCL buffers and accessors
as these aren't currently used in the backend.
2022-10-14 11:22:11 +02:00
5d53e6b3c1 Deps: include libxkbcommon-devel for Linux build script, remove wayland
- Include libxkbcommon headers: needed for building Blender with Wayland.
- Remove Wayland libraries (now wayland is built locally).
- Split up packages into two lists, one for building libs,
  another for building Blender - since it's useful to be able to build
  Blender, testing the libs work as expected.
2022-10-14 19:12:11 +11:00
06081d48e3 Deps: add comments noting why packages are installed
Some don't seem to be needed anymore, noted these in comments too.
2022-10-14 18:59:12 +11:00
b2ab9977bf Deps: use the locally built wayland-scanner for wayland_protocols
This removes the dependency on wayland-devel, with some potential
for errors caused from using two different versions.

Note that the generated files are currently unchanged.
2022-10-14 18:59:11 +11:00
695614ad3b Fix T101805: Blender icons doesn't show in GNOME 43
Use an app_id that matches the naming for the `.desktop`
file distributed with Blender.

Follow up to T101779.
2022-10-14 16:53:41 +11:00
e4e80058c8 Cleanup: simplify calculation of NDOF pan/zoom in 2D views
Make the logic for converting NDOF Z-motion to a scale value more
straightforward. Flipping the Z axis was scaling by negative-time,
now the entire pan vector is scaled by time and the zoom value is
calculated as `scale = 1 - (z * time)` instead of `1 + (z * -time)`.
Although they're equivalent, confusion here caused T100953.

Also clamp the scale (while unlikely, negative scale wasn't prevented).
2022-10-14 16:32:59 +11:00
1fbd300adb Fix: Curves sculpt adding resets attribute values
Error in 9088a1f476.
2022-10-13 18:21:39 -05:00
e8eed82bd5 Cleanup: Small changes to curves draw cache
- Remove unused include
- Avoid repeating blender:: namespace
- Remove timer left in by mistake in previous commit
2022-10-13 17:40:30 -05:00
98aa7276c8 Curves: Multithread position vertex buffer extraction
On a Ryzen 3700x I observed a 4ms improvement (from 5ms to 1ms)
on every redraw when sculpting with 88000 curves.
2022-10-13 17:21:23 -05:00
1703a8fb33 Build: Add TBB define to BMesh module
Allows using BLI_task.hh to write multithreaded code.
2022-10-13 14:48:35 -05:00
6beeba1ef5 Nodes: Duplicate Linked operator + User Preference option for Node Tree
This operator (Alt + D) allows users to explicitly create a linked copy
of a group node (same current behaviour for the Duplicate operator).

The duplicate operator (Shift + D) now takes the new User Preference
duplicate data option for Node Tree into account. It is by default
disabled, leading to no functional change for users.

Although we could make in the future make this option "on" by default,
to make it consistent with the rest of Blender we do not at the time.

Differential Revision: https://developer.blender.org/D16210
2022-10-13 20:06:20 +02:00
a5d3b648e3 Outliner: Use row background color for elements count indicator
From T101799:

Currently, the count indicator background and color are hardcoded to
black and white in an attempt to maximize contrast, at the expense of
being too prominent even when not needed.

Changing the background color to match the row (or any other element)
background, would make it look like the data-block icon is masked
out, improving readability while not standing out too much.

The circle background color should not have transparency, as it does
now. And the text inside should match the color of the text used for the
parent element (instead of hardcoded white). This should make it look
good in any theme.

---

Before:
{F13674265, size=full}

After:
{F13674269, size=full}

Differential Revision: https://developer.blender.org/D16246
2022-10-13 20:05:28 +02:00
6f190c669f Fix: Attribute layers can be skipped in Mesh to BMesh conversion
In some situations, layers were filled with their default value
when converting from Mesh to BMesh (entering edit mode, for example).
This was caused by the recently added "copy mesh to bmesh" or "merge
mesh to bmesh" custom data functions creating a difference custom
data format than was used for the copying functions used later.

`CustomData_to_bmesh_block` is not robust enough to handle simple
differences in layout between the layout of the source and result
CustomData layers, because it relies on the order of the types and
the number of layers within each type.

As a fix, make the "mesh to bmesh" special case more explicit in
the conversion functions. This makes the difference in the API
smaller, which is a nice improvement anwyay.

Fixes T101796
2022-10-13 12:43:04 -05:00
Sebastian Herholz
b2627dff49 Build: Upgrading OpenPGL version to 0.4.0 2022-10-13 17:45:14 +02:00
afd30e5e3a Fix: Crash updating draw cache of original curves data
Error in c67e5628d2 which mistook clearing
the pointer for clearing the values in the struct.
2022-10-13 09:37:12 -05:00
d292d635ea install_deps: Add system libdecor dev package.
ref. T101403
2022-10-13 14:49:29 +02:00
1a9480cf25 Realtime Compositor: Keep interpolation in Scale node
Currently, the scale node always changes the interpolation of its result
to bilinear. This was done because the scale node does not have an
interpolation option, unlike the Transform node, so a default of
bilinear was assumed. This turned out to be problematic, because in the
pixelation use cases, a nearest interpolation is typically preferred by
the user.

This patch changes the default interpolation of input nodes to bilinear,
makes the scale node keep the interpolation of the input it receives,
and makes the pixelate node changes the interpolation to nearest. In
effect, for non-pixelation use cases, the default bilinear interpolation
will be used, and for pixelation use cases, the nearest interpolation
will be used unless explicitly specified using a node that sets the
interpolation.
2022-10-13 12:42:43 +02:00
cbe1c1474b 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.
2022-10-13 12:26:36 +02:00
f95071028c UI: Fix wrong error message when trying to apply modifier
The error message when trying to apply a constructive modifier on a curve
object was wrong, "transform" makes no sense in this context.

Thanks Philipp for pointing it out!
2022-10-13 12:24:03 +02:00
4767a8eb4a Cleanup: simplify uv packing api
Affects paint.add_simple_uvs

No user visible changes.

Differential Revision: https://developer.blender.org/D16231
2022-10-13 23:07:12 +13:00
0dd98c54b9 GPencil: Change Pie shortcut to Shift+Alt+A 2022-10-11 11:28:09 +02:00
910b579aff GPencil: New Automasking Pie menu (Ctrl+Alt+A) 2022-10-10 19:59:18 +02:00
f1dbbbbd45 GPencil: Speed up checking 2022-10-10 17:41:42 +02:00
101819bdf9 GPencil: Make automasking to use AND logic
Now, the automasking only allows to sculpt if all masking conditions are met.
2022-10-10 16:47:14 +02:00
62b29f71b9 Merge branch 'master' into temp-gpencil-automask 2022-10-10 16:13:26 +02:00
3d2dc8c897 Merge branch 'master' into temp-gpencil-automask 2022-10-09 11:11:40 +02:00
3ebd01675e Merge branch 'master' into temp-gpencil-automask 2022-10-08 09:58:20 +02:00
9b24e5d54f GPencil: Change Tooltips and Menu Text 2022-10-07 18:07:22 +02:00
535662cd0d GPencil: Hide Advanced panel if empty 2022-10-07 17:24:33 +02:00
dc6281d87f GPencil: Fix bug for automasking stroke layer and material
If both layers modes are selected, the check was wrong.
2022-10-07 17:07:31 +02:00
ad87f81e38 GPencil: Add new Automasking popover
Also removed from Brush settings the automasking
2022-10-07 16:59:30 +02:00
8965118eec Merge branch 'master' into temp-gpencil-automask 2022-10-07 16:21:49 +02:00
71e26f6eff GPencil: New Automasking modes and fix bug
* New Layer and Material of the stroke Masking.
* Fixed Automasking with modifiers.
2022-10-06 22:29:45 +02:00
1e286d7f8f GPencil: Keep old bit value 2022-10-06 18:46:13 +02:00
2ec1e38b91 GPencil: Move the automasking options to ToolSettings
Still pending move out Brush panel
2022-10-06 18:38:19 +02:00
1568 changed files with 31345 additions and 24527 deletions

View File

@@ -177,8 +177,11 @@ option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
option(WITH_PYTHON "Enable Embedded Python API (only disable for development)" ON)
option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default" ON)
mark_as_advanced(WITH_PYTHON) # don't want people disabling this unless they really know what they are doing.
mark_as_advanced(WITH_PYTHON_SECURITY) # some distributions see this as a security issue, rather than have them patch it, make a build option.
# Don't want people disabling this unless they really know what they are doing.
mark_as_advanced(WITH_PYTHON)
# Some distributions see this as a security issue, rather than have them patch it,
# make a build option.
mark_as_advanced(WITH_PYTHON_SECURITY)
option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some efficiency, only enable for development)." OFF)
mark_as_advanced(WITH_PYTHON_SAFETY)
@@ -336,11 +339,9 @@ if(APPLE)
else()
set(WITH_COREAUDIO OFF)
endif()
if(NOT WIN32)
if(UNIX AND NOT APPLE)
option(WITH_JACK "Enable JACK Support (http://www.jackaudio.org)" ON)
if(UNIX AND NOT APPLE)
option(WITH_JACK_DYNLOAD "Enable runtime dynamic JACK libraries loading" OFF)
endif()
option(WITH_JACK_DYNLOAD "Enable runtime dynamic JACK libraries loading" OFF)
else()
set(WITH_JACK OFF)
endif()
@@ -489,13 +490,12 @@ endif()
if(NOT APPLE)
option(WITH_CYCLES_DEVICE_ONEAPI "Enable Cycles oneAPI compute support" OFF)
option(WITH_CYCLES_ONEAPI_BINARIES "Enable Ahead-Of-Time compilation for Cycles oneAPI device" OFF)
option(WITH_CYCLES_ONEAPI_SYCL_HOST_ENABLED "Enable use of SYCL host (CPU) device execution by oneAPI implementation. This option is for debugging purposes and impacts GPU execution." OFF)
# https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compilation/ahead-of-time-compilation.html
set(CYCLES_ONEAPI_SPIR64_GEN_DEVICES "dg2" CACHE STRING "oneAPI Intel GPU architectures to build binaries for")
# acm-g10 is the target for the first Intel Arc Alchemist GPUs.
set(CYCLES_ONEAPI_SPIR64_GEN_DEVICES "acm-g10" CACHE STRING "oneAPI Intel GPU architectures to build binaries for")
set(CYCLES_ONEAPI_SYCL_TARGETS spir64 spir64_gen CACHE STRING "oneAPI targets to build AOT binaries for")
mark_as_advanced(WITH_CYCLES_ONEAPI_SYCL_HOST_ENABLED)
mark_as_advanced(CYCLES_ONEAPI_SPIR64_GEN_DEVICES)
mark_as_advanced(CYCLES_ONEAPI_SYCL_TARGETS)
endif()
@@ -553,6 +553,7 @@ endif()
option(WITH_GTESTS "Enable GTest unit testing" OFF)
option(WITH_OPENGL_RENDER_TESTS "Enable OpenGL render related unit testing (Experimental)" OFF)
option(WITH_OPENGL_DRAW_TESTS "Enable OpenGL UI drawing related unit testing (Experimental)" OFF)
# NOTE: All callers of this must add `TEST_PYTHON_EXE_EXTRA_ARGS` before any other arguments.
set(TEST_PYTHON_EXE "" CACHE PATH "Python executable to run unit tests")
mark_as_advanced(TEST_PYTHON_EXE)
@@ -572,6 +573,12 @@ mark_as_advanced(
WITH_GPU_BUILDTIME_SHADER_BUILDER
)
# Vulkan
option(WITH_VULKAN_BACKEND "Enable Vulkan as graphics backend (only for development)" OFF)
mark_as_advanced(
WITH_VULKAN_BACKEND
)
# Metal
if(APPLE)
@@ -780,6 +787,8 @@ endif()
# -----------------------------------------------------------------------------
# Check for Conflicting/Unsupported Configurations
option(WITH_STRICT_BUILD_OPTIONS "When requirements for a build option are not met, error instead of disabling the option" OFF)
if(NOT WITH_BLENDER AND NOT WITH_CYCLES_STANDALONE AND NOT WITH_CYCLES_HYDRA_RENDER_DELEGATE)
message(FATAL_ERROR
"At least one of WITH_BLENDER or WITH_CYCLES_STANDALONE "
@@ -895,10 +904,7 @@ endif()
if(WITH_BUILDINFO)
find_package(Git)
if(NOT GIT_FOUND)
message(WARNING "Git was not found, disabling WITH_BUILDINFO")
set(WITH_BUILDINFO OFF)
endif()
set_and_warn_library_found("Git" GIT_FOUND WITH_BUILDINFO)
endif()
if(WITH_AUDASPACE)
@@ -938,9 +944,10 @@ if(WITH_INTERNATIONAL)
WARNING
"Translation path '${CMAKE_SOURCE_DIR}/release/datafiles/locale' is missing, "
"This is a 'git submodule', which are known not to work with bridges to other version "
"control systems, disabling 'WITH_INTERNATIONAL'."
"control systems."
)
set(WITH_INTERNATIONAL OFF)
set(TRANSLATIONS_FOUND OFF)
set_and_warn_library_found("Translations" TRANSLATIONS_FOUND WITH_INTERNATIONAL)
endif()
endif()
@@ -1225,6 +1232,13 @@ if(WITH_OPENGL)
endif()
# -----------------------------------------------------------------------------
# Configure Vulkan.
if(WITH_VULKAN_BACKEND)
add_definitions(-DWITH_VULKAN_BACKEND)
endif()
# -----------------------------------------------------------------------------
# Configure Metal
@@ -1245,6 +1259,8 @@ if(WITH_OPENMP)
find_package(OpenMP)
endif()
set_and_warn_library_found("OpenMP" OPENMP_FOUND WITH_OPENMP)
if(OPENMP_FOUND)
if(NOT WITH_OPENMP_STATIC)
string(APPEND CMAKE_C_FLAGS " ${OpenMP_C_FLAGS}")
@@ -1260,9 +1276,6 @@ if(WITH_OPENMP)
find_library_static(OpenMP_LIBRARIES gomp ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES})
endif()
else()
message(STATUS "OpenMP not found, disabling WITH_OPENMP")
set(WITH_OPENMP OFF)
endif()
mark_as_advanced(
@@ -1277,10 +1290,7 @@ endif()
if(WITH_BULLET AND WITH_SYSTEM_BULLET)
find_package(Bullet)
if(NOT BULLET_FOUND)
message(STATUS "Bullet not found, disabling WITH_BULLET")
set(WITH_BULLET OFF)
endif()
set_and_warn_library_found("Bullet" BULLET_FOUND WITH_BULLET)
else()
set(BULLET_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/bullet2/src")
# set(BULLET_LIBRARIES "")

View File

@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later
####################################################################################################
##################################################################################################
#
# This is a build system used by platform maintainers to build library dependencies on
# Windows, macOS and Linux.
@@ -22,7 +22,7 @@
# Install compiler cmake autoconf automake libtool yasm tcl
# Run "make deps" from main Blender directory
#
####################################################################################################
##################################################################################################
project("BlenderDependencies")
cmake_minimum_required(VERSION 3.5)
@@ -30,7 +30,8 @@ cmake_minimum_required(VERSION 3.5)
include(ExternalProject)
include(cmake/check_software.cmake)
include(cmake/options.cmake)
# versions.cmake needs to be included after options.cmake due to the BLENDER_PLATFORM_ARM variable being needed.
# `versions.cmake` needs to be included after `options.cmake`
# due to the `BLENDER_PLATFORM_ARM` variable being needed.
include(cmake/versions.cmake)
include(cmake/boost_build_options.cmake)
include(cmake/download.cmake)
@@ -88,7 +89,7 @@ include(cmake/package_python.cmake)
include(cmake/usd.cmake)
include(cmake/potrace.cmake)
include(cmake/haru.cmake)
# Boost needs to be included after python.cmake due to the PYTHON_BINARY variable being needed.
# Boost needs to be included after `python.cmake` due to the PYTHON_BINARY variable being needed.
include(cmake/boost.cmake)
include(cmake/pugixml.cmake)
include(cmake/ispc.cmake)
@@ -97,6 +98,8 @@ include(cmake/embree.cmake)
include(cmake/openpgl.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)
@@ -149,7 +152,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)

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

@@ -27,10 +27,12 @@ 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(SBOMCONTENTS "${SBOMCONTENTS}${CPE_VENDOR},${CPE_NAME},${CPE_VERSION}\n")
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)

View File

@@ -1,2 +1,29 @@
vendor,product,version
vendor,product,version,cve_number,remarks,comment
@OPENJPEG_ID@,CVE-2016-9675,Ignored,issue in convert command line tool not used by blender
@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
@XML2_ID@,CVE-2016-3709,Ignored,not affecting blender and not considered a security issue upstream
@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
@SBOMCONTENTS@

View File

@@ -62,7 +62,7 @@ function(download_source dep)
# 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)
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}")
@@ -114,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

@@ -80,8 +80,11 @@ ExternalProject_Add(external_dpcpp
SOURCE_SUBDIR llvm
LIST_SEPARATOR ^^
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/dpcpp ${DEFAULT_CMAKE_FLAGS} ${DPCPP_EXTRA_ARGS}
#CONFIGURE_COMMAND ${PYTHON_BINARY} ${BUILD_DIR}/dpcpp/src/external_dpcpp/buildbot/configure.py ${DPCPP_CONFIGURE_ARGS}
#BUILD_COMMAND echo "." #${PYTHON_BINARY} ${BUILD_DIR}/dpcpp/src/external_dpcpp/buildbot/compile.py
# CONFIGURE_COMMAND
# ${PYTHON_BINARY}
# ${BUILD_DIR}/dpcpp/src/external_dpcpp/buildbot/configure.py ${DPCPP_CONFIGURE_ARGS}
# BUILD_COMMAND
# echo "." # ${PYTHON_BINARY} ${BUILD_DIR}/dpcpp/src/external_dpcpp/buildbot/compile.py
INSTALL_COMMAND ${CMAKE_COMMAND} --build . -- deploy-sycl-toolchain
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/dpcpp/src/external_dpcpp < ${PATCH_DIR}/dpcpp.diff
INSTALL_DIR ${LIBDIR}/dpcpp

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

@@ -27,6 +27,7 @@ ExternalProject_Add(external_gmp
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

@@ -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

@@ -4,11 +4,9 @@
# library itself does not depend on them, so should give no problems.
set(OPENPGL_EXTRA_ARGS
-DOPENPGL_BUILD_PYTHON=OFF
-DOPENPGL_BUILD_STATIC=ON
-DOPENPGL_TBB_ROOT=${LIBDIR}/tbb
-DTBB_ROOT=${LIBDIR}/tbb
-Dembree_DIR=${LIBDIR}/embree/lib/cmake/embree-${EMBREE_VERSION}
-DCMAKE_DEBUG_POSTFIX=_d
)
@@ -31,7 +29,6 @@ ExternalProject_Add(external_openpgl
add_dependencies(
external_openpgl
external_tbb
external_embree
)
if(WIN32)

View File

@@ -3,6 +3,7 @@
if(WIN32)
option(ENABLE_MINGW64 "Enable building of ffmpeg/iconv/libsndfile/fftw3 by installing mingw64" ON)
endif()
option(FORCE_CHECK_HASH "Force a check of all hashses during CMake the configure phase" OFF)
option(WITH_BOOST_PYTHON "Enable building of boost with python support" OFF)
cmake_host_system_information(RESULT NUM_CORES QUERY NUMBER_OF_LOGICAL_CORES)
set(MAKE_THREADS ${NUM_CORES} CACHE STRING "Number of threads to run make with")
@@ -20,8 +21,8 @@ else()
endif()
set(DOWNLOAD_DIR "${CMAKE_CURRENT_BINARY_DIR}/downloads" CACHE STRING "Path for downloaded files")
# This path must be hard-coded like this, so that the GNUmakefile knows where it is and can pass it to make_source_archive.py:
set(PACKAGE_DIR "${CMAKE_CURRENT_BINARY_DIR}/packages")
set(PACKAGE_DIR "${CMAKE_CURRENT_BINARY_DIR}/packages" CACHE PATH "default path for downloaded packages")
option(PACKAGE_USE_UPSTREAM_SOURCES "Use sources upstream to download the package sources, when OFF the blender mirror will be used" ON)
file(TO_CMAKE_PATH ${DOWNLOAD_DIR} DOWNLOAD_DIR)
@@ -101,34 +102,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 +119,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 +154,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
@@ -81,6 +83,7 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslcomp.lib ${HARVEST_TARGET}/osl/lib/oslcomp_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslexec.lib ${HARVEST_TARGET}/osl/lib/oslexec_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslquery.lib ${HARVEST_TARGET}/osl/lib/oslquery_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslnoise.lib ${HARVEST_TARGET}/osl/lib/oslnoise_d.lib
DEPENDEES install
)
endif()

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

@@ -1,10 +1,10 @@
# SPDX-License-Identifier: GPL-2.0-or-later
####################################################################################################################
##################################################################################################
# Mingw64 Builds
####################################################################################################################
##################################################################################################
# This installs mingw64+msys to compile ffmpeg/iconv/libsndfile/fftw3
####################################################################################################################
##################################################################################################
message("LIBDIR = ${LIBDIR}")
macro(cmake_to_msys_path MsysPath ResultingPath)

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

@@ -58,8 +58,9 @@ set(USD_EXTRA_ARGS
-DPXR_BUILD_USD_TOOLS=OFF
-DCMAKE_DEBUG_POSTFIX=_d
-DBUILD_SHARED_LIBS=Off
# USD is hellbound on making a shared lib, unless you point this variable to a valid cmake file
# doesn't have to make sense, but as long as it points somewhere valid it will skip the shared lib.
# USD is hellbound on making a shared library,
# unless you point this variable to a valid CMAKE file doesn't have to make sense,
# but as long as it points somewhere valid it will skip the shared library.
-DPXR_MONOLITHIC_IMPORT=${BUILD_DIR}/usd/src/external_usd/cmake/defaults/Version.cmake
-DTBB_INCLUDE_DIRS=${LIBDIR}/tbb/include
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
@@ -86,7 +87,8 @@ add_dependencies(
external_opensubdiv
)
# Since USD 21.11 the libraries are prefixed with "usd_", i.e. "libusd_m.a" became "libusd_usd_m.a".
# Since USD 21.11 the libraries are prefixed with "usd_", i.e.
# "libusd_m.a" became "libusd_usd_m.a".
# See https://github.com/PixarAnimationStudios/USD/blob/release/CHANGELOG.md#2111---2021-11-01
if(NOT WIN32)
if (USD_VERSION VERSION_LESS 21.11)

View File

@@ -8,9 +8,9 @@
# Not all of our dependencies are currently in the nvd database so not all
# dependencies have one assigned.
set(ZLIB_VERSION 1.2.12)
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}:*:*:*:*:*:*:*")
@@ -88,9 +88,9 @@ 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}:*:*:*:*:*:*:*")
@@ -159,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)
@@ -189,17 +189,17 @@ 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)
set(OSL_HASH 63265472ce14548839ace2e21e401544)
set(OSL_VERSION 1.12.6.2)
set(OSL_URI https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/archive/refs/tags/v${OSL_VERSION}.tar.gz)
set(OSL_HASH 6fef11548adfdd3e5b25c49d2dae96ee)
set(OSL_HASH_TYPE MD5)
set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz)
set(PYTHON_VERSION 3.10.2)
set(PYTHON_VERSION 3.10.8)
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 e92356b012ed4d0e09675131d39b1bde)
set(PYTHON_HASH_TYPE MD5)
set(PYTHON_FILE Python-${PYTHON_VERSION}.tar.xz)
set(PYTHON_CPE "cpe:2.3:a:python:python:${PYTHON_VERSION}:-:*:*:*:*:*:*")
@@ -225,8 +225,9 @@ 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)
# The version of the zstd library used to build the Python package should match ZSTD_VERSION defined below.
# At this time of writing, 0.17.0 was already released, but built against zstd 1.5.1, while we use 1.5.0.
# The version of the zstd library used to build the Python package should match ZSTD_VERSION
# defined below. At this time of writing, 0.17.0 was already released,
# but built against zstd 1.5.1, while we use 1.5.0.
set(ZSTANDARD_VERSION 0.16.0)
set(AUTOPEP8_VERSION 1.6.0)
set(PYCODESTYLE_VERSION 2.8.0)
@@ -298,17 +299,17 @@ 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_VERSION 2.5.0)
set(OPENJPEG_SHORT_VERSION 2.5)
set(OPENJPEG_URI https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz)
set(OPENJPEG_HASH 8702ba68b442657f11aaeb2b338443ca8d5fb95b0d845757968a7be31ef7f16d)
set(OPENJPEG_HASH 0333806d6adecc6f7a91243b2b839ff4d2053823634d4f6ed7a59bc87409122a)
set(OPENJPEG_HASH_TYPE SHA256)
set(OPENJPEG_FILE openjpeg-v${OPENJPEG_VERSION}.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}:*:*:*:*:*:*:*")
@@ -325,9 +326,9 @@ 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}:*:*:*:*:*:*:*")
@@ -351,21 +352,13 @@ 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(XML2_FILE libxml2-${XML2_VERSION}.tar.xz)
set(XML2_CPE "cpe:2.3:a:xmlsoft:libxml2:${XML2_VERSION}:*:*:*:*:*:*:*")
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(TINYXML_CPE "cpe:2.3:a:tinyxml_project:tinyxml:${TINYXML_VERSION_DOTS}:*:*:*:*:*:*:*")
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)
@@ -379,10 +372,10 @@ 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_DOTS 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}:*:*:*:*:*:*:*")
@@ -410,6 +403,10 @@ 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)
@@ -417,6 +414,9 @@ 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)
@@ -430,27 +430,25 @@ 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)
@@ -561,22 +559,22 @@ set(BROTLI_HASH_TYPE SHA256)
set(BROTLI_FILE brotli-v${BROTLI_VERSION}.tar.gz)
set(BROTLI_CPE "cpe:2.3:a:google:brotli:${BROTLI_VERSION}:*:*:*:*:*:*:*")
set(OPENPGL_VERSION v0.3.1-beta)
set(OPENPGL_SHORT_VERSION 0.3.1)
set(OPENPGL_VERSION v0.4.1-beta)
set(OPENPGL_SHORT_VERSION 0.4.1)
set(OPENPGL_URI https://github.com/OpenPathGuidingLibrary/openpgl/archive/refs/tags/${OPENPGL_VERSION}.tar.gz)
set(OPENPGL_HASH 3830098c485c962018932766199527aab453a8029528dbbc04d4454d82431e2c)
set(OPENPGL_HASH db63f5dac5cfa8c110ede241f0c413f00db0c4748697381c4fa23e0f9e82a754)
set(OPENPGL_HASH_TYPE SHA256)
set(OPENPGL_FILE openpgl-${OPENPGL_VERSION}.tar.gz)
set(LEVEL_ZERO_VERSION v1.7.15)
set(LEVEL_ZERO_VERSION v1.8.5)
set(LEVEL_ZERO_URI https://github.com/oneapi-src/level-zero/archive/refs/tags/${LEVEL_ZERO_VERSION}.tar.gz)
set(LEVEL_ZERO_HASH c39bb05a8e5898aa6c444e1704105b93d3f1888b9c333f8e7e73825ffbfb2617)
set(LEVEL_ZERO_HASH b6e9663bbcc53c148d32376998298bec6f7c434ef2218c61fa708963e3a09394)
set(LEVEL_ZERO_HASH_TYPE SHA256)
set(LEVEL_ZERO_FILE level-zero-${LEVEL_ZERO_VERSION}.tar.gz)
set(DPCPP_VERSION 20220812)
set(DPCPP_VERSION 20221019)
set(DPCPP_URI https://github.com/intel/llvm/archive/refs/tags/sycl-nightly/${DPCPP_VERSION}.tar.gz)
set(DPCPP_HASH 0e3c95346c295f5cf80f3a42d80b1c49481955898530242636ddc002627248d6)
set(DPCPP_HASH 2f533946e91ce3829431758ea17b0b834b960c1a796e9e4563c86e03eb9603a2)
set(DPCPP_HASH_TYPE SHA256)
set(DPCPP_FILE DPCPP-${DPCPP_VERSION}.tar.gz)
@@ -589,9 +587,9 @@ set(DPCPP_FILE DPCPP-${DPCPP_VERSION}.tar.gz)
# will take care of building them, unpack is being done in dpcpp_deps.cmake
# Source llvm/lib/SYCLLowerIR/CMakeLists.txt
set(VCINTRINSICS_VERSION 984bb27baacce6ee5c716c2e64845f2a1928025b)
set(VCINTRINSICS_VERSION abce9184b7a3a7fe1b02289b9285610d9dc45465)
set(VCINTRINSICS_URI https://github.com/intel/vc-intrinsics/archive/${VCINTRINSICS_VERSION}.tar.gz)
set(VCINTRINSICS_HASH abea415a15a0dd11fdc94dee8fb462910f2548311b787e02f42509789e1b0d7b)
set(VCINTRINSICS_HASH 3e9fd471246b87633b26f7e15e17ab7733d357458c53d5c5881c03929d6c551f)
set(VCINTRINSICS_HASH_TYPE SHA256)
set(VCINTRINSICS_FILE vc-intrinsics-${VCINTRINSICS_VERSION}.tar.gz)
@@ -603,9 +601,9 @@ set(OPENCLHEADERS_HASH_TYPE SHA256)
set(OPENCLHEADERS_FILE opencl_headers-${OPENCLHEADERS_VERSION}.tar.gz)
# Source opencl/CMakeLists.txt
set(ICDLOADER_VERSION aec3952654832211636fc4af613710f80e203b0a)
set(ICDLOADER_VERSION 792682ad3d877ab38573b997808bab3b43902b70)
set(ICDLOADER_URI https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/${ICDLOADER_VERSION}.tar.gz)
set(ICDLOADER_HASH e1880551d67bd8dc31d13de63b94bbfd6b1f315b6145dad1ffcd159b89bda93c)
set(ICDLOADER_HASH b33a0320d94bf300efa1da97931ded506d27813bd1148da6858fe79d412d1ea2)
set(ICDLOADER_HASH_TYPE SHA256)
set(ICDLOADER_FILE icdloader-${ICDLOADER_VERSION}.tar.gz)
@@ -620,9 +618,9 @@ set(MP11_FILE mp11-${MP11_VERSION}.tar.gz)
# Source llvm-spirv/CMakeLists.txt (repo)
# Source llvm-spirv/spirv-headers-tag.conf (hash)
set(SPIRV_HEADERS_VERSION 36c0c1596225e728bd49abb7ef56a3953e7ed468)
set(SPIRV_HEADERS_VERSION 5a121866927a16ab9d49bed4788b532c7fcea766)
set(SPIRV_HEADERS_URI https://github.com/KhronosGroup/SPIRV-Headers/archive/${SPIRV_HEADERS_VERSION}.tar.gz)
set(SPIRV_HEADERS_HASH 7a5c89633f8740456fe8adee052033e134476d267411d1336c0cb1e587a9229a)
set(SPIRV_HEADERS_HASH ec8ecb471a62672697846c436501638ab25447ae9d4a6761e0bfe8a9a839502a)
set(SPIRV_HEADERS_HASH_TYPE SHA256)
set(SPIRV_HEADERS_FILE SPIR-V-Headers-${SPIRV_HEADERS_VERSION}.tar.gz)
@@ -637,9 +635,9 @@ set(SPIRV_HEADERS_FILE SPIR-V-Headers-${SPIRV_HEADERS_VERSION}.tar.gz)
# compiler, the versions used are taken from the following location
# https://github.com/intel/intel-graphics-compiler/releases
set(IGC_VERSION 1.0.11222)
set(IGC_VERSION 1.0.12149.1)
set(IGC_URI https://github.com/intel/intel-graphics-compiler/archive/refs/tags/igc-${IGC_VERSION}.tar.gz)
set(IGC_HASH d92f0608dcbb52690855685f9447282e5c09c0ba98ae35fabf114fcf8b1e9fcf)
set(IGC_HASH 44f67f24e3bc5130f9f062533abf8154782a9d0a992bc19b498639a8521ae836)
set(IGC_HASH_TYPE SHA256)
set(IGC_FILE igc-${IGC_VERSION}.tar.gz)
@@ -659,15 +657,15 @@ set(IGC_LLVM_FILE ${IGC_LLVM_VERSION}.tar.gz)
#
# WARNING WARNING WARNING
set(IGC_OPENCL_CLANG_VERSION bbdd1587f577397a105c900be114b56755d1f7dc)
set(IGC_OPENCL_CLANG_VERSION 363a5262d8c7cff3fb28f3bdb5d85c8d7e91c1bb)
set(IGC_OPENCL_CLANG_URI https://github.com/intel/opencl-clang/archive/${IGC_OPENCL_CLANG_VERSION}.tar.gz)
set(IGC_OPENCL_CLANG_HASH d08315f1b0d8a6fef33de2b3e6aa7356534c324910634962c72523d970773efc)
set(IGC_OPENCL_CLANG_HASH aa8cf72bb239722ce8ce44f79413c6887ecc8ca18477dd520aa5c4809756da9a)
set(IGC_OPENCL_CLANG_HASH_TYPE SHA256)
set(IGC_OPENCL_CLANG_FILE opencl-clang-${IGC_OPENCL_CLANG_VERSION}.tar.gz)
set(IGC_VCINTRINSICS_VERSION v0.4.0)
set(IGC_VCINTRINSICS_VERSION v0.5.0)
set(IGC_VCINTRINSICS_URI https://github.com/intel/vc-intrinsics/archive/refs/tags/${IGC_VCINTRINSICS_VERSION}.tar.gz)
set(IGC_VCINTRINSICS_HASH c8b92682ad5031cf9d5b82a40e7d5c0e763cd9278660adbcaa69aab988e4b589)
set(IGC_VCINTRINSICS_HASH 70bb47c5e32173cf61514941e83ae7c7eb4485e6d2fca60cfa1f50d4f42c41f2)
set(IGC_VCINTRINSICS_HASH_TYPE SHA256)
set(IGC_VCINTRINSICS_FILE vc-intrinsics-${IGC_VCINTRINSICS_VERSION}.tar.gz)
@@ -683,9 +681,9 @@ set(IGC_SPIRV_TOOLS_HASH 6e19900e948944243024aedd0a201baf3854b377b9cc7a386553bc1
set(IGC_SPIRV_TOOLS_HASH_TYPE SHA256)
set(IGC_SPIRV_TOOLS_FILE SPIR-V-Tools-${IGC_SPIRV_TOOLS_VERSION}.tar.gz)
set(IGC_SPIRV_TRANSLATOR_VERSION 99420daab98998a7e36858befac9c5ed109d4920)
set(IGC_SPIRV_TRANSLATOR_VERSION a31ffaeef77e23d500b3ea3d35e0c42ff5648ad9)
set(IGC_SPIRV_TRANSLATOR_URI https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/${IGC_SPIRV_TRANSLATOR_VERSION}.tar.gz)
set(IGC_SPIRV_TRANSLATOR_HASH 77dfb4ddb6bfb993535562c02ddea23f0a0d1c5a0258c1afe7e27c894ff783a8)
set(IGC_SPIRV_TRANSLATOR_HASH 9e26c96a45341b8f8af521bacea20e752623346340addd02af95d669f6e89252)
set(IGC_SPIRV_TRANSLATOR_HASH_TYPE SHA256)
set(IGC_SPIRV_TRANSLATOR_FILE SPIR-V-Translator-${IGC_SPIRV_TRANSLATOR_VERSION}.tar.gz)
@@ -693,15 +691,15 @@ set(IGC_SPIRV_TRANSLATOR_FILE SPIR-V-Translator-${IGC_SPIRV_TRANSLATOR_VERSION}.
### Intel Graphics Compiler DEPS END ###
########################################
set(GMMLIB_VERSION intel-gmmlib-22.1.2)
set(GMMLIB_VERSION intel-gmmlib-22.1.8)
set(GMMLIB_URI https://github.com/intel/gmmlib/archive/refs/tags/${GMMLIB_VERSION}.tar.gz)
set(GMMLIB_HASH 3b9a6d5e7e3f5748b3d0a2fb0e980ae943907fece0980bd9c0508e71c838e334)
set(GMMLIB_HASH bf23e9a3742b4fb98c7666c9e9b29f3219e4b2fb4d831aaf4eed71f5e2d17368)
set(GMMLIB_HASH_TYPE SHA256)
set(GMMLIB_FILE ${GMMLIB_VERSION}.tar.gz)
set(OCLOC_VERSION 22.20.23198)
set(OCLOC_VERSION 22.38.24278)
set(OCLOC_URI https://github.com/intel/compute-runtime/archive/refs/tags/${OCLOC_VERSION}.tar.gz)
set(OCLOC_HASH ab22b8bf2560a57fdd3def0e35a62ca75991406f959c0263abb00cd6cd9ae998)
set(OCLOC_HASH db0c542fccd651e6404b15a74d46027f1ce0eda8dc9e25a40cbb6c0faef257ee)
set(OCLOC_HASH_TYPE SHA256)
set(OCLOC_FILE ocloc-${OCLOC_VERSION}.tar.gz)

View File

@@ -7,10 +7,14 @@ ExternalProject_Add(external_wayland
PREFIX ${BUILD_DIR}/wayland
PATCH_COMMAND ${PATCH_CMD} -d ${BUILD_DIR}/wayland/src/external_wayland < ${PATCH_DIR}/wayland.diff
# Use `-E` so the `PKG_CONFIG_PATH` can be defined to link against our own LIBEXPAT & LIBXML2.
# Note that passing link args "ffi/lib" should not be needed, but
#
# NOTE: passing link args "ffi/lib" should not be needed, but
# `pkgconfig` would incorrectly look in "ffi/lib/../lib64" otherwise.
#
# NOTE: `-lm` is needed for `libxml2` which is a static library that uses `libm.so`,
# without this, math symbols such as `floor` aren't found.
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env PKG_CONFIG_PATH=${LIBDIR}/expat/lib/pkgconfig:${LIBDIR}/xml2/lib/pkgconfig:${LIBDIR}/ffi/lib/pkgconfig:$PKG_CONFIG_PATH
meson --prefix ${LIBDIR}/wayland -Ddocumentation=false -Dtests=false -Dc_link_args=-L${LIBDIR}/ffi/lib . ../external_wayland
meson --prefix ${LIBDIR}/wayland -Ddocumentation=false -Dtests=false -D "c_link_args=-L${LIBDIR}/ffi/lib -lm" . ../external_wayland
BUILD_COMMAND ninja
INSTALL_COMMAND ninja install
)

View File

@@ -5,7 +5,14 @@ ExternalProject_Add(external_wayland_protocols
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${WL_PROTOCOLS_HASH_TYPE}=${WL_PROTOCOLS_HASH}
PREFIX ${BUILD_DIR}/wayland-protocols
CONFIGURE_COMMAND meson --prefix ${LIBDIR}/wayland-protocols . ../external_wayland_protocols -Dtests=false
# Use `-E` so the `PKG_CONFIG_PATH` can be defined to link against our own WAYLAND.
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env PKG_CONFIG_PATH=${LIBDIR}/wayland/lib64/pkgconfig:$PKG_CONFIG_PATH
meson --prefix ${LIBDIR}/wayland-protocols . ../external_wayland_protocols -Dtests=false
BUILD_COMMAND ninja
INSTALL_COMMAND ninja install
)
add_dependencies(
external_wayland_protocols
external_wayland
)

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

@@ -394,7 +394,7 @@ CLANG_FORMAT_VERSION="10.0"
CLANG_FORMAT_VERSION_MIN="6.0"
CLANG_FORMAT_VERSION_MEX="14.0"
PYTHON_VERSION="3.10.2"
PYTHON_VERSION="3.10.8"
PYTHON_VERSION_SHORT="3.10"
PYTHON_VERSION_MIN="3.10"
PYTHON_VERSION_MEX="3.12"
@@ -505,7 +505,7 @@ OPENEXR_FORCE_REBUILD=false
OPENEXR_SKIP=false
_with_built_openexr=false
OIIO_VERSION="2.3.13.0"
OIIO_VERSION="2.3.20.0"
OIIO_VERSION_SHORT="2.3"
OIIO_VERSION_MIN="2.1.12"
OIIO_VERSION_MEX="2.4.0"
@@ -523,8 +523,8 @@ LLVM_FORCE_REBUILD=false
LLVM_SKIP=false
# OSL needs to be compiled for now!
OSL_VERSION="1.11.17.0"
OSL_VERSION_SHORT="1.11"
OSL_VERSION="1.12.6.2"
OSL_VERSION_SHORT="1.12"
OSL_VERSION_MIN="1.11"
OSL_VERSION_MEX="2.0"
OSL_FORCE_BUILD=false
@@ -602,10 +602,10 @@ LEVEL_ZERO_FORCE_BUILD=false
LEVEL_ZERO_FORCE_REBUILD=false
LEVEL_ZERO_SKIP=false
OPENPGL_VERSION="0.3.1"
OPENPGL_VERSION_SHORT="0.3"
OPENPGL_VERSION="0.4.0"
OPENPGL_VERSION_SHORT="0.4"
OPENPGL_VERSION_MIN="0.3.1"
OPENPGL_VERSION_MEX="0.3.2"
OPENPGL_VERSION_MEX="0.5"
OPENPGL_FORCE_BUILD=false
OPENPGL_FORCE_REBUILD=false
OPENPGL_SKIP=false
@@ -618,8 +618,8 @@ XR_OPENXR_FORCE_BUILD=false
XR_OPENXR_FORCE_REBUILD=false
XR_OPENXR_SKIP=false
FFMPEG_VERSION="5.0"
FFMPEG_VERSION_SHORT="5.0"
FFMPEG_VERSION="5.1.2"
FFMPEG_VERSION_SHORT="5.1"
FFMPEG_VERSION_MIN="4.0"
FFMPEG_VERSION_MEX="6.0"
FFMPEG_FORCE_BUILD=false
@@ -1139,7 +1139,7 @@ LLVM_SOURCE=( "$_LLVM_SOURCE_ROOT/llvm-$LLVM_VERSION.src.tar.xz" )
LLVM_CLANG_SOURCE=( "$_LLVM_SOURCE_ROOT/clang-$LLVM_VERSION.src.tar.xz" "$_LLVM_SOURCE_ROOT/cfe-$LLVM_VERSION.src.tar.xz" )
OSL_USE_REPO=false
OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage/archive/Release-$OSL_VERSION.tar.gz" )
OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage/archive/v$OSL_VERSION.tar.gz" )
#~ OSL_SOURCE_REPO=( "https://github.com/imageworks/OpenShadingLanguage.git" )
#~ OSL_SOURCE_REPO_BRANCH="master"
#~ OSL_SOURCE_REPO_UID="85179714e1bc69cd25ecb6bb711c1a156685d395"
@@ -1222,7 +1222,7 @@ Those libraries should be available as packages in all recent distributions (opt
* Basics of dev environment (cmake, gcc, svn , git, ...).
* libjpeg, libpng, libtiff, [openjpeg2], [libopenal].
* libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
* libwayland-client0, libwayland-cursor0, libwayland-egl1, libxkbcommon0, libdbus-1-3, libegl1 (Wayland)
* libwayland-client0, libdecor, libwayland-cursor0, libwayland-egl1, libxkbcommon0, libdbus-1-3, libegl1 (Wayland)
* libsqlite3, libzstd, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp, flex.
* libsdl2, libepoxy, libpugixml, libpotrace, [libgmp], fontconfig, [libharu/libhpdf].\""
@@ -4205,7 +4205,7 @@ install_DEB() {
_packages="gawk cmake cmake-curses-gui build-essential libjpeg-dev libpng-dev libtiff-dev \
git libfreetype6-dev libfontconfig-dev libx11-dev flex bison libxxf86vm-dev \
libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \
libwayland-dev wayland-protocols libegl-dev libxkbcommon-dev libdbus-1-dev linux-libc-dev \
libwayland-dev libdecor-0-dev wayland-protocols libegl-dev libxkbcommon-dev libdbus-1-dev linux-libc-dev \
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \
libopenal-dev libepoxy-dev yasm \
libsdl2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev \
@@ -4928,7 +4928,7 @@ install_RPM() {
_packages="gcc gcc-c++ git make cmake tar bzip2 xz findutils flex bison fontconfig-devel \
libtiff-devel libjpeg-devel libpng-devel sqlite-devel fftw-devel SDL2-devel \
libX11-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel \
wayland-devel wayland-protocols-devel mesa-libEGL-devel libxkbcommon-devel dbus-devel kernel-headers \
wayland-devel libdecor-devel wayland-protocols-devel mesa-libEGL-devel libxkbcommon-devel dbus-devel kernel-headers \
wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \
libepoxy-devel yasm patch \
libxml2-devel yaml-cpp-devel tinyxml-devel jemalloc-devel \
@@ -5582,7 +5582,7 @@ install_ARCH() {
fi
_packages="$BASE_DEVEL git cmake fontconfig flex \
libxi libxcursor libxrandr libxinerama libepoxy libpng libtiff wget openal \
libxi libxcursor libxrandr libxinerama libepoxy libdecor libpng libtiff wget openal \
$OPENJPEG_DEV yasm sdl2 fftw \
libxml2 yaml-cpp tinyxml python-requests jemalloc gmp potrace pugixml libharu \
zstd pystring"

View File

@@ -26,50 +26,79 @@ yum -y install centos-release-scl
yum -y install devtoolset-9
# Install packages needed for Blender's dependencies.
PACKAGES=(
PACKAGES_FOR_LIBS=(
# Used to checkout Blender's code.
git
# Used to checkout Blender's `../lib/` directory.
subversion
# Used to extract packages.
bzip2
# Used to extract packages.
tar
# Blender and some dependencies use `cmake`.
cmake3
# Apply patches from Blender's: `./build_files/build_environment/patches`
patch
# Use by `cmake` and `autoconf`.
make
# Required by: `external_nasm` which uses an `autoconf` build-system.
autoconf
automake
libtool
# Meta-build system used by various packages.
meson
# Builds generated by meson use Ninja for the actual build.
ninja-build
# Required by Blender build option: `WITH_GHOST_X11`.
libXrandr-devel
libXinerama-devel
libXcursor-devel
libXi-devel
libX11-devel libXt-devel
libX11-devel
libXt-devel
# Required by Blender build option: `WITH_GHOST_WAYLAND`.
mesa-libEGL-devel
# Required by: Blender & `external_opensubdiv` (probably others).
mesa-libGL-devel
mesa-libGLU-devel
# Required by: `external_ispc`.
zlib-devel
# TODO: dependencies build without this, consider removal.
rubygem-asciidoctor
# TODO: dependencies build without this, consider removal.
wget
# Required by: `external_sqlite` as a build-time dependency (needed for the `tclsh` command).
tcl
# Required by: `external_aom`.
# TODO: Blender is already building `external_nasm` which is listed as an alternative to `yasm`.
# Why are both needed?
yasm
# Required by: `meson` (Python based build system).
python36
# Required by: `mako` (Python module used for building `external_mesa`)
python-setuptools
# Required by: `external_igc` & `external_osl` as a build-time dependency.
bison
# Required by: `external_osl` as a build-time dependency.
flex
# TODO: dependencies build without this, consider removal.
ncurses-devel
wayland-devel
libwayland-client
libwayland-server
)
yum -y install -y ${PACKAGES[@]}
# Additional packages needed for building Blender.
PACKAGES_FOR_BLENDER=(
# Required by Blender build option: `WITH_GHOST_WAYLAND`.
libxkbcommon-devel
)
yum -y install -y ${PACKAGES_FOR_LIBS[@]} ${PACKAGES_FOR_BLENDER[@]}
# Dependencies for Mesa
yum -y install expat-devel

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

@@ -177,7 +177,8 @@ if(ILMBASE_INCLUDE_DIR)
"\\1" XYZ ${ILMBASE_BUILD_SPECIFICATION})
set("ILMBASE_VERSION" ${XYZ} CACHE STRING "Version of ILMBase lib")
else()
# Old versions (before 2.0?) do not have any version string, just assuming 2.0 should be fine though.
# Old versions (before 2.0?) do not have any version string,
# just assuming 2.0 should be fine though.
message(WARNING "Could not determine ILMBase library version, assuming 2.0.")
set("ILMBASE_VERSION" "2.0" CACHE STRING "Version of ILMBase lib")
endif()
@@ -195,8 +196,13 @@ else()
# elseif(${ILMBASE_VERSION} VERSION_LESS "2.1")
set(IlmBase_Libraries Half Iex Imath IlmThread)
# else()
# string(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _ilmbase_libs_ver ${ILMBASE_VERSION})
# set(IlmBase_Libraries Half Iex-${_ilmbase_libs_ver} Imath-${_ilmbase_libs_ver} IlmThread-${_ilmbase_libs_ver})
# string(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _ilmbase_libs_ver ${ILMBASE_VERSION})
# set(IlmBase_Libraries
# Half
# Iex-${_ilmbase_libs_ver}
# Imath-${_ilmbase_libs_ver}
# IlmThread-${_ilmbase_libs_ver}
# )
endif()

View File

@@ -175,7 +175,8 @@ if(OPENEXR_INCLUDE_DIR)
"\\1" XYZ ${OPENEXR_BUILD_SPECIFICATION})
set("OPENEXR_VERSION" ${XYZ} CACHE STRING "Version of OpenEXR lib")
else()
# Old versions (before 2.0?) do not have any version string, just assuming 2.0 should be fine though.
# Old versions (before 2.0?) do not have any version string,
# just assuming 2.0 should be fine though.
message(WARNING "Could not determine ILMBase library version, assuming 2.0.")
set("OPENEXR_VERSION" "2.0" CACHE STRING "Version of OpenEXR lib")
endif()

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

@@ -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,18 @@ 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 @@
};
@@ -455,7 +457,7 @@
llvm::BasicBlock* masked_return_block() const;
bool is_masking_required() const { return m_is_masking_required; }
-
+void LLVM_Util::Cleanup ()
+{
+ if(jitmm_hold) jitmm_hold->clear();
+}
+ static void Cleanup ();
struct ScopedMasking {
ScopedMasking() {}
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
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 +62,50 @@ 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
@@ -116,8 +116,6 @@
return { A.data(), size_t(A.size()) };
}
-
-
namespace pvt {
typedef llvm::SectionMemoryManager LLVMMemoryManager;
@@ -182,6 +180,13 @@
++jit_mem_hold_users;
}
+void
+LLVM_Util::Cleanup()
+{
+ if (jitmm_hold)
+ jitmm_hold->clear();
+}
+
LLVM_Util::ScopedJitMemoryUser::~ScopedJitMemoryUser()
{
diff --git a/src/include/OSL/mask.h b/src/include/OSL/mask.h
index 24197af..b9275f6 100644
--- a/src/include/OSL/mask.h
+++ b/src/include/OSL/mask.h
@@ -4,7 +4,6 @@
#pragma once
-#include <immintrin.h>
#include <type_traits>
#include <OSL/oslconfig.h>
@@ -23,6 +22,8 @@ using std::countr_zero;
#elif OSL_INTEL_CLASSIC_COMPILER_VERSION
+#include <immintrin.h>
+
OSL_FORCEINLINE int popcount(uint32_t x) noexcept { return _mm_popcnt_u32(x);}
OSL_FORCEINLINE int popcount(uint64_t x) noexcept { return _mm_popcnt_u64(x); }
OSL_FORCEINLINE int countr_zero(uint32_t x) noexcept { return _bit_scan_forward(x); }

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

@@ -20,6 +20,7 @@ IF(NOT OSL_ROOT_DIR AND NOT $ENV{OSL_ROOT_DIR} STREQUAL "")
ENDIF()
SET(_osl_FIND_COMPONENTS
oslnoise
oslcomp
oslexec
oslquery
@@ -39,7 +40,6 @@ FIND_PATH(OSL_INCLUDE_DIR
include
)
SET(_osl_LIBRARIES)
FOREACH(COMPONENT ${_osl_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
@@ -51,9 +51,20 @@ FOREACH(COMPONENT ${_osl_FIND_COMPONENTS})
PATH_SUFFIXES
lib64 lib
)
LIST(APPEND _osl_LIBRARIES "${OSL_${UPPERCOMPONENT}_LIBRARY}")
ENDFOREACH()
# Note linking order matters, and oslnoise existence depends on version.
SET(_osl_LIBRARIES ${OSL_OSLCOMP_LIBRARY})
IF(APPLE)
list(APPEND _osl_LIBRARIES -force_load ${OSL_OSLEXEC_LIBRARY})
ELSE()
list(APPEND _osl_LIBRARIES ${OSL_OSLEXEC_LIBRARY})
ENDIF()
list(APPEND _osl_LIBRARIES ${OSL_OSLQUERY_LIBRARY})
IF(OSL_OSLNOISE_LIBRARY)
list(APPEND _osl_LIBRARIES ${OSL_OSLNOISE_LIBRARY})
ENDIF()
FIND_PROGRAM(OSL_COMPILER oslc
HINTS ${_osl_SEARCH_DIRS}
PATH_SUFFIXES bin)

View File

@@ -26,7 +26,8 @@ IF(NOT OPENEXR_ROOT_DIR AND NOT $ENV{OPENEXR_ROOT_DIR} STREQUAL "")
SET(OPENEXR_ROOT_DIR $ENV{OPENEXR_ROOT_DIR})
ENDIF()
# Old versions (before 2.0?) do not have any version string, just assuming this should be fine though.
# Old versions (before 2.0?) do not have any version string,
# just assuming this should be fine though.
SET(_openexr_libs_ver_init "2.0")
SET(_openexr_SEARCH_DIRS

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

@@ -30,6 +30,7 @@ SET(_sycl_search_dirs
# dpcpp binary.
FIND_PROGRAM(SYCL_COMPILER
NAMES
icpx
dpcpp
clang++
HINTS
@@ -45,6 +46,7 @@ FIND_PROGRAM(SYCL_COMPILER
if(NOT SYCL_COMPILER)
FIND_PROGRAM(SYCL_COMPILER
NAMES
icpx
dpcpp
HINTS
${_sycl_search_dirs}
@@ -55,6 +57,8 @@ endif()
FIND_LIBRARY(SYCL_LIBRARY
NAMES
sycl7
sycl6
sycl
HINTS
${_sycl_search_dirs}
@@ -63,34 +67,51 @@ FIND_LIBRARY(SYCL_LIBRARY
)
if(WIN32)
string(REPLACE ".lib" "d.lib" SYCL_LIBRARY_DEBUG ${SYCL_LIBRARY})
set(SYCL_LIBRARY_DEBUG ${SYCL_LIBRARY_DEBUG} CACHE FILEPATH "Path to SYCL debug library")
else()
set(SYCL_LIBRARY_DEBUG ${SYCL_LIBRARY} CACHE FILEPATH "Path to SYCL debug library")
FIND_LIBRARY(SYCL_LIBRARY_DEBUG
NAMES
sycl7d
sycl6d
sycld
HINTS
${_sycl_search_dirs}
PATH_SUFFIXES
lib64 lib
)
endif()
FIND_PATH(SYCL_INCLUDE_DIR
NAMES
CL/sycl.hpp
sycl/sycl.hpp
HINTS
${_sycl_search_dirs}
PATH_SUFFIXES
include
include/sycl
)
IF(EXISTS "${SYCL_INCLUDE_DIR}/sycl/version.hpp")
FILE(STRINGS "${SYCL_INCLUDE_DIR}/sycl/version.hpp" _libsycl_major_version REGEX "^#define __LIBSYCL_MAJOR_VERSION[ \t].*$")
STRING(REGEX MATCHALL "[0-9]+" _libsycl_major_version ${_libsycl_major_version})
FILE(STRINGS "${SYCL_INCLUDE_DIR}/sycl/version.hpp" _libsycl_minor_version REGEX "^#define __LIBSYCL_MINOR_VERSION[ \t].*$")
STRING(REGEX MATCHALL "[0-9]+" _libsycl_minor_version ${_libsycl_minor_version})
FILE(STRINGS "${SYCL_INCLUDE_DIR}/sycl/version.hpp" _libsycl_patch_version REGEX "^#define __LIBSYCL_PATCH_VERSION[ \t].*$")
STRING(REGEX MATCHALL "[0-9]+" _libsycl_patch_version ${_libsycl_patch_version})
SET(SYCL_VERSION "${_libsycl_major_version}.${_libsycl_minor_version}.${_libsycl_patch_version}")
ENDIF()
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SYCL DEFAULT_MSG SYCL_LIBRARY SYCL_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SYCL
REQUIRED_VARS SYCL_LIBRARY SYCL_INCLUDE_DIR
VERSION_VAR SYCL_VERSION
)
IF(SYCL_FOUND)
get_filename_component(_SYCL_INCLUDE_PARENT_DIR ${SYCL_INCLUDE_DIR} DIRECTORY)
SET(SYCL_INCLUDE_DIR ${SYCL_INCLUDE_DIR} ${_SYCL_INCLUDE_PARENT_DIR})
SET(SYCL_INCLUDE_DIR ${SYCL_INCLUDE_DIR} ${SYCL_INCLUDE_DIR}/sycl)
ELSE()
SET(SYCL_SYCL_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
_SYCL_INCLUDE_PARENT_DIR
SYCL_LIBRARY_DEBUG
)

View File

@@ -32,7 +32,8 @@ FIND_PATH(USD_INCLUDE_DIR
DOC "Universal Scene Description (USD) header files"
)
# Since USD 21.11 the libraries are prefixed with "usd_", i.e. "libusd_m.a" became "libusd_usd_m.a".
# Since USD 21.11 the libraries are prefixed with "usd_", i.e.
# "libusd_m.a" became "libusd_usd_m.a".
# See https://github.com/PixarAnimationStudios/USD/blob/release/CHANGELOG.md#2111---2021-11-01
FIND_LIBRARY(USD_LIBRARY
NAMES

View File

@@ -8,7 +8,11 @@
set(WITH_ASSERT_ABORT ON CACHE BOOL "" FORCE)
set(WITH_BUILDINFO OFF CACHE BOOL "" FORCE)
set(WITH_COMPILER_ASAN ON CACHE BOOL "" FORCE)
# Sadly ASAN is more often broken than working with MSVC do not enable it in the
# developer profile for now.
if(NOT WIN32)
set(WITH_COMPILER_ASAN ON CACHE BOOL "" FORCE)
endif()
set(WITH_CYCLES_NATIVE_ONLY ON CACHE BOOL "" FORCE)
set(WITH_DOC_MANPAGE OFF CACHE BOOL "" FORCE)
set(WITH_GTESTS ON CACHE BOOL "" FORCE)

View File

@@ -66,13 +66,11 @@ set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
if(APPLE)
set(WITH_COREAUDIO ON CACHE BOOL "" FORCE)
endif()
if(NOT WIN32)
set(WITH_JACK ON CACHE BOOL "" FORCE)
endif()
if(WIN32)
set(WITH_WASAPI ON CACHE BOOL "" FORCE)
endif()
if(UNIX AND NOT APPLE)
set(WITH_JACK ON CACHE BOOL "" FORCE)
set(WITH_DOC_MANPAGE ON CACHE BOOL "" FORCE)
set(WITH_GHOST_XDND ON CACHE BOOL "" FORCE)
set(WITH_PULSEAUDIO ON CACHE BOOL "" FORCE)

View File

@@ -67,13 +67,11 @@ if(APPLE)
set(WITH_COREAUDIO ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_DEVICE_METAL ON CACHE BOOL "" FORCE)
endif()
if(NOT WIN32)
set(WITH_JACK ON CACHE BOOL "" FORCE)
endif()
if(WIN32)
set(WITH_WASAPI ON CACHE BOOL "" FORCE)
endif()
if(UNIX AND NOT APPLE)
set(WITH_JACK ON CACHE BOOL "" FORCE)
set(WITH_DOC_MANPAGE ON CACHE BOOL "" FORCE)
set(WITH_GHOST_XDND ON CACHE BOOL "" FORCE)
set(WITH_PULSEAUDIO ON CACHE BOOL "" FORCE)

View File

@@ -57,6 +57,25 @@ macro(path_ensure_trailing_slash
unset(_path_sep)
endmacro()
# Our own version of `cmake_path(IS_PREFIX ..)`.
# This can be removed when 3.20 or greater is the minimum supported version.
macro(path_is_prefix
path_prefix path result_var
)
# Remove when CMAKE version is bumped to "3.20" or greater.
# `cmake_path(IS_PREFIX ${path_prefix} ${path} NORMALIZE result_var)`
# Get the normalized paths (needed to remove `..`).
get_filename_component(_abs_prefix "${${path_prefix}}" ABSOLUTE)
get_filename_component(_abs_suffix "${${path}}" ABSOLUTE)
string(LENGTH "${_abs_prefix}" _len)
string(SUBSTRING "${_abs_suffix}" 0 "${_len}" _substr)
string(COMPARE EQUAL "${_abs_prefix}" "${_substr}" "${result_var}")
unset(_abs_prefix)
unset(_abs_suffix)
unset(_len)
unset(_substr)
endmacro()
# foo_bar.spam --> foo_barMySuffix.spam
macro(file_suffix
file_name_new file_name file_suffix
@@ -995,7 +1014,8 @@ function(data_to_c_simple_icons
add_custom_command(
OUTPUT ${_file_from} ${_file_to}
COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
# COMMAND python3 ${CMAKE_SOURCE_DIR}/source/blender/datatoc/datatoc_icon.py ${_path_from_abs} ${_file_from}
# COMMAND python3 ${CMAKE_SOURCE_DIR}/source/blender/datatoc/datatoc_icon.py
# ${_path_from_abs} ${_file_from}
COMMAND "$<TARGET_FILE:datatoc_icon>" ${_path_from_abs} ${_file_from}
COMMAND "$<TARGET_FILE:datatoc>" ${_file_from} ${_file_to}
DEPENDS
@@ -1073,23 +1093,27 @@ function(msgfmt_simple
endfunction()
function(find_python_package
package
relative_include_dir
package
relative_include_dir
)
string(TOUPPER ${package} _upper_package)
# set but invalid
# Set but invalid.
if((NOT ${PYTHON_${_upper_package}_PATH} STREQUAL "") AND
(NOT ${PYTHON_${_upper_package}_PATH} MATCHES NOTFOUND))
# if(NOT EXISTS "${PYTHON_${_upper_package}_PATH}/${package}")
# message(WARNING "PYTHON_${_upper_package}_PATH is invalid, ${package} not found in '${PYTHON_${_upper_package}_PATH}' "
# "WITH_PYTHON_INSTALL_${_upper_package} option will be ignored when installing python")
# set(WITH_PYTHON_INSTALL${_upper_package} OFF)
# endif()
# not set, so initialize
# if(NOT EXISTS "${PYTHON_${_upper_package}_PATH}/${package}")
# message(
# WARNING
# "PYTHON_${_upper_package}_PATH is invalid, ${package} not found in "
# "'${PYTHON_${_upper_package}_PATH}' "
# "WITH_PYTHON_INSTALL_${_upper_package} option will be ignored when installing Python"
# )
# set(WITH_PYTHON_INSTALL${_upper_package} OFF)
# endif()
# Not set, so initialize.
else()
string(REPLACE "." ";" _PY_VER_SPLIT "${PYTHON_VERSION}")
string(REPLACE "." ";" _PY_VER_SPLIT "${PYTHON_VERSION}")
list(GET _PY_VER_SPLIT 0 _PY_VER_MAJOR)
# re-cache
@@ -1205,11 +1229,27 @@ macro(set_and_warn_dependency
_dependency _setting _val)
# when $_dependency is disabled, forces $_setting = $_val
if(NOT ${${_dependency}} AND ${${_setting}})
message(STATUS "'${_dependency}' is disabled: forcing 'set(${_setting} ${_val})'")
if(WITH_STRICT_BUILD_OPTIONS)
message(SEND_ERROR "${_dependency} disabled but required by ${_setting}")
else()
message(STATUS "${_dependency} is disabled, setting ${_setting}=${_val}")
endif()
set(${_setting} ${_val})
endif()
endmacro()
macro(set_and_warn_library_found
_library_name _library_found _setting)
if(NOT ${${_library_found}} AND ${${_setting}})
if(WITH_STRICT_BUILD_OPTIONS)
message(SEND_ERROR "${_library_name} required but not found")
else()
message(STATUS "${_library_name} not found, disabling ${_setting}")
endif()
set(${_setting} OFF)
endif()
endmacro()
macro(without_system_libs_begin)
set(CMAKE_IGNORE_PATH "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES};${CMAKE_SYSTEM_INCLUDE_PATH};${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES};${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}")
endmacro()

View File

@@ -43,22 +43,18 @@ find_package(BZip2 REQUIRED)
list(APPEND ZLIB_LIBRARIES ${BZIP2_LIBRARIES})
if(WITH_OPENAL)
find_package(OpenAL)
if(NOT OPENAL_FOUND)
message(WARNING "OpenAL not found, disabling WITH_OPENAL")
set(WITH_OPENAL OFF)
endif()
find_package(OpenAL REQUIRED)
endif()
if(WITH_JACK)
find_library(JACK_FRAMEWORK
NAMES jackmp
)
if(NOT JACK_FRAMEWORK)
message(STATUS "JACK not found, disabling WITH_JACK")
set(WITH_JACK OFF)
else()
if(JACK_FRAMEWORK)
set(JACK_INCLUDE_DIRS ${JACK_FRAMEWORK}/headers)
else()
set_and_warn_library_found("JACK" JACK_FRAMEWORK WITH_JACK)
endif()
endif()
@@ -101,11 +97,7 @@ if(WITH_ALEMBIC)
endif()
if(WITH_USD)
find_package(USD)
if(NOT USD_FOUND)
message(STATUS "USD not found, disabling WITH_USD")
set(WITH_USD OFF)
endif()
find_package(USD REQUIRED)
endif()
if(WITH_OPENSUBDIV)
@@ -227,20 +219,12 @@ find_package(JPEG REQUIRED)
if(WITH_IMAGE_TIFF)
set(TIFF_ROOT ${LIBDIR}/tiff)
find_package(TIFF)
if(NOT TIFF_FOUND)
message(WARNING "TIFF not found, disabling WITH_IMAGE_TIFF")
set(WITH_IMAGE_TIFF OFF)
endif()
find_package(TIFF REQUIRED)
endif()
if(WITH_IMAGE_WEBP)
set(WEBP_ROOT_DIR ${LIBDIR}/webp)
find_package(WebP)
if(NOT WEBP_FOUND)
message(WARNING "WebP not found, disabling WITH_IMAGE_WEBP")
set(WITH_IMAGE_WEBP OFF)
endif()
find_package(WebP REQUIRED)
endif()
if(WITH_BOOST)
@@ -270,11 +254,7 @@ if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG)
endif()
if(WITH_PUGIXML)
find_package(PugiXML)
if(NOT PUGIXML_FOUND)
message(WARNING "PugiXML not found, disabling WITH_PUGIXML")
set(WITH_PUGIXML OFF)
endif()
find_package(PugiXML REQUIRED)
endif()
if(WITH_OPENIMAGEIO)
@@ -292,12 +272,7 @@ if(WITH_OPENIMAGEIO)
endif()
if(WITH_OPENCOLORIO)
find_package(OpenColorIO 2.0.0)
if(NOT OPENCOLORIO_FOUND)
set(WITH_OPENCOLORIO OFF)
message(STATUS "OpenColorIO not found, disabling WITH_OPENCOLORIO")
endif()
find_package(OpenColorIO 2.0.0 REQUIRED)
endif()
if(WITH_OPENVDB)
@@ -331,23 +306,7 @@ if(WITH_LLVM)
endif()
if(WITH_CYCLES AND WITH_CYCLES_OSL)
set(CYCLES_OSL ${LIBDIR}/osl)
find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)
# WARNING! depends on correct order of OSL libs linking
list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -force_load ${OSL_LIB_EXEC} ${OSL_LIB_QUERY})
find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
find_path(OSL_SHADER_DIR NAMES stdosl.h PATHS ${CYCLES_OSL}/share/OSL/shaders)
if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER AND OSL_SHADER_DIR)
set(OSL_FOUND TRUE)
else()
message(WARNING "OSL not found, disabling WITH_CYCLES_OSL")
set(WITH_CYCLES_OSL OFF)
endif()
find_package(OSL REQUIRED)
endif()
if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
@@ -365,28 +324,15 @@ if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
endif()
if(WITH_OPENIMAGEDENOISE)
find_package(OpenImageDenoise)
if(NOT OPENIMAGEDENOISE_FOUND)
set(WITH_OPENIMAGEDENOISE OFF)
message(STATUS "OpenImageDenoise not found, disabling WITH_OPENIMAGEDENOISE")
endif()
find_package(OpenImageDenoise REQUIRED)
endif()
if(WITH_TBB)
find_package(TBB)
if(NOT TBB_FOUND)
message(WARNING "TBB not found, disabling WITH_TBB")
set(WITH_TBB OFF)
endif()
find_package(TBB REQUIRED)
endif()
if(WITH_POTRACE)
find_package(Potrace)
if(NOT POTRACE_FOUND)
message(WARNING "potrace not found, disabling WITH_POTRACE")
set(WITH_POTRACE OFF)
endif()
find_package(Potrace REQUIRED)
endif()
# CMake FindOpenMP doesn't know about AppleClang before 3.12, so provide custom flags.
@@ -406,30 +352,18 @@ if(WITH_OPENMP)
endif()
if(WITH_XR_OPENXR)
find_package(XR_OpenXR_SDK)
if(NOT XR_OPENXR_SDK_FOUND)
message(WARNING "OpenXR-SDK was not found, disabling WITH_XR_OPENXR")
set(WITH_XR_OPENXR OFF)
endif()
find_package(XR_OpenXR_SDK REQUIRED)
endif()
if(WITH_GMP)
find_package(GMP)
if(NOT GMP_FOUND)
message(WARNING "GMP not found, disabling WITH_GMP")
set(WITH_GMP OFF)
endif()
find_package(GMP REQUIRED)
endif()
if(WITH_HARU)
find_package(Haru)
if(NOT HARU_FOUND)
message(WARNING "Haru not found, disabling WITH_HARU")
set(WITH_HARU OFF)
endif()
find_package(Haru REQUIRED)
endif()
if(WITH_CYCLES_PATH_GUIDING)
if(WITH_CYCLES AND WITH_CYCLES_PATH_GUIDING)
find_package(openpgl QUIET)
if(openpgl_FOUND)
get_target_property(OPENPGL_LIBRARIES openpgl::openpgl LOCATION)

View File

@@ -151,7 +151,7 @@ if(WITH_PYTHON)
# Installing into `site-packages`, warn when installing into `./../lib/`
# which script authors almost certainly don't want.
if(EXISTS ${LIBDIR})
cmake_path(IS_PREFIX LIBDIR "${PYTHON_SITE_PACKAGES}" NORMALIZE _is_prefix)
path_is_prefix(LIBDIR PYTHON_SITE_PACKAGES _is_prefix)
if(_is_prefix)
message(WARNING "
Building Blender with the following configuration:
@@ -174,32 +174,24 @@ endif()
if(WITH_IMAGE_OPENEXR)
find_package_wrapper(OpenEXR) # our own module
if(NOT OPENEXR_FOUND)
set(WITH_IMAGE_OPENEXR OFF)
endif()
set_and_warn_library_found("OpenEXR" OPENEXR_FOUND WITH_IMAGE_OPENEXR)
endif()
if(WITH_IMAGE_OPENJPEG)
find_package_wrapper(OpenJPEG)
if(NOT OPENJPEG_FOUND)
set(WITH_IMAGE_OPENJPEG OFF)
endif()
set_and_warn_library_found("OpenJPEG" OPENJPEG_FOUND WITH_IMAGE_OPENJPEG)
endif()
if(WITH_IMAGE_TIFF)
# XXX Linking errors with debian static tiff :/
# find_package_wrapper(TIFF)
find_package(TIFF)
if(NOT TIFF_FOUND)
set(WITH_IMAGE_TIFF OFF)
endif()
set_and_warn_library_found("TIFF" TIFF_FOUND WITH_IMAGE_TIFF)
endif()
if(WITH_OPENAL)
find_package_wrapper(OpenAL)
if(NOT OPENAL_FOUND)
set(WITH_OPENAL OFF)
endif()
set_and_warn_library_found("OpenAL" OPENAL_FOUND WITH_OPENAL)
endif()
if(WITH_SDL)
@@ -221,18 +213,14 @@ if(WITH_SDL)
SDL_LIBRARY
)
# unset(SDLMAIN_LIBRARY CACHE)
if(NOT SDL_FOUND)
set(WITH_SDL OFF)
endif()
set_and_warn_library_found("SDL" SDL_FOUND WITH_SDL)
endif()
endif()
# Codecs
if(WITH_CODEC_SNDFILE)
find_package_wrapper(SndFile)
if(NOT SNDFILE_FOUND)
set(WITH_CODEC_SNDFILE OFF)
endif()
set_and_warn_library_found("libsndfile" SNDFILE_FOUND WITH_CODEC_SNDFILE)
endif()
if(WITH_CODEC_FFMPEG)
@@ -260,17 +248,12 @@ if(WITH_CODEC_FFMPEG)
endif()
find_package(FFmpeg)
if(NOT FFMPEG_FOUND)
set(WITH_CODEC_FFMPEG OFF)
message(STATUS "FFmpeg not found, disabling it")
endif()
set_and_warn_library_found("FFmpeg" FFMPEG_FOUND WITH_CODEC_FFMPEG)
endif()
if(WITH_FFTW3)
find_package_wrapper(Fftw3)
if(NOT FFTW3_FOUND)
set(WITH_FFTW3 OFF)
endif()
set_and_warn_library_found("fftw3" FFTW3_FOUND WITH_FFTW3)
endif()
if(WITH_OPENCOLLADA)
@@ -285,25 +268,23 @@ if(WITH_OPENCOLLADA)
endif()
find_package_wrapper(XML2)
else()
set(WITH_OPENCOLLADA OFF)
set_and_warn_library_found("OpenCollada" OPENCOLLADA_FOUND WITH_OPENCOLLADA)
endif()
endif()
if(WITH_MEM_JEMALLOC)
find_package_wrapper(JeMalloc)
if(NOT JEMALLOC_FOUND)
set(WITH_MEM_JEMALLOC OFF)
endif()
set_and_warn_library_found("JeMalloc" JEMALLOC_FOUND WITH_MEM_JEMALLOC)
endif()
if(WITH_INPUT_NDOF)
find_package_wrapper(Spacenav)
set_and_warn_library_found("SpaceNav" SPACENAV_FOUND WITH_INPUT_NDOF)
if(SPACENAV_FOUND)
# use generic names within blenders buildsystem.
set(NDOF_INCLUDE_DIRS ${SPACENAV_INCLUDE_DIRS})
set(NDOF_LIBRARIES ${SPACENAV_LIBRARIES})
else()
set(WITH_INPUT_NDOF OFF)
endif()
endif()
@@ -313,6 +294,8 @@ if(WITH_CYCLES AND WITH_CYCLES_OSL)
set(OSL_ROOT ${CYCLES_OSL})
endif()
find_package_wrapper(OSL)
set_and_warn_library_found("OSL" OSL_FOUND WITH_CYCLES_OSL)
if(OSL_FOUND)
if(${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6")
# Note: --whole-archive is needed to force loading of all symbols in liboslexec,
@@ -323,13 +306,10 @@ if(WITH_CYCLES AND WITH_CYCLES_OSL)
-Wl,--no-whole-archive ${OSL_OSLQUERY_LIBRARY}
)
endif()
else()
message(STATUS "OSL not found, disabling it from Cycles")
set(WITH_CYCLES_OSL OFF)
endif()
endif()
if(WITH_CYCLES_DEVICE_ONEAPI)
if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
set(CYCLES_LEVEL_ZERO ${LIBDIR}/level-zero CACHE PATH "Path to Level Zero installation")
if(EXISTS ${CYCLES_LEVEL_ZERO} AND NOT LEVEL_ZERO_ROOT_DIR)
set(LEVEL_ZERO_ROOT_DIR ${CYCLES_LEVEL_ZERO})
@@ -341,35 +321,27 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
endif()
file(GLOB _sycl_runtime_libraries
${SYCL_ROOT_DIR}/lib/libsycl.so
${SYCL_ROOT_DIR}/lib/libsycl.so.[0-9]
${SYCL_ROOT_DIR}/lib/libsycl.so.[0-9].[0-9].[0-9]-[0-9]
${SYCL_ROOT_DIR}/lib/libsycl.so.*
${SYCL_ROOT_DIR}/lib/libpi_level_zero.so
)
list(FILTER _sycl_runtime_libraries EXCLUDE REGEX ".*\.py")
list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_sycl_runtime_libraries})
unset(_sycl_runtime_libraries)
endif()
if(WITH_OPENVDB)
find_package_wrapper(OpenVDB)
find_package_wrapper(Blosc)
set_and_warn_library_found("OpenVDB" OPENVDB_FOUND WITH_OPENVDB)
if(NOT OPENVDB_FOUND)
set(WITH_OPENVDB OFF)
set(WITH_OPENVDB_BLOSC OFF)
message(STATUS "OpenVDB not found, disabling it")
elseif(NOT BLOSC_FOUND)
set(WITH_OPENVDB_BLOSC OFF)
message(STATUS "Blosc not found, disabling it for OpenVBD")
if(OPENVDB_FOUND)
find_package_wrapper(Blosc)
set_and_warn_library_found("Blosc" BLOSC_FOUND WITH_OPENVDB_BLOSC)
endif()
endif()
if(WITH_NANOVDB)
find_package_wrapper(NanoVDB)
if(NOT NANOVDB_FOUND)
set(WITH_NANOVDB OFF)
message(STATUS "NanoVDB not found, disabling it")
endif()
set_and_warn_library_found("NanoVDB" NANOVDB_FOUND WITH_NANOVDB)
endif()
if(WITH_CPU_SIMD AND SUPPORT_NEON_BUILD)
@@ -378,18 +350,12 @@ endif()
if(WITH_ALEMBIC)
find_package_wrapper(Alembic)
if(NOT ALEMBIC_FOUND)
set(WITH_ALEMBIC OFF)
endif()
set_and_warn_library_found("Alembic" ALEMBIC_FOUND WITH_ALEMBIC)
endif()
if(WITH_USD)
find_package_wrapper(USD)
if(NOT USD_FOUND)
set(WITH_USD OFF)
endif()
set_and_warn_library_found("USD" USD_FOUND WITH_USD)
endif()
if(WITH_BOOST)
@@ -442,20 +408,13 @@ endif()
if(WITH_PUGIXML)
find_package_wrapper(PugiXML)
if(NOT PUGIXML_FOUND)
set(WITH_PUGIXML OFF)
message(STATUS "PugiXML not found, disabling WITH_PUGIXML")
endif()
set_and_warn_library_found("PugiXML" PUGIXML_FOUND WITH_PUGIXML)
endif()
if(WITH_IMAGE_WEBP)
set(WEBP_ROOT_DIR ${LIBDIR}/webp)
find_package_wrapper(WebP)
if(NOT WEBP_FOUND)
set(WITH_IMAGE_WEBP OFF)
message(WARNING "WebP not found, disabling WITH_IMAGE_WEBP")
endif()
set_and_warn_library_found("WebP" WEBP_FOUND WITH_IMAGE_WEBP)
endif()
if(WITH_OPENIMAGEIO)
@@ -480,10 +439,7 @@ if(WITH_OPENIMAGEIO)
list(APPEND OPENIMAGEIO_LIBRARIES "${WEBP_LIBRARIES}")
endif()
if(NOT OPENIMAGEIO_FOUND)
set(WITH_OPENIMAGEIO OFF)
message(STATUS "OpenImageIO not found, disabling WITH_CYCLES")
endif()
set_and_warn_library_found("OPENIMAGEIO" OPENIMAGEIO_FOUND WITH_OPENIMAGEIO)
endif()
if(WITH_OPENCOLORIO)
@@ -493,10 +449,7 @@ if(WITH_OPENCOLORIO)
set(OPENCOLORIO_LIBPATH) # TODO, remove and reference the absolute path everywhere
set(OPENCOLORIO_DEFINITIONS)
if(NOT OPENCOLORIO_FOUND)
set(WITH_OPENCOLORIO OFF)
message(STATUS "OpenColorIO not found")
endif()
set_and_warn_library_found("OpenColorIO" OPENCOLORIO_FOUND WITH_OPENCOLORIO)
endif()
if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
@@ -505,11 +458,7 @@ endif()
if(WITH_OPENIMAGEDENOISE)
find_package_wrapper(OpenImageDenoise)
if(NOT OPENIMAGEDENOISE_FOUND)
set(WITH_OPENIMAGEDENOISE OFF)
message(STATUS "OpenImageDenoise not found")
endif()
set_and_warn_library_found("OpenImageDenoise" OPENIMAGEDENOISE_FOUND WITH_OPENIMAGEDENOISE)
endif()
if(WITH_LLVM)
@@ -518,24 +467,19 @@ if(WITH_LLVM)
endif()
find_package_wrapper(LLVM)
if(WITH_CLANG)
find_package_wrapper(Clang)
endif()
# Symbol conflicts with same UTF library used by OpenCollada
if(EXISTS ${LIBDIR})
if(WITH_OPENCOLLADA AND (${LLVM_VERSION} VERSION_LESS "4.0.0"))
list(REMOVE_ITEM OPENCOLLADA_LIBRARIES ${OPENCOLLADA_UTF_LIBRARY})
endif()
endif()
set_and_warn_library_found("LLVM" LLVM_FOUND WITH_LLVM)
if(NOT LLVM_FOUND)
set(WITH_LLVM OFF)
set(WITH_CLANG OFF)
message(STATUS "LLVM not found")
else()
if(NOT CLANG_FOUND)
set(WITH_CLANG OFF)
message(STATUS "Clang not found")
if(LLVM_FOUND)
if(WITH_CLANG)
find_package_wrapper(Clang)
set_and_warn_library_found("Clang" CLANG_FOUND WITH_CLANG)
endif()
# Symbol conflicts with same UTF library used by OpenCollada
if(EXISTS ${LIBDIR})
if(WITH_OPENCOLLADA AND (${LLVM_VERSION} VERSION_LESS "4.0.0"))
list(REMOVE_ITEM OPENCOLLADA_LIBRARIES ${OPENCOLLADA_UTF_LIBRARY})
endif()
endif()
endif()
endif()
@@ -546,53 +490,35 @@ if(WITH_OPENSUBDIV)
set(OPENSUBDIV_LIBRARIES ${OPENSUBDIV_LIBRARIES})
set(OPENSUBDIV_LIBPATH) # TODO, remove and reference the absolute path everywhere
if(NOT OPENSUBDIV_FOUND)
set(WITH_OPENSUBDIV OFF)
message(STATUS "OpenSubdiv not found")
endif()
set_and_warn_library_found("OpenSubdiv" OPENSUBDIV_FOUND WITH_OPENSUBDIV)
endif()
if(WITH_TBB)
find_package_wrapper(TBB)
if(NOT TBB_FOUND)
message(WARNING "TBB not found, disabling WITH_TBB")
set(WITH_TBB OFF)
endif()
set_and_warn_library_found("TBB" TBB_FOUND WITH_TBB)
endif()
if(WITH_XR_OPENXR)
find_package(XR_OpenXR_SDK)
if(NOT XR_OPENXR_SDK_FOUND)
message(WARNING "OpenXR-SDK not found, disabling WITH_XR_OPENXR")
set(WITH_XR_OPENXR OFF)
endif()
set_and_warn_library_found("OpenXR-SDK" XR_OPENXR_SDK_FOUND WITH_XR_OPENXR)
endif()
if(WITH_GMP)
find_package_wrapper(GMP)
if(NOT GMP_FOUND)
message(WARNING "GMP not found, disabling WITH_GMP")
set(WITH_GMP OFF)
endif()
set_and_warn_library_found("GMP" GMP_FOUND WITH_GMP)
endif()
if(WITH_POTRACE)
find_package_wrapper(Potrace)
if(NOT POTRACE_FOUND)
message(WARNING "potrace not found, disabling WITH_POTRACE")
set(WITH_POTRACE OFF)
endif()
set_and_warn_library_found("Potrace" POTRACE_FOUND WITH_POTRACE)
endif()
if(WITH_HARU)
find_package_wrapper(Haru)
if(NOT HARU_FOUND)
message(WARNING "Haru not found, disabling WITH_HARU")
set(WITH_HARU OFF)
endif()
set_and_warn_library_found("Haru" HARU_FOUND WITH_HARU)
endif()
if(WITH_CYCLES_PATH_GUIDING)
if(WITH_CYCLES AND WITH_CYCLES_PATH_GUIDING)
find_package_wrapper(openpgl)
if(openpgl_FOUND)
get_target_property(OPENPGL_LIBRARIES openpgl::openpgl LOCATION)
@@ -676,25 +602,20 @@ endif()
# Jack is intended to use the system library.
if(WITH_JACK)
find_package_wrapper(Jack)
if(NOT JACK_FOUND)
set(WITH_JACK OFF)
endif()
set_and_warn_library_found("JACK" JACK_FOUND WITH_JACK)
endif()
# Pulse is intended to use the system library.
if(WITH_PULSEAUDIO)
find_package_wrapper(Pulse)
if(NOT PULSE_FOUND)
set(WITH_PULSEAUDIO OFF)
endif()
set_and_warn_library_found("PulseAudio" PULSE_FOUND WITH_PULSEAUDIO)
endif()
# Audio IO
if(WITH_SYSTEM_AUDASPACE)
find_package_wrapper(Audaspace)
if(NOT AUDASPACE_FOUND OR NOT AUDASPACE_C_FOUND)
message(FATAL_ERROR "Audaspace external library not found!")
endif()
set(AUDASPACE_FOUND ${AUDASPACE_FOUND} AND ${AUDASPACE_C_FOUND})
set_and_warn_library_found("External Audaspace" AUDASPACE_FOUND WITH_SYSTEM_AUDASPACE)
endif()
if(WITH_GHOST_WAYLAND)
@@ -739,31 +660,14 @@ if(WITH_GHOST_WAYLAND)
set(wayland-scanner_FOUND ON)
set(wayland-cursor_FOUND ON)
endif()
mark_as_advanced(WAYLAND_PROTOCOLS_DIR)
if (NOT ${wayland-client_FOUND})
message(STATUS "wayland-client not found, disabling WITH_GHOST_WAYLAND")
set(WITH_GHOST_WAYLAND OFF)
endif()
if (NOT ${wayland-egl_FOUND})
message(STATUS "wayland-egl not found, disabling WITH_GHOST_WAYLAND")
set(WITH_GHOST_WAYLAND OFF)
endif()
if (NOT ${wayland-scanner_FOUND})
message(STATUS "wayland-scanner not found, disabling WITH_GHOST_WAYLAND")
set(WITH_GHOST_WAYLAND OFF)
endif()
if (NOT ${wayland-cursor_FOUND})
message(STATUS "wayland-cursor not found, disabling WITH_GHOST_WAYLAND")
set(WITH_GHOST_WAYLAND OFF)
endif()
if (NOT ${wayland-protocols_FOUND})
message(STATUS "wayland-protocols not found, disabling WITH_GHOST_WAYLAND")
set(WITH_GHOST_WAYLAND OFF)
endif()
if (NOT ${xkbcommon_FOUND})
message(STATUS "xkbcommon not found, disabling WITH_GHOST_WAYLAND")
set(WITH_GHOST_WAYLAND OFF)
endif()
set_and_warn_library_found("wayland-client" wayland-client_FOUND WITH_GHOST_WAYLAND)
set_and_warn_library_found("wayland-egl" wayland-egl_FOUND WITH_GHOST_WAYLAND)
set_and_warn_library_found("wayland-scanner" wayland-scanner_FOUND WITH_GHOST_WAYLAND)
set_and_warn_library_found("wayland-cursor" wayland-cursor_FOUND WITH_GHOST_WAYLAND)
set_and_warn_library_found("wayland-protocols" wayland-protocols_FOUND WITH_GHOST_WAYLAND)
set_and_warn_library_found("xkbcommon" xkbcommon_FOUND WITH_GHOST_WAYLAND)
if(WITH_GHOST_WAYLAND)
if(WITH_GHOST_WAYLAND_DBUS)
@@ -791,6 +695,7 @@ if(WITH_GHOST_WAYLAND)
else()
pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner)
endif()
mark_as_advanced(WAYLAND_SCANNER)
# When using dynamic loading, headers generated
# from older versions of `wayland-scanner` aren't compatible.

View File

@@ -150,10 +150,11 @@ endif()
# Debug Symbol format
# sccache # MSVC_ASAN # format # why
# ON # ON # Z7 # sccache will only play nice with Z7
# ON # OFF # Z7 # sccache will only play nice with Z7
# OFF # ON # Zi # Asan will not play nice with Edit and Continue
# OFF # OFF # ZI # Neither asan nor sscache is enabled Edit and Continue is available
# ON # ON # Z7 # sccache will only play nice with Z7.
# ON # OFF # Z7 # sccache will only play nice with Z7.
# OFF # ON # Zi # Asan will not play nice with Edit and Continue.
# OFF # OFF # ZI # Neither ASAN nor sscache is enabled Edit and
# Continue is available.
# Release Symbol format
# sccache # MSVC_ASAN # format # why
@@ -326,18 +327,10 @@ if(WITH_FFTW3)
endif()
if(WITH_IMAGE_WEBP)
windows_find_package(WebP)
if(NOT WEBP_FOUND)
if(EXISTS ${LIBDIR}/webp)
set(WEBP_INCLUDE_DIRS ${LIBDIR}/webp/include)
set(WEBP_ROOT_DIR ${LIBDIR}/webp)
set(WEBP_LIBRARIES ${LIBDIR}/webp/lib/webp.lib ${LIBDIR}/webp/lib/webpdemux.lib ${LIBDIR}/webp/lib/webpmux.lib)
set(WEBP_FOUND ON)
else()
message(STATUS "WITH_IMAGE_WEBP is ON but WEBP libraries are not found, setting WITH_IMAGE_WEBP=OFF")
set(WITH_IMAGE_WEBP OFF)
endif()
endif()
set(WEBP_INCLUDE_DIRS ${LIBDIR}/webp/include)
set(WEBP_ROOT_DIR ${LIBDIR}/webp)
set(WEBP_LIBRARIES ${LIBDIR}/webp/lib/webp.lib ${LIBDIR}/webp/lib/webpdemux.lib ${LIBDIR}/webp/lib/webpmux.lib)
set(WEBP_FOUND ON)
endif()
if(WITH_OPENCOLLADA)
@@ -358,7 +351,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
@@ -368,10 +360,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)
@@ -679,11 +675,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()
@@ -700,12 +696,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()
@@ -773,9 +763,11 @@ if(WITH_CYCLES AND WITH_CYCLES_OSL)
find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_NOISE NAMES oslnoise PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_EXEC_DEBUG NAMES oslexec_d PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_COMP_DEBUG NAMES oslcomp_d PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_QUERY_DEBUG NAMES oslquery_d PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_NOISE_DEBUG NAMES oslnoise_d PATHS ${CYCLES_OSL}/lib)
list(APPEND OSL_LIBRARIES
optimized ${OSL_LIB_COMP}
optimized ${OSL_LIB_EXEC}
@@ -785,15 +777,14 @@ if(WITH_CYCLES AND WITH_CYCLES_OSL)
debug ${OSL_LIB_QUERY_DEBUG}
${PUGIXML_LIBRARIES}
)
if(OSL_LIB_NOISE)
list(APPEND OSL_LIBRARIES optimized ${OSL_LIB_NOISE})
endif()
if(OSL_LIB_NOISE_DEBUG)
list(APPEND OSL_LIBRARIES debug ${OSL_LIB_NOISE_DEBUG})
endif()
find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER)
set(OSL_FOUND TRUE)
else()
message(STATUS "OSL not found")
set(WITH_CYCLES_OSL OFF)
endif()
endif()
if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
@@ -893,21 +884,16 @@ if(WINDOWS_PYTHON_DEBUG)
endif()
if(WITH_XR_OPENXR)
if(EXISTS ${LIBDIR}/xr_openxr_sdk)
set(XR_OPENXR_SDK ${LIBDIR}/xr_openxr_sdk)
set(XR_OPENXR_SDK_LIBPATH ${LIBDIR}/xr_openxr_sdk/lib)
set(XR_OPENXR_SDK_INCLUDE_DIR ${XR_OPENXR_SDK}/include)
# This is the old name of this library, it is checked to
# support the transition between the old and new lib versions
# this can be removed after the next lib update.
if(EXISTS ${XR_OPENXR_SDK_LIBPATH}/openxr_loader_d.lib)
set(XR_OPENXR_SDK_LIBRARIES optimized ${XR_OPENXR_SDK_LIBPATH}/openxr_loader.lib debug ${XR_OPENXR_SDK_LIBPATH}/openxr_loader_d.lib)
else()
set(XR_OPENXR_SDK_LIBRARIES optimized ${XR_OPENXR_SDK_LIBPATH}/openxr_loader.lib debug ${XR_OPENXR_SDK_LIBPATH}/openxr_loaderd.lib)
endif()
set(XR_OPENXR_SDK ${LIBDIR}/xr_openxr_sdk)
set(XR_OPENXR_SDK_LIBPATH ${LIBDIR}/xr_openxr_sdk/lib)
set(XR_OPENXR_SDK_INCLUDE_DIR ${XR_OPENXR_SDK}/include)
# This is the old name of this library, it is checked to
# support the transition between the old and new lib versions
# this can be removed after the next lib update.
if(EXISTS ${XR_OPENXR_SDK_LIBPATH}/openxr_loader_d.lib)
set(XR_OPENXR_SDK_LIBRARIES optimized ${XR_OPENXR_SDK_LIBPATH}/openxr_loader.lib debug ${XR_OPENXR_SDK_LIBPATH}/openxr_loader_d.lib)
else()
message(WARNING "OpenXR-SDK was not found, disabling WITH_XR_OPENXR")
set(WITH_XR_OPENXR OFF)
set(XR_OPENXR_SDK_LIBRARIES optimized ${XR_OPENXR_SDK_LIBPATH}/openxr_loader.lib debug ${XR_OPENXR_SDK_LIBPATH}/openxr_loaderd.lib)
endif()
endif()
@@ -925,18 +911,13 @@ if(WITH_POTRACE)
endif()
if(WITH_HARU)
if(EXISTS ${LIBDIR}/haru)
set(HARU_FOUND ON)
set(HARU_ROOT_DIR ${LIBDIR}/haru)
set(HARU_INCLUDE_DIRS ${HARU_ROOT_DIR}/include)
set(HARU_LIBRARIES ${HARU_ROOT_DIR}/lib/libhpdfs.lib)
else()
message(WARNING "Haru was not found, disabling WITH_HARU")
set(WITH_HARU OFF)
endif()
set(HARU_FOUND ON)
set(HARU_ROOT_DIR ${LIBDIR}/haru)
set(HARU_INCLUDE_DIRS ${HARU_ROOT_DIR}/include)
set(HARU_LIBRARIES ${HARU_ROOT_DIR}/lib/libhpdfs.lib)
endif()
if(WITH_CYCLES_PATH_GUIDING)
if(WITH_CYCLES AND WITH_CYCLES_PATH_GUIDING)
find_package(openpgl QUIET)
if(openpgl_FOUND)
get_target_property(OPENPGL_LIBRARIES_RELEASE openpgl::openpgl LOCATION_RELEASE)
@@ -952,7 +933,7 @@ endif()
set(ZSTD_INCLUDE_DIRS ${LIBDIR}/zstd/include)
set(ZSTD_LIBRARIES ${LIBDIR}/zstd/lib/zstd_static.lib)
if(WITH_CYCLES_DEVICE_ONEAPI)
if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
set(LEVEL_ZERO_ROOT_DIR ${LIBDIR}/level_zero)
set(CYCLES_SYCL ${LIBDIR}/dpcpp CACHE PATH "Path to oneAPI DPC++ compiler")
if(EXISTS ${CYCLES_SYCL} AND NOT SYCL_ROOT_DIR)

View File

@@ -58,6 +58,8 @@ buildbot:
version: '5.2.21440'
optix:
version: '7.3.0'
ocloc:
version: '101.3430'
cmake:
default:
version: any

View File

@@ -208,12 +208,15 @@ def main() -> None:
dist_dir = os.path.join(install_dir, "dist")
for f in os.listdir(dist_dir):
if f.endswith(".whl"):
# No apparent way to override this ABI version with setuptools, so rename.
sys_py = "cp%d%d" % (sys.version_info.major, sys.version_info.minor)
sys_py_abi = sys_py + sys.abiflags
blender_py = "cp%d%d" % (python_version_number[0], python_version_number[1])
renamed_f = f.replace(sys_py_abi, blender_py).replace(sys_py, blender_py)
# No apparent way to override this ABI version with setuptools, so rename.
sys_py = "cp%d%d" % (sys.version_info.major, sys.version_info.minor)
if hasattr(sys, "abiflags"):
sys_py_abi = sys_py + sys.abiflags
renamed_f = f.replace(sys_py_abi, blender_py).replace(sys_py, blender_py)
else:
renamed_f = f.replace(sys_py, blender_py)
os.rename(os.path.join(dist_dir, f), os.path.join(output_dir, renamed_f))

View File

@@ -18,8 +18,13 @@ import sys
import make_utils
from make_utils import call, check_output
from typing import (
List,
Optional,
)
def print_stage(text):
def print_stage(text: str) -> None:
print("")
print(text)
print("")
@@ -27,7 +32,7 @@ def print_stage(text):
# Parse arguments
def parse_arguments():
def parse_arguments() -> argparse.Namespace:
parser = argparse.ArgumentParser()
parser.add_argument("--no-libraries", action="store_true")
parser.add_argument("--no-blender", action="store_true")
@@ -40,13 +45,13 @@ def parse_arguments():
return parser.parse_args()
def get_blender_git_root():
def get_blender_git_root() -> str:
return check_output([args.git_command, "rev-parse", "--show-toplevel"])
# Setup for precompiled libraries and tests from svn.
def svn_update(args, release_version):
def svn_update(args: argparse.Namespace, release_version: Optional[str]) -> None:
svn_non_interactive = [args.svn_command, '--non-interactive']
lib_dirpath = os.path.join(get_blender_git_root(), '..', 'lib')
@@ -99,42 +104,42 @@ def svn_update(args, release_version):
call(svn_non_interactive + ["checkout", svn_url_tests, lib_tests_dirpath])
# Update precompiled libraries and tests
print_stage("Updating Precompiled Libraries and Tests")
if os.path.isdir(lib_dirpath):
for dirname in os.listdir(lib_dirpath):
dirpath = os.path.join(lib_dirpath, dirname)
if not os.path.isdir(lib_dirpath):
print("Library path: %r, not found, skipping" % lib_dirpath)
else:
paths_local_and_remote = []
if os.path.exists(os.path.join(lib_dirpath, ".svn")):
print_stage("Updating Precompiled Libraries and Tests (one repository)")
paths_local_and_remote.append((lib_dirpath, svn_url))
else:
print_stage("Updating Precompiled Libraries and Tests (multiple repositories)")
# Separate paths checked out.
for dirname in os.listdir(lib_dirpath):
if dirname.startswith("."):
# Temporary paths such as ".mypy_cache" will report a warning, skip hidden directories.
continue
if dirname == ".svn":
# Cleanup must be run from svn root directory if it exists.
if not make_utils.command_missing(args.svn_command):
call(svn_non_interactive + ["cleanup", lib_dirpath])
continue
elif dirname.startswith("."):
# Temporary paths such as ".mypy_cache" will report a warning, skip hidden directories.
continue
dirpath = os.path.join(lib_dirpath, dirname)
if not (os.path.isdir(dirpath) and os.path.exists(os.path.join(dirpath, ".svn"))):
continue
svn_dirpath = os.path.join(dirpath, ".svn")
svn_root_dirpath = os.path.join(lib_dirpath, ".svn")
paths_local_and_remote.append((dirpath, svn_url + dirname))
if (
os.path.isdir(dirpath) and
(os.path.exists(svn_dirpath) or os.path.exists(svn_root_dirpath))
):
if make_utils.command_missing(args.svn_command):
sys.stderr.write("svn not found, can't update libraries\n")
sys.exit(1)
if paths_local_and_remote:
if make_utils.command_missing(args.svn_command):
sys.stderr.write("svn not found, can't update libraries\n")
sys.exit(1)
# Cleanup to continue with interrupted downloads.
if os.path.exists(svn_dirpath):
call(svn_non_interactive + ["cleanup", dirpath])
for dirpath, svn_url_full in paths_local_and_remote:
call(svn_non_interactive + ["cleanup", dirpath])
# Switch to appropriate branch and update.
call(svn_non_interactive + ["switch", svn_url + dirname, dirpath], exit_on_error=False)
call(svn_non_interactive + ["switch", svn_url_full, dirpath], exit_on_error=False)
call(svn_non_interactive + ["update", dirpath])
# Test if git repo can be updated.
def git_update_skip(args, check_remote_exists=True):
def git_update_skip(args: argparse.Namespace, check_remote_exists: bool = True) -> str:
if make_utils.command_missing(args.git_command):
sys.stderr.write("git not found, can't update code\n")
sys.exit(1)
@@ -166,13 +171,17 @@ def git_update_skip(args, check_remote_exists=True):
# Update blender repository.
def blender_update(args):
def blender_update(args: argparse.Namespace) -> None:
print_stage("Updating Blender Git Repository")
call([args.git_command, "pull", "--rebase"])
# Update submodules.
def submodules_update(args, release_version, branch):
def submodules_update(
args: argparse.Namespace,
release_version: Optional[str],
branch: Optional[str],
) -> str:
print_stage("Updating Submodules")
if make_utils.command_missing(args.git_command):
sys.stderr.write("git not found, can't update code\n")
@@ -214,7 +223,8 @@ def submodules_update(args, release_version, branch):
elif make_utils.git_branch_exists(args.git_command, submodule_branch_fallback):
submodule_branch = submodule_branch_fallback
else:
submodule_branch = None
# Skip.
submodule_branch = ""
# Switch to branch and pull.
if submodule_branch:

View File

@@ -80,7 +80,7 @@ def git_tag(git_command: str) -> Optional[str]:
return tag.strip().decode('utf8')
def git_branch_release_version(branch: str, tag: str) -> Optional[str]:
def git_branch_release_version(branch: str, tag: Optional[str]) -> Optional[str]:
re_match = re.search("^blender-v(.*)-release$", branch)
release_version = None
if re_match:

View File

@@ -80,9 +80,11 @@ if NOT "%1" == "" (
REM Non-Build Commands
) else if "%1" == "update" (
SET BUILD_UPDATE=1
SET BUILD_UPDATE_SVN=1
set BUILD_UPDATE_ARGS=
) else if "%1" == "code_update" (
SET BUILD_UPDATE=1
SET BUILD_UPDATE_SVN=0
set BUILD_UPDATE_ARGS="--no-libraries"
) else if "%1" == "ninja" (
SET BUILD_WITH_NINJA=1

View File

@@ -34,3 +34,4 @@ set BUILD_WITH_SCCACHE=
set ICONS=
set ICONS_GEOM=
set DOC_PY=
SET BUILD_UPDATE_SVN=

View File

@@ -0,0 +1,24 @@
if "%BUILD_VS_YEAR%"=="2019" set BUILD_VS_LIBDIRPOST=vc15
if "%BUILD_VS_YEAR%"=="2022" set BUILD_VS_LIBDIRPOST=vc15
set BUILD_VS_SVNDIR=win64_%BUILD_VS_LIBDIRPOST%
set BUILD_VS_LIBDIR="%BLENDER_DIR%..\lib\%BUILD_VS_SVNDIR%"
cd %BUILD_VS_LIBDIR%
:RETRY
"%SVN%" update
if errorlevel 1 (
set /p LibRetry= "Error during update, retry? y/n"
if /I "!LibRetry!"=="Y" (
"%SVN%" cleanup
goto RETRY
)
echo.
echo Error: Download of external libraries failed.
echo This is needed for building, please manually run 'svn cleanup' and 'svn update' in
echo %BUILD_VS_LIBDIR% , until this is resolved you CANNOT make a successful blender build
echo.
exit /b 1
)
cd %BLENDER_DIR%

View File

@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = V3.4
PROJECT_NUMBER = V3.5
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@@ -1,13 +1,13 @@
sphinx==5.2.3
sphinx==5.3.0
# Sphinx dependencies that are important
Jinja2==3.1.2
Pygments==2.13.0
docutils==0.17.1
snowballstemmer==2.2.0
babel==2.10.3
babel==2.11.0
requests==2.28.1
# Only needed to match the theme used for the official documentation.
# Without this theme, the default theme will be used.
sphinx_rtd_theme==1.0.0
sphinx_rtd_theme==1.1.0

View File

@@ -1459,15 +1459,15 @@ def pyrna2sphinx(basepath):
# If the link has been written, no need to inline the enum items.
enum_text = "" if enum_descr_override else pyrna_enum2sphinx(prop)
if prop.name or prop.description or enum_text:
fw(ident + ":%s%s:\n\n" % (id_name, identifier))
fw(ident + ":%s%s: " % (id_name, identifier))
if prop.name or prop.description:
fw(indent(", ".join(val for val in (prop.name, prop.description) if val), ident + " ") + "\n\n")
fw(", ".join(val for val in (prop.name, prop.description.replace("\n", "")) if val) + "\n")
# Special exception, can't use generic code here for enums.
if enum_text:
write_indented_lines(ident + " ", fw, enum_text)
fw("\n")
write_indented_lines(ident + " ", fw, enum_text)
del enum_text
# end enum exception

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

@@ -25,7 +25,8 @@ set(MANTAVERSION "0.13")
add_definitions(-DWITH_FLUID=1)
# Compile Mantaflow dependencies too (e.g. cnpy for numpy file IO).
# Make sure that dependencies exist before enabling this option by updating the source files in extern/
# Make sure that dependencies exist before enabling this option
# by updating the source files in `extern/`.
set(WITH_MANTA_DEPENDENCIES 0)
# Enable Mantaflow numpy support

View File

@@ -263,8 +263,7 @@ if(WITH_CYCLES_DEVICE_OPTIX)
${OPTIX_INCLUDE_DIR}
)
else()
message(STATUS "OptiX not found, disabling it from Cycles")
set(WITH_CYCLES_DEVICE_OPTIX OFF)
set_and_warn_library_found("OptiX" OPTIX_FOUND WITH_CYCLES_DEVICE_OPTIX)
endif()
endif()
@@ -387,8 +386,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_C_COMPILER_ID MATCHES "Clang")
endif()
if(WITH_CYCLES_HYDRA_RENDER_DELEGATE AND (NOT WITH_USD))
message(STATUS "USD not found, disabling WITH_CYCLES_HYDRA_RENDER_DELEGATE")
set(WITH_CYCLES_HYDRA_RENDER_DELEGATE OFF)
set_and_warn_library_found("USD" WITH_USD WITH_CYCLES_HYDRA_RENDER_DELEGATE)
endif()
if(WITH_CYCLES_HYDRA_RENDER_DELEGATE AND (NOT WITH_BLENDER) AND (NOT WITH_CYCLES_STANDALONE))
set(CYCLES_INSTALL_PATH ${CYCLES_INSTALL_PATH}/hdCycles/resources)

View File

@@ -43,7 +43,10 @@ else()
endif()
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
list(APPEND INC_SYS ${Epoxy_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS})
list(APPEND INC_SYS
${Epoxy_INCLUDE_DIRS}
${SDL2_INCLUDE_DIRS}
)
list(APPEND LIB ${Epoxy_LIBRARIES} ${SDL2_LIBRARIES})
endif()

View File

@@ -209,22 +209,25 @@ def list_render_passes(scene, srl):
yield ("Debug Sample Count", "X", 'VALUE')
# Cryptomatte passes.
crypto_depth = (srl.pass_cryptomatte_depth + 1) // 2
# NOTE: Name channels are lowercase RGBA so that compression rules check in OpenEXR DWA code
# uses lossless compression. Reportedly this naming is the only one which works good from the
# interoperability point of view. Using XYZW naming is not portable.
crypto_depth = (min(16, srl.pass_cryptomatte_depth) + 1) // 2
if srl.use_pass_cryptomatte_object:
for i in range(0, crypto_depth):
yield ("CryptoObject" + '{:02d}'.format(i), "RGBA", 'COLOR')
yield ("CryptoObject" + '{:02d}'.format(i), "rgba", 'COLOR')
if srl.use_pass_cryptomatte_material:
for i in range(0, crypto_depth):
yield ("CryptoMaterial" + '{:02d}'.format(i), "RGBA", 'COLOR')
yield ("CryptoMaterial" + '{:02d}'.format(i), "rgba", 'COLOR')
if srl.use_pass_cryptomatte_asset:
for i in range(0, crypto_depth):
yield ("CryptoAsset" + '{:02d}'.format(i), "RGBA", 'COLOR')
yield ("CryptoAsset" + '{:02d}'.format(i), "rgba", 'COLOR')
# Denoising passes.
if scene.cycles.use_denoising and crl.use_denoising:
yield ("Noisy Image", "RGBA", 'COLOR')
if crl.use_pass_shadow_catcher:
yield ("Noisy Shadow Catcher", "RGBA", 'COLOR')
yield ("Noisy Shadow Catcher", "RGB", 'COLOR')
if crl.denoising_store_passes:
yield ("Denoising Normal", "XYZ", 'VECTOR')
yield ("Denoising Albedo", "RGB", 'COLOR')
@@ -232,6 +235,8 @@ def list_render_passes(scene, srl):
# Custom AOV passes.
for aov in srl.aovs:
if not aov.is_valid:
continue
if aov.type == 'VALUE':
yield (aov.name, "X", 'VALUE')
else:

View File

@@ -60,13 +60,14 @@ enum_filter_types = (
)
enum_panorama_types = (
('EQUIRECTANGULAR', "Equirectangular", "Render the scene with a spherical camera, also known as Lat Long panorama"),
('FISHEYE_EQUIDISTANT', "Fisheye Equidistant", "Ideal for fulldomes, ignore the sensor dimensions"),
('EQUIRECTANGULAR', "Equirectangular", "Spherical camera for environment maps, also known as Lat Long panorama", 0),
('EQUIANGULAR_CUBEMAP_FACE', "Equiangular Cubemap Face", "Single face of an equiangular cubemap", 5),
('MIRRORBALL', "Mirror Ball", "Mirror ball mapping for environment maps", 3),
('FISHEYE_EQUIDISTANT', "Fisheye Equidistant", "Ideal for fulldomes, ignore the sensor dimensions", 1),
('FISHEYE_EQUISOLID', "Fisheye Equisolid",
"Similar to most fisheye modern lens, takes sensor dimensions into consideration"),
('MIRRORBALL', "Mirror Ball", "Uses the mirror ball mapping"),
"Similar to most fisheye modern lens, takes sensor dimensions into consideration", 2),
('FISHEYE_LENS_POLYNOMIAL', "Fisheye Lens Polynomial",
"Defines the lens projection as polynomial to allow real world camera lenses to be mimicked"),
"Defines the lens projection as polynomial to allow real world camera lenses to be mimicked", 4),
)
enum_curve_shape = (
@@ -1636,11 +1637,13 @@ class CyclesPreferences(bpy.types.AddonPreferences):
col.label(text="and AMD driver version 22.10 or newer", icon='BLANK1')
elif device_type == 'ONEAPI':
import sys
col.label(text="Requires Intel GPU with Xe-HPG architecture", icon='BLANK1')
if sys.platform.startswith("win"):
col.label(text="Requires Intel GPU with Xe-HPG architecture", 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.23904 or newer", icon='BLANK1')
col.label(text="Requires Intel GPU with Xe-HPG architecture and", icon='BLANK1')
col.label(text=" - Linux driver version xx.xx.23904 or newer", icon='BLANK1')
col.label(text=" - oneAPI Level-Zero Loader", 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')
@@ -1651,6 +1654,7 @@ class CyclesPreferences(bpy.types.AddonPreferences):
box.prop(
device, "use", text=device.name
.replace('(TM)', unicodedata.lookup('TRADE MARK SIGN'))
.replace('(tm)', unicodedata.lookup('TRADE MARK SIGN'))
.replace('(R)', unicodedata.lookup('REGISTERED SIGN'))
.replace('(C)', unicodedata.lookup('COPYRIGHT SIGN'))
)

View File

@@ -150,6 +150,16 @@ def get_effective_preview_denoiser(context):
return 'OIDN'
def use_mnee(context):
# The MNEE kernel doesn't compile on macOS < 13.
if use_metal(context):
import platform
v, _, _ = platform.mac_ver()
if float(v) < 13.0:
return False
return True
class CYCLES_RENDER_PT_sampling(CyclesButtonsPanel, Panel):
bl_label = "Sampling"
@@ -1235,7 +1245,7 @@ class CYCLES_OBJECT_PT_shading_caustics(CyclesButtonsPanel, Panel):
@classmethod
def poll(cls, context):
return CyclesButtonsPanel.poll(context) and not use_metal(context) and context.object.type != 'LIGHT'
return CyclesButtonsPanel.poll(context) and use_mnee(context) and context.object.type != 'LIGHT'
def draw(self, context):
layout = self.layout
@@ -1449,7 +1459,7 @@ class CYCLES_LIGHT_PT_light(CyclesButtonsPanel, Panel):
sub.active = not (light.type == 'AREA' and clamp.is_portal)
sub.prop(clamp, "cast_shadow")
sub.prop(clamp, "use_multiple_importance_sampling", text="Multiple Importance")
if not use_metal(context):
if use_mnee(context):
sub.prop(clamp, "is_caustics_light", text="Shadow Caustics")
if light.type == 'AREA':

View File

@@ -232,7 +232,7 @@ static void export_pointcloud_motion(PointCloud *pointcloud,
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;
const float radius = b_attr_radius ? b_attr_radius->data[i].value() : 0.01f;
float3 P = co;
P.w = radius;
mP[i] = P;

View File

@@ -497,9 +497,9 @@ void BlenderSession::render_frame_finish()
session->full_buffer_written_cb = function_null;
/* The display driver is the source of drawing context for both drawing and possible graphics
* interop objects in the path trace. Once the frame is finished the OpenGL context might be
* freed form Blender side. Need to ensure that all GPU resources are freed prior to that
* point.
* interoperability objects in the path trace. Once the frame is finished the OpenGL context
* might be freed form Blender side. Need to ensure that all GPU resources are freed prior to
* that point.
* Ideally would only do this when OpenGL context is actually destroyed, but there is no way to
* know when this happens (at least in the code at the time when this comment was written).
* The penalty of re-creating resources on every frame is unlikely to be noticed. */

View File

@@ -575,68 +575,72 @@ void BlenderSync::sync_images()
/* Passes */
static PassType get_blender_pass_type(BL::RenderPass &b_pass)
static bool get_known_pass_type(BL::RenderPass &b_pass, PassType &type, PassMode &mode)
{
string name = b_pass.name();
#define MAP_PASS(passname, passtype) \
#define MAP_PASS(passname, passtype, noisy) \
if (name == passname) { \
return passtype; \
type = passtype; \
mode = (noisy) ? PassMode::NOISY : PassMode::DENOISED; \
return true; \
} \
((void)0)
/* NOTE: Keep in sync with defined names from DNA_scene_types.h */
/* NOTE: Keep in sync with defined names from engine.py */
MAP_PASS("Combined", PASS_COMBINED);
MAP_PASS("Noisy Image", PASS_COMBINED);
MAP_PASS("Combined", PASS_COMBINED, false);
MAP_PASS("Noisy Image", PASS_COMBINED, true);
MAP_PASS("Depth", PASS_DEPTH);
MAP_PASS("Mist", PASS_MIST);
MAP_PASS("Position", PASS_POSITION);
MAP_PASS("Normal", PASS_NORMAL);
MAP_PASS("IndexOB", PASS_OBJECT_ID);
MAP_PASS("UV", PASS_UV);
MAP_PASS("Vector", PASS_MOTION);
MAP_PASS("IndexMA", PASS_MATERIAL_ID);
MAP_PASS("Depth", PASS_DEPTH, false);
MAP_PASS("Mist", PASS_MIST, false);
MAP_PASS("Position", PASS_POSITION, false);
MAP_PASS("Normal", PASS_NORMAL, false);
MAP_PASS("IndexOB", PASS_OBJECT_ID, false);
MAP_PASS("UV", PASS_UV, false);
MAP_PASS("Vector", PASS_MOTION, false);
MAP_PASS("IndexMA", PASS_MATERIAL_ID, false);
MAP_PASS("DiffDir", PASS_DIFFUSE_DIRECT);
MAP_PASS("GlossDir", PASS_GLOSSY_DIRECT);
MAP_PASS("TransDir", PASS_TRANSMISSION_DIRECT);
MAP_PASS("VolumeDir", PASS_VOLUME_DIRECT);
MAP_PASS("DiffDir", PASS_DIFFUSE_DIRECT, false);
MAP_PASS("GlossDir", PASS_GLOSSY_DIRECT, false);
MAP_PASS("TransDir", PASS_TRANSMISSION_DIRECT, false);
MAP_PASS("VolumeDir", PASS_VOLUME_DIRECT, false);
MAP_PASS("DiffInd", PASS_DIFFUSE_INDIRECT);
MAP_PASS("GlossInd", PASS_GLOSSY_INDIRECT);
MAP_PASS("TransInd", PASS_TRANSMISSION_INDIRECT);
MAP_PASS("VolumeInd", PASS_VOLUME_INDIRECT);
MAP_PASS("DiffInd", PASS_DIFFUSE_INDIRECT, false);
MAP_PASS("GlossInd", PASS_GLOSSY_INDIRECT, false);
MAP_PASS("TransInd", PASS_TRANSMISSION_INDIRECT, false);
MAP_PASS("VolumeInd", PASS_VOLUME_INDIRECT, false);
MAP_PASS("DiffCol", PASS_DIFFUSE_COLOR);
MAP_PASS("GlossCol", PASS_GLOSSY_COLOR);
MAP_PASS("TransCol", PASS_TRANSMISSION_COLOR);
MAP_PASS("DiffCol", PASS_DIFFUSE_COLOR, false);
MAP_PASS("GlossCol", PASS_GLOSSY_COLOR, false);
MAP_PASS("TransCol", PASS_TRANSMISSION_COLOR, false);
MAP_PASS("Emit", PASS_EMISSION);
MAP_PASS("Env", PASS_BACKGROUND);
MAP_PASS("AO", PASS_AO);
MAP_PASS("Shadow", PASS_SHADOW);
MAP_PASS("Emit", PASS_EMISSION, false);
MAP_PASS("Env", PASS_BACKGROUND, false);
MAP_PASS("AO", PASS_AO, false);
MAP_PASS("Shadow", PASS_SHADOW, false);
MAP_PASS("BakePrimitive", PASS_BAKE_PRIMITIVE);
MAP_PASS("BakeDifferential", PASS_BAKE_DIFFERENTIAL);
MAP_PASS("BakePrimitive", PASS_BAKE_PRIMITIVE, false);
MAP_PASS("BakeDifferential", PASS_BAKE_DIFFERENTIAL, false);
MAP_PASS("Denoising Normal", PASS_DENOISING_NORMAL);
MAP_PASS("Denoising Albedo", PASS_DENOISING_ALBEDO);
MAP_PASS("Denoising Depth", PASS_DENOISING_DEPTH);
MAP_PASS("Denoising Normal", PASS_DENOISING_NORMAL, true);
MAP_PASS("Denoising Albedo", PASS_DENOISING_ALBEDO, true);
MAP_PASS("Denoising Depth", PASS_DENOISING_DEPTH, true);
MAP_PASS("Shadow Catcher", PASS_SHADOW_CATCHER);
MAP_PASS("Noisy Shadow Catcher", PASS_SHADOW_CATCHER);
MAP_PASS("Shadow Catcher", PASS_SHADOW_CATCHER, false);
MAP_PASS("Noisy Shadow Catcher", PASS_SHADOW_CATCHER, true);
MAP_PASS("AdaptiveAuxBuffer", PASS_ADAPTIVE_AUX_BUFFER);
MAP_PASS("Debug Sample Count", PASS_SAMPLE_COUNT);
MAP_PASS("AdaptiveAuxBuffer", PASS_ADAPTIVE_AUX_BUFFER, false);
MAP_PASS("Debug Sample Count", PASS_SAMPLE_COUNT, false);
if (string_startswith(name, cryptomatte_prefix)) {
return PASS_CRYPTOMATTE;
type = PASS_CRYPTOMATTE;
mode = PassMode::DENOISED;
return true;
}
#undef MAP_PASS
return PASS_NONE;
return false;
}
static Pass *pass_add(Scene *scene,
@@ -655,8 +659,6 @@ static Pass *pass_add(Scene *scene,
void BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, BL::ViewLayer &b_view_layer)
{
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
/* Delete all existing passes. */
set<Pass *> clear_passes(scene->passes.begin(), scene->passes.end());
scene->delete_nodes(clear_passes);
@@ -664,103 +666,23 @@ void BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, BL::ViewLayer &b_v
/* Always add combined pass. */
pass_add(scene, PASS_COMBINED, "Combined");
/* Blender built-in data and light passes. */
for (BL::RenderPass &b_pass : b_rlay.passes) {
const PassType pass_type = get_blender_pass_type(b_pass);
if (pass_type == PASS_NONE) {
LOG(ERROR) << "Unknown pass " << b_pass.name();
continue;
}
if (pass_type == PASS_MOTION &&
(b_view_layer.use_motion_blur() && b_scene.render().use_motion_blur())) {
continue;
}
pass_add(scene, pass_type, b_pass.name().c_str());
}
PointerRNA crl = RNA_pointer_get(&b_view_layer.ptr, "cycles");
/* Debug passes. */
if (get_boolean(crl, "pass_debug_sample_count")) {
b_engine.add_pass("Debug Sample Count", 1, "X", b_view_layer.name().c_str());
pass_add(scene, PASS_SAMPLE_COUNT, "Debug Sample Count");
}
/* Cycles specific passes. */
if (get_boolean(crl, "use_pass_volume_direct")) {
b_engine.add_pass("VolumeDir", 3, "RGB", b_view_layer.name().c_str());
pass_add(scene, PASS_VOLUME_DIRECT, "VolumeDir");
}
if (get_boolean(crl, "use_pass_volume_indirect")) {
b_engine.add_pass("VolumeInd", 3, "RGB", b_view_layer.name().c_str());
pass_add(scene, PASS_VOLUME_INDIRECT, "VolumeInd");
}
if (get_boolean(crl, "use_pass_shadow_catcher")) {
b_engine.add_pass("Shadow Catcher", 3, "RGB", b_view_layer.name().c_str());
pass_add(scene, PASS_SHADOW_CATCHER, "Shadow Catcher");
}
/* Cryptomatte stores two ID/weight pairs per RGBA layer.
* User facing parameter is the number of pairs.
*
* NOTE: Name channels lowercase RGBA so that compression rules check in OpenEXR DWA code uses
* lossless compression. Reportedly this naming is the only one which works good from the
* interoperability point of view. Using XYZW naming is not portable. */
* User facing parameter is the number of pairs. */
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());
pass_add(scene, PASS_CRYPTOMATTE, passname.c_str());
}
cryptomatte_passes = (CryptomatteType)(cryptomatte_passes | CRYPT_OBJECT);
}
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());
pass_add(scene, PASS_CRYPTOMATTE, passname.c_str());
}
cryptomatte_passes = (CryptomatteType)(cryptomatte_passes | CRYPT_MATERIAL);
}
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());
pass_add(scene, PASS_CRYPTOMATTE, passname.c_str());
}
cryptomatte_passes = (CryptomatteType)(cryptomatte_passes | CRYPT_ASSET);
}
scene->film->set_cryptomatte_passes(cryptomatte_passes);
/* Denoising passes. */
const bool use_denoising = get_boolean(cscene, "use_denoising") &&
get_boolean(crl, "use_denoising");
const bool store_denoising_passes = get_boolean(crl, "denoising_store_passes");
if (use_denoising) {
b_engine.add_pass("Noisy Image", 4, "RGBA", b_view_layer.name().c_str());
pass_add(scene, PASS_COMBINED, "Noisy Image", PassMode::NOISY);
if (get_boolean(crl, "use_pass_shadow_catcher")) {
b_engine.add_pass("Noisy Shadow Catcher", 3, "RGB", b_view_layer.name().c_str());
pass_add(scene, PASS_SHADOW_CATCHER, "Noisy Shadow Catcher", PassMode::NOISY);
}
}
if (store_denoising_passes) {
b_engine.add_pass("Denoising Normal", 3, "XYZ", b_view_layer.name().c_str());
pass_add(scene, PASS_DENOISING_NORMAL, "Denoising Normal", PassMode::NOISY);
b_engine.add_pass("Denoising Albedo", 3, "RGB", b_view_layer.name().c_str());
pass_add(scene, PASS_DENOISING_ALBEDO, "Denoising Albedo", PassMode::NOISY);
b_engine.add_pass("Denoising Depth", 1, "Z", b_view_layer.name().c_str());
pass_add(scene, PASS_DENOISING_DEPTH, "Denoising Depth", PassMode::NOISY);
}
/* Path guiding debug passes. */
#ifdef WITH_CYCLES_DEBUG
b_engine.add_pass("Guiding Color", 3, "RGB", b_view_layer.name().c_str());
pass_add(scene, PASS_GUIDING_COLOR, "Guiding Color", PassMode::NOISY);
@@ -772,6 +694,8 @@ void BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, BL::ViewLayer &b_v
pass_add(scene, PASS_GUIDING_AVG_ROUGHNESS, "Guiding Average Roughness", PassMode::NOISY);
#endif
unordered_set<string> expected_passes;
/* Custom AOV passes. */
BL::ViewLayer::aovs_iterator b_aov_iter;
for (b_view_layer.aovs.begin(b_aov_iter); b_aov_iter != b_view_layer.aovs.end(); ++b_aov_iter) {
@@ -781,16 +705,10 @@ void BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, BL::ViewLayer &b_v
}
string name = b_aov.name();
bool is_color = b_aov.type() == BL::AOV::type_COLOR;
PassType type = (b_aov.type() == BL::AOV::type_COLOR) ? PASS_AOV_COLOR : PASS_AOV_VALUE;
if (is_color) {
b_engine.add_pass(name.c_str(), 4, "RGBA", b_view_layer.name().c_str());
pass_add(scene, PASS_AOV_COLOR, name.c_str());
}
else {
b_engine.add_pass(name.c_str(), 1, "X", b_view_layer.name().c_str());
pass_add(scene, PASS_AOV_VALUE, name.c_str());
}
pass_add(scene, type, name.c_str());
expected_passes.insert(name);
}
/* Light Group passes. */
@@ -802,9 +720,29 @@ void BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, BL::ViewLayer &b_v
string name = string_printf("Combined_%s", b_lightgroup.name().c_str());
b_engine.add_pass(name.c_str(), 3, "RGB", b_view_layer.name().c_str());
Pass *pass = pass_add(scene, PASS_COMBINED, name.c_str(), PassMode::NOISY);
pass->set_lightgroup(ustring(b_lightgroup.name()));
expected_passes.insert(name);
}
/* Sync the passes that were defined in engine.py. */
for (BL::RenderPass &b_pass : b_rlay.passes) {
PassType pass_type = PASS_NONE;
PassMode pass_mode = PassMode::DENOISED;
if (!get_known_pass_type(b_pass, pass_type, pass_mode)) {
if (!expected_passes.count(b_pass.name())) {
LOG(ERROR) << "Unknown pass " << b_pass.name();
}
continue;
}
if (pass_type == PASS_MOTION &&
(b_view_layer.use_motion_blur() && b_scene.render().use_motion_blur())) {
continue;
}
pass_add(scene, pass_type, b_pass.name().c_str(), pass_mode);
}
scene->film->set_pass_alpha_threshold(b_view_layer.pass_alpha_threshold());

View File

@@ -289,8 +289,7 @@ if(CYCLES_STANDALONE_REPOSITORY AND WITH_CYCLES_PATH_GUIDING)
endif()
get_target_property(OPENPGL_INCLUDE_DIR openpgl::openpgl INTERFACE_INCLUDE_DIRECTORIES)
else()
set(WITH_CYCLES_PATH_GUIDING OFF)
message(STATUS "OpenPGL not found, disabling WITH_CYCLES_PATH_GUIDING")
set_and_warn_library_found("OpenPGL" openpgl_FOUND WITH_CYCLES_PATH_GUIDING)
endif()
endif()
@@ -588,16 +587,14 @@ if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
# We can't use the version from the Blender precompiled libraries because
# it does not include the video subsystem.
find_package(SDL2 REQUIRED)
set_and_warn_library_found("SDL" SDL2_FOUND WITH_CYCLES_STANDALONE_GUI)
if(NOT SDL2_FOUND)
set(WITH_CYCLES_STANDALONE_GUI OFF)
message(STATUS "SDL not found, disabling Cycles standalone GUI")
if(SDL2_FOUND)
include_directories(
SYSTEM
${SDL2_INCLUDE_DIRS}
)
endif()
include_directories(
SYSTEM
${SDL2_INCLUDE_DIRS}
)
endif()
###########################################################################
@@ -606,11 +603,11 @@ endif()
if(WITH_CYCLES_DEVICE_CUDA AND (WITH_CYCLES_CUDA_BINARIES OR NOT WITH_CUDA_DYNLOAD))
find_package(CUDA) # Try to auto locate CUDA toolkit
set_and_warn_library_found("CUDA compiler" CUDA_FOUND WITH_CYCLES_CUDA_BINARIES)
if(CUDA_FOUND)
message(STATUS "Found CUDA ${CUDA_NVCC_EXECUTABLE} (${CUDA_VERSION})")
else()
message(STATUS "CUDA compiler not found, disabling WITH_CYCLES_CUDA_BINARIES")
set(WITH_CYCLES_CUDA_BINARIES OFF)
if(NOT WITH_CUDA_DYNLOAD)
message(STATUS "Additionally falling back to dynamic CUDA load")
set(WITH_CUDA_DYNLOAD ON)
@@ -624,11 +621,10 @@ endif()
if(WITH_CYCLES_HIP_BINARIES AND WITH_CYCLES_DEVICE_HIP)
find_package(HIP)
set_and_warn_library_found("HIP compiler" HIP_FOUND WITH_CYCLES_HIP_BINARIES)
if(HIP_FOUND)
message(STATUS "Found HIP ${HIP_HIPCC_EXECUTABLE} (${HIP_VERSION})")
else()
message(STATUS "HIP compiler not found, disabling WITH_CYCLES_HIP_BINARIES")
set(WITH_CYCLES_HIP_BINARIES OFF)
endif()
endif()
@@ -644,13 +640,17 @@ if(WITH_CYCLES_DEVICE_METAL)
find_library(METAL_LIBRARY Metal)
# This file was added in the 12.0 SDK, use it as a way to detect the version.
if(METAL_LIBRARY AND NOT EXISTS "${METAL_LIBRARY}/Headers/MTLFunctionStitching.h")
message(STATUS "Metal version too old, must be SDK 12.0 or newer, disabling WITH_CYCLES_DEVICE_METAL")
set(WITH_CYCLES_DEVICE_METAL OFF)
elseif(NOT METAL_LIBRARY)
message(STATUS "Metal not found, disabling WITH_CYCLES_DEVICE_METAL")
set(WITH_CYCLES_DEVICE_METAL OFF)
else()
if(METAL_LIBRARY)
if(EXISTS "${METAL_LIBRARY}/Headers/MTLFunctionStitching.h")
set(METAL_FOUND ON)
else()
message(STATUS "Metal version too old, must be SDK 12.0 or newer")
set(METAL_FOUND OFF)
endif()
endif()
set_and_warn_library_found("Metal" METAL_FOUND WITH_CYCLES_DEVICE_METAL)
if(METAL_FOUND)
message(STATUS "Found Metal: ${METAL_LIBRARY}")
endif()
endif()
@@ -662,9 +662,10 @@ endif()
if(WITH_CYCLES_DEVICE_ONEAPI)
find_package(SYCL)
find_package(LevelZero)
set_and_warn_library_found("oneAPI" SYCL_FOUND WITH_CYCLES_DEVICE_ONEAPI)
set_and_warn_library_found("Level Zero" LEVEL_ZERO_FOUND WITH_CYCLES_DEVICE_ONEAPI)
if(SYCL_FOUND AND LEVEL_ZERO_FOUND)
message(STATUS "Found oneAPI: ${SYCL_LIBRARY}")
if(SYCL_FOUND AND SYCL_VERSION VERSION_GREATER_EQUAL 6.0 AND LEVEL_ZERO_FOUND)
message(STATUS "Found Level Zero: ${LEVEL_ZERO_LIBRARY}")
if(WITH_CYCLES_ONEAPI_BINARIES)
@@ -675,13 +676,14 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
endif()
if(NOT EXISTS ${OCLOC_INSTALL_DIR})
message(STATUS "oneAPI ocloc not found in ${OCLOC_INSTALL_DIR}, disabling WITH_CYCLES_ONEAPI_BINARIES."
set(OCLOC_FOUND OFF)
message(STATUS "oneAPI ocloc not found in ${OCLOC_INSTALL_DIR}."
" A different ocloc directory can be set using OCLOC_INSTALL_DIR cmake variable.")
set(WITH_CYCLES_ONEAPI_BINARIES OFF)
set_and_warn_library_found("ocloc" OCLOC_FOUND WITH_CYCLES_ONEAPI_BINARIES)
endif()
endif()
else()
message(STATUS "oneAPI or Level Zero not found, disabling WITH_CYCLES_DEVICE_ONEAPI")
message(STATUS "SYCL 6.0+ or Level Zero not found, disabling WITH_CYCLES_DEVICE_ONEAPI")
set(WITH_CYCLES_DEVICE_ONEAPI OFF)
endif()
endif()

View File

@@ -187,18 +187,22 @@ if(WITH_CYCLES_DEVICE_METAL)
)
endif()
if (WITH_CYCLES_DEVICE_ONEAPI)
if(WIN32)
set(cycles_kernel_oneapi_lib ${CMAKE_CURRENT_BINARY_DIR}/../kernel/cycles_kernel_oneapi.lib)
if(WITH_CYCLES_ONEAPI_BINARIES)
set(cycles_kernel_oneapi_lib_suffix "_aot")
else()
set(cycles_kernel_oneapi_lib ${CMAKE_CURRENT_BINARY_DIR}/../kernel/libcycles_kernel_oneapi.so)
set(cycles_kernel_oneapi_lib_suffix "_jit")
endif()
if(WIN32)
set(cycles_kernel_oneapi_lib ${CMAKE_CURRENT_BINARY_DIR}/../kernel/cycles_kernel_oneapi${cycles_kernel_oneapi_lib_suffix}.lib)
else()
set(cycles_kernel_oneapi_lib ${CMAKE_CURRENT_BINARY_DIR}/../kernel/libcycles_kernel_oneapi${cycles_kernel_oneapi_lib_suffix}.so)
endif()
list(APPEND LIB ${cycles_kernel_oneapi_lib})
if(WIN32)
list(APPEND LIB debug ${SYCL_LIBRARY_DEBUG} optimized ${SYCL_LIBRARY})
else()
list(APPEND LIB ${SYCL_LIBRARY})
endif()
list(APPEND LIB
${cycles_kernel_oneapi_lib}
"$<$<CONFIG:Debug>:${SYCL_LIBRARY_DEBUG}>"
"$<$<CONFIG:Release>:${SYCL_LIBRARY}>"
"$<$<CONFIG:RelWithDebInfo>:${SYCL_LIBRARY}>"
"$<$<CONFIG:MinSizeRel>:${SYCL_LIBRARY}>"
)
add_definitions(-DWITH_ONEAPI)
list(APPEND SRC
${SRC_ONEAPI}
@@ -220,7 +224,8 @@ include_directories(SYSTEM ${INC_SYS})
cycles_add_library(cycles_device "${LIB}" ${SRC})
if(WITH_CYCLES_DEVICE_ONEAPI)
# Need to have proper rebuilding in case of changes in cycles_kernel_oneapi due external project behaviour
# Need to have proper rebuilding in case of changes
# in cycles_kernel_oneapi due external project behavior.
add_dependencies(cycles_device cycles_kernel_oneapi)
endif()

View File

@@ -49,7 +49,7 @@ int CUDADeviceQueue::num_concurrent_states(const size_t state_size) const
return num_states;
}
int CUDADeviceQueue::num_concurrent_busy_states() const
int CUDADeviceQueue::num_concurrent_busy_states(const size_t /*state_size*/) const
{
const int max_num_threads = cuda_device_->get_num_multiprocessors() *
cuda_device_->get_max_num_threads_per_multiprocessor();

View File

@@ -23,7 +23,7 @@ class CUDADeviceQueue : public DeviceQueue {
~CUDADeviceQueue();
virtual int num_concurrent_states(const size_t state_size) const override;
virtual int num_concurrent_busy_states() const override;
virtual int num_concurrent_busy_states(const size_t state_size) const override;
virtual void init_execution() override;

View File

@@ -49,7 +49,7 @@ int HIPDeviceQueue::num_concurrent_states(const size_t state_size) const
return num_states;
}
int HIPDeviceQueue::num_concurrent_busy_states() const
int HIPDeviceQueue::num_concurrent_busy_states(const size_t /*state_size*/) const
{
const int max_num_threads = hip_device_->get_num_multiprocessors() *
hip_device_->get_max_num_threads_per_multiprocessor();

View File

@@ -23,7 +23,7 @@ class HIPDeviceQueue : public DeviceQueue {
~HIPDeviceQueue();
virtual int num_concurrent_states(const size_t state_size) const override;
virtual int num_concurrent_busy_states() const override;
virtual int num_concurrent_busy_states(const size_t state_size) const override;
virtual void init_execution() override;

View File

@@ -296,9 +296,11 @@ void MetalDevice::make_source(MetalPipelineType pso_type, const uint kernel_feat
}
source = global_defines + source;
# if 0
metal_printf("================\n%s================\n\%s================\n",
global_defines.c_str(),
baked_constants.c_str());
# endif
/* Generate an MD5 from the source and include any baked constants. This is used when caching
* PSOs. */
@@ -339,6 +341,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

@@ -45,6 +45,36 @@ bool kernel_has_intersection(DeviceKernel device_kernel)
struct ShaderCache {
ShaderCache(id<MTLDevice> _mtlDevice) : mtlDevice(_mtlDevice)
{
/* Initialize occupancy tuning LUT. */
if (MetalInfo::get_device_vendor(mtlDevice) == METAL_GPU_APPLE) {
switch (MetalInfo::get_apple_gpu_architecture(mtlDevice)) {
default:
case APPLE_M2:
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_COMPACT_SHADOW_STATES] = {32, 32};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_INIT_FROM_CAMERA] = {832, 32};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST] = {64, 64};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_INTERSECT_SHADOW] = {64, 64};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_INTERSECT_SUBSURFACE] = {704, 32};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_QUEUED_PATHS_ARRAY] = {1024, 256};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_SHADE_BACKGROUND] = {64, 32};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW] = {256, 256};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE] = {448, 384};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_SORTED_PATHS_ARRAY] = {1024, 1024};
break;
case APPLE_M1:
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_COMPACT_SHADOW_STATES] = {256, 128};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_INIT_FROM_CAMERA] = {768, 32};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST] = {512, 128};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_INTERSECT_SHADOW] = {384, 128};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_INTERSECT_SUBSURFACE] = {512, 64};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_QUEUED_PATHS_ARRAY] = {512, 256};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_SHADE_BACKGROUND] = {512, 128};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW] = {384, 32};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE] = {576, 384};
occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_SORTED_PATHS_ARRAY] = {832, 832};
break;
}
}
}
~ShaderCache();
@@ -73,6 +103,11 @@ struct ShaderCache {
std::function<void(MetalKernelPipeline *)> completionHandler;
};
struct OccupancyTuningParameters {
int threads_per_threadgroup = 0;
int num_threads_per_block = 0;
} occupancy_tuning[DEVICE_KERNEL_NUM];
std::mutex cache_mutex;
PipelineCollection pipelines[DEVICE_KERNEL_NUM];
@@ -162,6 +197,13 @@ bool ShaderCache::should_load_kernel(DeviceKernel device_kernel,
}
}
if (device_kernel == DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_MNEE) {
if ((device->kernel_features & KERNEL_FEATURE_MNEE) == 0) {
/* Skip shade_surface_mnee kernel if the scene doesn't require it. */
return false;
}
}
if (pso_type != PSO_GENERIC) {
/* Only specialize kernels where it can make an impact. */
if (device_kernel < DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST ||
@@ -223,6 +265,13 @@ void ShaderCache::load_kernel(DeviceKernel device_kernel,
request.pipeline->device_kernel = device_kernel;
request.pipeline->threads_per_threadgroup = device->max_threads_per_threadgroup;
if (occupancy_tuning[device_kernel].threads_per_threadgroup) {
request.pipeline->threads_per_threadgroup =
occupancy_tuning[device_kernel].threads_per_threadgroup;
request.pipeline->num_threads_per_block =
occupancy_tuning[device_kernel].num_threads_per_block;
}
/* metalrt options */
request.pipeline->use_metalrt = device->use_metalrt;
request.pipeline->metalrt_hair = device->use_metalrt &&
@@ -317,6 +366,12 @@ bool MetalKernelPipeline::should_use_binary_archive() const
}
}
/* 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;
@@ -361,13 +416,6 @@ void MetalKernelPipeline::compile()
const std::string function_name = std::string("cycles_metal_") +
device_kernel_as_string(device_kernel);
int threads_per_threadgroup = this->threads_per_threadgroup;
if (device_kernel > DEVICE_KERNEL_INTEGRATOR_MEGAKERNEL &&
device_kernel < DEVICE_KERNEL_INTEGRATOR_RESET) {
/* Always use 512 for the sorting kernels */
threads_per_threadgroup = 512;
}
NSString *entryPoint = [@(function_name.c_str()) copy];
NSError *error = NULL;
@@ -631,12 +679,14 @@ void MetalKernelPipeline::compile()
return;
}
int num_threads_per_block = round_down(computePipelineState.maxTotalThreadsPerThreadgroup,
computePipelineState.threadExecutionWidth);
num_threads_per_block = std::max(num_threads_per_block,
(int)computePipelineState.threadExecutionWidth);
if (!num_threads_per_block) {
num_threads_per_block = round_down(computePipelineState.maxTotalThreadsPerThreadgroup,
computePipelineState.threadExecutionWidth);
num_threads_per_block = std::max(num_threads_per_block,
(int)computePipelineState.threadExecutionWidth);
}
this->pipeline = computePipelineState;
this->num_threads_per_block = num_threads_per_block;
if (@available(macOS 11.0, *)) {
if (creating_new_archive || recreate_archive) {

View File

@@ -23,7 +23,7 @@ class MetalDeviceQueue : public DeviceQueue {
~MetalDeviceQueue();
virtual int num_concurrent_states(const size_t) const override;
virtual int num_concurrent_busy_states() const override;
virtual int num_concurrent_busy_states(const size_t) const override;
virtual int num_sort_partition_elements() const override;
virtual void init_execution() override;

View File

@@ -264,33 +264,46 @@ MetalDeviceQueue::~MetalDeviceQueue()
}
}
int MetalDeviceQueue::num_concurrent_states(const size_t /*state_size*/) const
int MetalDeviceQueue::num_concurrent_states(const size_t state_size) const
{
/* METAL_WIP */
/* TODO: compute automatically. */
/* TODO: must have at least num_threads_per_block. */
int result = 1048576;
if (metal_device_->device_vendor == METAL_GPU_AMD) {
result *= 2;
static int result = 0;
if (result) {
return result;
}
else if (metal_device_->device_vendor == METAL_GPU_APPLE) {
result = 1048576;
if (metal_device_->device_vendor == METAL_GPU_APPLE) {
result *= 4;
if (MetalInfo::get_apple_gpu_architecture(metal_device_->mtlDevice) == APPLE_M2) {
size_t system_ram = system_physical_ram();
size_t allocated_so_far = [metal_device_->mtlDevice currentAllocatedSize];
size_t max_recommended_working_set = [metal_device_->mtlDevice recommendedMaxWorkingSetSize];
/* Determine whether we can double the state count, and leave enough GPU-available memory
* (1/8 the system RAM or 1GB - whichever is largest). Enlarging the state size allows us to
* keep dispatch sizes high and minimize work submission overheads. */
size_t min_headroom = std::max(system_ram / 8, size_t(1024 * 1024 * 1024));
size_t total_state_size = result * state_size;
if (max_recommended_working_set - allocated_so_far - total_state_size * 2 >= min_headroom) {
result *= 2;
metal_printf("Doubling state count to exploit available RAM (new size = %d)\n", result);
}
}
}
else if (metal_device_->device_vendor == METAL_GPU_AMD) {
/* METAL_WIP */
/* TODO: compute automatically. */
/* TODO: must have at least num_threads_per_block. */
result *= 2;
}
return result;
}
int MetalDeviceQueue::num_concurrent_busy_states() const
int MetalDeviceQueue::num_concurrent_busy_states(const size_t state_size) const
{
/* METAL_WIP */
/* TODO: compute automatically. */
int result = 65536;
if (metal_device_->device_vendor == METAL_GPU_AMD) {
result *= 2;
}
else if (metal_device_->device_vendor == METAL_GPU_APPLE) {
result *= 4;
}
return result;
/* A 1:4 busy:total ratio gives best rendering performance, independent of total state count. */
return num_concurrent_states(state_size) / 4;
}
int MetalDeviceQueue::num_sort_partition_elements() const

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

@@ -39,7 +39,7 @@ bool device_oneapi_init()
_putenv_s("SYCL_CACHE_THRESHOLD", "0");
}
if (getenv("SYCL_DEVICE_FILTER") == nullptr) {
_putenv_s("SYCL_DEVICE_FILTER", "host,level_zero");
_putenv_s("SYCL_DEVICE_FILTER", "level_zero");
}
if (getenv("SYCL_ENABLE_PCI") == nullptr) {
_putenv_s("SYCL_ENABLE_PCI", "1");
@@ -50,7 +50,7 @@ bool device_oneapi_init()
# elif __linux__
setenv("SYCL_CACHE_PERSISTENT", "1", false);
setenv("SYCL_CACHE_THRESHOLD", "0", false);
setenv("SYCL_DEVICE_FILTER", "host,level_zero", false);
setenv("SYCL_DEVICE_FILTER", "level_zero", false);
setenv("SYCL_ENABLE_PCI", "1", false);
setenv("SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE_FOR_IN_ORDER_QUEUE", "0", false);
# endif

View File

@@ -430,9 +430,9 @@ void OneapiDevice::check_usm(SyclQueue *queue_, const void *usm_ptr, bool allow_
sycl::usm::alloc usm_type = get_pointer_type(usm_ptr, queue->get_context());
(void)usm_type;
assert(usm_type == sycl::usm::alloc::device ||
((device_type == sycl::info::device_type::host ||
device_type == sycl::info::device_type::cpu || allow_host) &&
usm_type == sycl::usm::alloc::host));
((device_type == sycl::info::device_type::cpu || allow_host) &&
usm_type == sycl::usm::alloc::host ||
usm_type == sycl::usm::alloc::unknown));
# else
/* Silence warning about unused arguments. */
(void)queue_;
@@ -668,16 +668,9 @@ int OneapiDevice::parse_driver_build_version(const sycl::device &device)
std::vector<sycl::device> OneapiDevice::available_devices()
{
bool allow_all_devices = false;
if (getenv("CYCLES_ONEAPI_ALL_DEVICES") != nullptr)
if (getenv("CYCLES_ONEAPI_ALL_DEVICES") != nullptr) {
allow_all_devices = true;
/* Host device is useful only for debugging at the moment
* so we hide this device with default build settings. */
# ifdef WITH_ONEAPI_SYCL_HOST_ENABLED
bool allow_host = true;
# else
bool allow_host = false;
# endif
}
const std::vector<sycl::platform> &oneapi_platforms = sycl::platform::get_platforms();
@@ -690,33 +683,28 @@ std::vector<sycl::device> OneapiDevice::available_devices()
}
const std::vector<sycl::device> &oneapi_devices =
(allow_all_devices || allow_host) ? platform.get_devices(sycl::info::device_type::all) :
platform.get_devices(sycl::info::device_type::gpu);
(allow_all_devices) ? platform.get_devices(sycl::info::device_type::all) :
platform.get_devices(sycl::info::device_type::gpu);
for (const sycl::device &device : oneapi_devices) {
if (allow_all_devices) {
/* still filter out host device if build doesn't support it. */
if (allow_host || !device.is_host()) {
available_devices.push_back(device);
}
}
else {
bool filter_out = false;
bool filter_out = false;
if (!allow_all_devices) {
/* For now we support all Intel(R) Arc(TM) devices and likely any future GPU,
* assuming they have either more than 96 Execution Units or not 7 threads per EU.
* Official support can be broaden to older and smaller GPUs once ready. */
if (device.is_gpu() && platform.get_backend() == sycl::backend::ext_oneapi_level_zero) {
/* Filtered-out defaults in-case these values aren't available through too old L0
* runtime. */
if (!device.is_gpu() || platform.get_backend() != sycl::backend::ext_oneapi_level_zero) {
filter_out = true;
}
else {
/* Filtered-out defaults in-case these values aren't available. */
int number_of_eus = 96;
int threads_per_eu = 7;
if (device.has(sycl::aspect::ext_intel_gpu_eu_count)) {
number_of_eus = device.get_info<sycl::info::device::ext_intel_gpu_eu_count>();
number_of_eus = device.get_info<sycl::ext::intel::info::device::gpu_eu_count>();
}
if (device.has(sycl::aspect::ext_intel_gpu_hw_threads_per_eu)) {
threads_per_eu =
device.get_info<sycl::info::device::ext_intel_gpu_hw_threads_per_eu>();
device.get_info<sycl::ext::intel::info::device::gpu_hw_threads_per_eu>();
}
/* This filters out all Level-Zero supported GPUs from older generation than Arc. */
if (number_of_eus <= 96 && threads_per_eu == 7) {
@@ -732,16 +720,9 @@ std::vector<sycl::device> OneapiDevice::available_devices()
}
}
}
else if (!allow_host && device.is_host()) {
filter_out = true;
}
else if (!allow_all_devices) {
filter_out = true;
}
if (!filter_out) {
available_devices.push_back(device);
}
}
if (!filter_out) {
available_devices.push_back(device);
}
}
}
@@ -797,9 +778,7 @@ char *OneapiDevice::device_capabilities()
GET_NUM_ATTR(native_vector_width_double)
GET_NUM_ATTR(native_vector_width_half)
size_t max_clock_frequency =
(size_t)(device.is_host() ? (size_t)0 :
device.get_info<sycl::info::device::max_clock_frequency>());
size_t max_clock_frequency = device.get_info<sycl::info::device::max_clock_frequency>();
WRITE_ATTR("max_clock_frequency", max_clock_frequency)
GET_NUM_ATTR(address_bits)
@@ -837,7 +816,7 @@ void OneapiDevice::iterate_devices(OneAPIDeviceIteratorCallback cb, void *user_p
std::string name = device.get_info<sycl::info::device::name>();
std::string id = "ONEAPI_" + platform_name + "_" + name;
if (device.has(sycl::aspect::ext_intel_pci_address)) {
id.append("_" + device.get_info<sycl::info::device::ext_intel_pci_address>());
id.append("_" + device.get_info<sycl::ext::intel::info::device::pci_address>());
}
(cb)(id.c_str(), name.c_str(), num, user_ptr);
num++;
@@ -855,7 +834,7 @@ int OneapiDevice::get_num_multiprocessors()
{
const sycl::device &device = reinterpret_cast<sycl::queue *>(device_queue_)->get_device();
if (device.has(sycl::aspect::ext_intel_gpu_eu_count)) {
return device.get_info<sycl::info::device::ext_intel_gpu_eu_count>();
return device.get_info<sycl::ext::intel::info::device::gpu_eu_count>();
}
else
return 0;
@@ -866,8 +845,8 @@ int OneapiDevice::get_max_num_threads_per_multiprocessor()
const sycl::device &device = reinterpret_cast<sycl::queue *>(device_queue_)->get_device();
if (device.has(sycl::aspect::ext_intel_gpu_eu_simd_width) &&
device.has(sycl::aspect::ext_intel_gpu_hw_threads_per_eu)) {
return device.get_info<sycl::info::device::ext_intel_gpu_eu_simd_width>() *
device.get_info<sycl::info::device::ext_intel_gpu_hw_threads_per_eu>();
return device.get_info<sycl::ext::intel::info::device::gpu_eu_simd_width>() *
device.get_info<sycl::ext::intel::info::device::gpu_hw_threads_per_eu>();
}
else
return 0;

View File

@@ -3,7 +3,7 @@
#ifdef WITH_ONEAPI
# include <CL/sycl.hpp>
# include <sycl/sycl.hpp>
# include "device/device.h"
# include "device/oneapi/device.h"

View File

@@ -43,7 +43,7 @@ int OneapiDeviceQueue::num_concurrent_states(const size_t state_size) const
return num_states;
}
int OneapiDeviceQueue::num_concurrent_busy_states() const
int OneapiDeviceQueue::num_concurrent_busy_states(const size_t /*state_size*/) const
{
const int max_num_threads = oneapi_device_->get_num_multiprocessors() *
oneapi_device_->get_max_num_threads_per_multiprocessor();

View File

@@ -25,7 +25,7 @@ class OneapiDeviceQueue : public DeviceQueue {
virtual int num_concurrent_states(const size_t state_size) const override;
virtual int num_concurrent_busy_states() const override;
virtual int num_concurrent_busy_states(const size_t state_size) const override;
virtual void init_execution() override;

View File

@@ -103,7 +103,7 @@ class DeviceQueue {
/* Number of states which keeps the device occupied with work without losing performance.
* The renderer will add more work (when available) when number of active paths falls below this
* value. */
virtual int num_concurrent_busy_states() const = 0;
virtual int num_concurrent_busy_states(const size_t state_size) const = 0;
/* Number of elements in a partition of sorted shaders, that improves memory locality of
* integrator state fetch at the cost of decreased coherence for shader kernel execution. */

View File

@@ -1296,6 +1296,7 @@ void PathTrace::set_guiding_params(const GuidingParams &guiding_params, const bo
# if OPENPGL_VERSION_MINOR >= 4
field_args.deterministic = guiding_params.deterministic;
# endif
reinterpret_cast<PGLKDTreeArguments *>(field_args.spatialSturctureArguments)->maxDepth = 16;
openpgl::cpp::Device *guiding_device = static_cast<openpgl::cpp::Device *>(
device_->get_guiding_device());
if (guiding_device) {

View File

@@ -18,13 +18,15 @@
CCL_NAMESPACE_BEGIN
static size_t estimate_single_state_size()
static size_t estimate_single_state_size(const uint kernel_features)
{
size_t state_size = 0;
#define KERNEL_STRUCT_BEGIN(name) for (int array_index = 0;; array_index++) {
#define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) state_size += sizeof(type);
#define KERNEL_STRUCT_ARRAY_MEMBER(parent_struct, type, name, feature) state_size += sizeof(type);
#define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) \
state_size += (kernel_features & (feature)) ? sizeof(type) : 0;
#define KERNEL_STRUCT_ARRAY_MEMBER(parent_struct, type, name, feature) \
state_size += (kernel_features & (feature)) ? sizeof(type) : 0;
#define KERNEL_STRUCT_END(name) \
break; \
}
@@ -76,16 +78,11 @@ PathTraceWorkGPU::PathTraceWorkGPU(Device *device,
num_queued_paths_(device, "num_queued_paths", MEM_READ_WRITE),
work_tiles_(device, "work_tiles", MEM_READ_WRITE),
display_rgba_half_(device, "display buffer half", MEM_READ_WRITE),
max_num_paths_(queue_->num_concurrent_states(estimate_single_state_size())),
min_num_active_main_paths_(queue_->num_concurrent_busy_states()),
max_num_paths_(0),
min_num_active_main_paths_(0),
max_active_main_path_index_(0)
{
memset(&integrator_state_gpu_, 0, sizeof(integrator_state_gpu_));
/* Limit number of active paths to the half of the overall state. This is due to the logic in the
* path compaction which relies on the fact that regeneration does not happen sooner than half of
* the states are available again. */
min_num_active_main_paths_ = min(min_num_active_main_paths_, max_num_paths_ / 2);
}
void PathTraceWorkGPU::alloc_integrator_soa()
@@ -103,6 +100,20 @@ void PathTraceWorkGPU::alloc_integrator_soa()
integrator_state_soa_volume_stack_size_ = max(integrator_state_soa_volume_stack_size_,
requested_volume_stack_size);
/* Determine the number of path states. Deferring this for as long as possible allows the
* back-end to make better decisions about memory availability. */
if (max_num_paths_ == 0) {
size_t single_state_size = estimate_single_state_size(kernel_features);
max_num_paths_ = queue_->num_concurrent_states(single_state_size);
min_num_active_main_paths_ = queue_->num_concurrent_busy_states(single_state_size);
/* Limit number of active paths to the half of the overall state. This is due to the logic in
* the path compaction which relies on the fact that regeneration does not happen sooner than
* half of the states are available again. */
min_num_active_main_paths_ = min(min_num_active_main_paths_, max_num_paths_ / 2);
}
/* Allocate a device only memory buffer before for each struct member, and then
* write the pointers into a struct that resides in constant memory.
*

View File

@@ -328,6 +328,7 @@ set(SRC_UTIL_HEADERS
../util/math_int2.h
../util/math_int3.h
../util/math_int4.h
../util/math_int8.h
../util/math_matrix.h
../util/projection.h
../util/rect.h
@@ -350,6 +351,8 @@ set(SRC_UTIL_HEADERS
../util/types_int3_impl.h
../util/types_int4.h
../util/types_int4_impl.h
../util/types_int8.h
../util/types_int8_impl.h
../util/types_spectrum.h
../util/types_uchar2.h
../util/types_uchar2_impl.h
@@ -713,10 +716,17 @@ endif()
# oneAPI module
if(WITH_CYCLES_DEVICE_ONEAPI)
if(WIN32)
set(cycles_kernel_oneapi_lib ${CMAKE_CURRENT_BINARY_DIR}/cycles_kernel_oneapi.dll)
if(WITH_CYCLES_ONEAPI_BINARIES)
set(cycles_kernel_oneapi_lib_suffix "_aot")
else()
set(cycles_kernel_oneapi_lib ${CMAKE_CURRENT_BINARY_DIR}/libcycles_kernel_oneapi.so)
set(cycles_kernel_oneapi_lib_suffix "_jit")
endif()
if(WIN32)
set(cycles_kernel_oneapi_lib ${CMAKE_CURRENT_BINARY_DIR}/cycles_kernel_oneapi${cycles_kernel_oneapi_lib_suffix}.dll)
set(cycles_kernel_oneapi_linker_lib ${CMAKE_CURRENT_BINARY_DIR}/cycles_kernel_oneapi${cycles_kernel_oneapi_lib_suffix}.lib)
else()
set(cycles_kernel_oneapi_lib ${CMAKE_CURRENT_BINARY_DIR}/libcycles_kernel_oneapi${cycles_kernel_oneapi_lib_suffix}.so)
endif()
set(cycles_oneapi_kernel_sources
@@ -751,10 +761,6 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
${SYCL_CPP_FLAGS}
)
if (WITH_CYCLES_ONEAPI_SYCL_HOST_ENABLED)
list(APPEND sycl_compiler_flags -DWITH_ONEAPI_SYCL_HOST_ENABLED)
endif()
# Set defaults for spir64 and spir64_gen options
if (NOT DEFINED CYCLES_ONEAPI_SYCL_OPTIONS_spir64)
set(CYCLES_ONEAPI_SYCL_OPTIONS_spir64 "-options '-ze-opt-large-register-file -ze-opt-regular-grf-kernel integrator_intersect'")
@@ -767,6 +773,8 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
string(PREPEND CYCLES_ONEAPI_SYCL_OPTIONS_spir64_gen "-device ${CYCLES_ONEAPI_SPIR64_GEN_DEVICES} ")
if (WITH_CYCLES_ONEAPI_BINARIES)
# AoT binaries aren't currently reused when calling sycl::build.
list (APPEND sycl_compiler_flags -DSYCL_SKIP_KERNELS_PRELOAD)
# Iterate over all targest and their options
list (JOIN CYCLES_ONEAPI_SYCL_TARGETS "," targets_string)
list (APPEND sycl_compiler_flags -fsycl-targets=${targets_string})
@@ -819,12 +827,17 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
-DONEAPI_EXPORT)
string(REPLACE /Redist/ /Tools/ MSVC_TOOLS_DIR ${MSVC_REDIST_DIR})
if(NOT CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION) # case for Ninja on Windows
# Version Folder between Redist and Tools can mismatch sometimes
if(NOT EXISTS ${MSVC_TOOLS_DIR})
get_filename_component(cmake_ar_dir ${CMAKE_AR} DIRECTORY)
get_filename_component(MSVC_TOOLS_DIR "${cmake_ar_dir}/../../../" ABSOLUTE)
endif()
if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION)
set(WINDOWS_KIT_DIR ${WINDOWS_KITS_DIR}/Lib/${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION})
else() # case for Ninja on Windows
get_filename_component(cmake_mt_dir ${CMAKE_MT} DIRECTORY)
string(REPLACE /bin/ /Lib/ WINDOWS_KIT_DIR ${cmake_mt_dir})
get_filename_component(WINDOWS_KIT_DIR "${WINDOWS_KIT_DIR}/../" ABSOLUTE)
else()
set(WINDOWS_KIT_DIR ${WINDOWS_KITS_DIR}/Lib/${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION})
endif()
list(APPEND sycl_compiler_flags
-L "${MSVC_TOOLS_DIR}/lib/x64"
@@ -836,15 +849,13 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
set(sycl_compiler_flags_RelWithDebInfo ${sycl_compiler_flags})
set(sycl_compiler_flags_MinSizeRel ${sycl_compiler_flags})
list(APPEND sycl_compiler_flags_RelWithDebInfo -g)
get_filename_component(sycl_library_debug_name ${SYCL_LIBRARY_DEBUG} NAME_WE)
list(APPEND sycl_compiler_flags_Debug
-g
-D_DEBUG
-nostdlib -Xclang --dependent-lib=msvcrtd
-Xclang --dependent-lib=${sycl_library_debug_name})
-nostdlib -Xclang --dependent-lib=msvcrtd)
add_custom_command(
OUTPUT ${cycles_kernel_oneapi_lib}
OUTPUT ${cycles_kernel_oneapi_lib} ${cycles_kernel_oneapi_linker_lib}
COMMAND ${CMAKE_COMMAND} -E env
"LIB=${sycl_compiler_root}/../lib" # for compiler to find sycl.lib
"PATH=${OCLOC_INSTALL_DIR}\;${sycl_compiler_root}"
@@ -858,8 +869,8 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
else()
list(APPEND sycl_compiler_flags -fPIC)
# We avoid getting __FAST_MATH__ to be defined when building on CentOS 7 until the compilation crash
# it triggers at either AoT or JIT stages gets fixed.
# We avoid getting __FAST_MATH__ to be defined when building on CentOS 7 until the compilation
# crash it triggers at either AoT or JIT stages gets fixed.
list(APPEND sycl_compiler_flags -fhonor-nans)
# add $ORIGIN to cycles_kernel_oneapi.so rpath so libsycl.so and
@@ -873,7 +884,8 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
OUTPUT ${cycles_kernel_oneapi_lib}
COMMAND ${CMAKE_COMMAND} -E env
"LD_LIBRARY_PATH=${sycl_compiler_root}/../lib:${OCLOC_INSTALL_DIR}/lib:${IGC_INSTALL_DIR}/lib"
"PATH=${OCLOC_INSTALL_DIR}/bin:${sycl_compiler_root}:$ENV{PATH}" # env PATH is for compiler to find ld
# `$ENV{PATH}` is for compiler to find `ld`.
"PATH=${OCLOC_INSTALL_DIR}/bin:${sycl_compiler_root}:$ENV{PATH}"
${SYCL_COMPILER} $<$<CONFIG:Debug>:-g>$<$<CONFIG:RelWithDebInfo>:-g> ${sycl_compiler_flags}
DEPENDS ${cycles_oneapi_kernel_sources})
endif()

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

@@ -201,11 +201,35 @@ ccl_device float2 direction_to_mirrorball(float3 dir)
return make_float2(u, v);
}
/* Single face of a equiangular cube map projection as described in
https://blog.google/products/google-ar-vr/bringing-pixels-front-and-center-vr-video/ */
ccl_device float3 equiangular_cubemap_face_to_direction(float u, float v)
{
u = (1.0f - u);
u = tanf(u * M_PI_2_F - M_PI_4_F);
v = tanf(v * M_PI_2_F - M_PI_4_F);
return make_float3(1.0f, u, v);
}
ccl_device float2 direction_to_equiangular_cubemap_face(float3 dir)
{
float u = atan2f(dir.y, dir.x) * 2.0f / M_PI_F + 0.5f;
float v = atan2f(dir.z, dir.x) * 2.0f / M_PI_F + 0.5f;
u = 1.0f - u;
return make_float2(u, v);
}
ccl_device_inline float3 panorama_to_direction(ccl_constant KernelCamera *cam, float u, float v)
{
switch (cam->panorama_type) {
case PANORAMA_EQUIRECTANGULAR:
return equirectangular_range_to_direction(u, v, cam->equirectangular_range);
case PANORAMA_EQUIANGULAR_CUBEMAP_FACE:
return equiangular_cubemap_face_to_direction(u, v);
case PANORAMA_MIRRORBALL:
return mirrorball_to_direction(u, v);
case PANORAMA_FISHEYE_EQUIDISTANT:
@@ -230,6 +254,8 @@ ccl_device_inline float2 direction_to_panorama(ccl_constant KernelCamera *cam, f
switch (cam->panorama_type) {
case PANORAMA_EQUIRECTANGULAR:
return direction_to_equirectangular_range(dir, cam->equirectangular_range);
case PANORAMA_EQUIANGULAR_CUBEMAP_FACE:
return direction_to_equiangular_cubemap_face(dir);
case PANORAMA_MIRRORBALL:
return direction_to_mirrorball(dir);
case PANORAMA_FISHEYE_EQUIDISTANT:

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

@@ -7,6 +7,7 @@
* one with SSE2 intrinsics.
*/
#if defined(__x86_64__) || defined(_M_X64)
# define __KERNEL_SSE__
# define __KERNEL_SSE2__
#endif
@@ -29,11 +30,15 @@
# define __KERNEL_SSE41__
# endif
# ifdef __AVX__
# define __KERNEL_SSE__
# ifndef __KERNEL_SSE__
# define __KERNEL_SSE__
# endif
# define __KERNEL_AVX__
# endif
# ifdef __AVX2__
# define __KERNEL_SSE__
# ifndef __KERNEL_SSE__
# define __KERNEL_SSE__
# endif
# define __KERNEL_AVX2__
# endif
#endif

View File

@@ -23,22 +23,6 @@ CCL_NAMESPACE_BEGIN
* and keep device specific code in compat.h */
#ifdef __KERNEL_ONEAPI__
# ifdef WITH_ONEAPI_SYCL_HOST_ENABLED
template<typename IsActiveOp>
void cpu_serial_active_index_array_impl(const uint num_states,
ccl_global int *ccl_restrict indices,
ccl_global int *ccl_restrict num_indices,
IsActiveOp is_active_op)
{
int write_index = 0;
for (int state_index = 0; state_index < num_states; state_index++) {
if (is_active_op(state_index))
indices[write_index++] = state_index;
}
*num_indices = write_index;
return;
}
# endif /* WITH_ONEAPI_SYCL_HOST_ENABLED */
template<typename IsActiveOp>
void gpu_parallel_active_index_array_impl(const uint num_states,
@@ -182,18 +166,11 @@ __device__
num_simd_groups, \
simdgroup_offset)
#elif defined(__KERNEL_ONEAPI__)
# ifdef WITH_ONEAPI_SYCL_HOST_ENABLED
# define gpu_parallel_active_index_array( \
blocksize, num_states, indices, num_indices, is_active_op) \
if (ccl_gpu_global_size_x() == 1) \
cpu_serial_active_index_array_impl(num_states, indices, num_indices, is_active_op); \
else \
gpu_parallel_active_index_array_impl(num_states, indices, num_indices, is_active_op);
# else
# define gpu_parallel_active_index_array( \
blocksize, num_states, indices, num_indices, is_active_op) \
gpu_parallel_active_index_array_impl(num_states, indices, num_indices, is_active_op)
# endif
# define gpu_parallel_active_index_array( \
blocksize, num_states, indices, num_indices, is_active_op) \
gpu_parallel_active_index_array_impl(num_states, indices, num_indices, is_active_op)
#else
# define gpu_parallel_active_index_array( \

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"

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