Fix_105606_MetalTextureUploadRegression #1

Closed
Michael Parkin-White wants to merge 17 commits from Fix_105606_MetalTextureUploadRegression into Fix_103605_MetalBarycentrics

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

17 Commits

Author SHA1 Message Date
87766429b9 Merge branch 'blender-v3.5-release' into Fix_105606_MetalTextureUploadRegression 2023-03-15 15:05:05 +01:00
ffb120c560 Fix #105661: (Regression) Materials can use fewer images than before
Skip explicit binding location for samplers in OpenGL when not needed, since drivers can usually handle more sampler declarations this way (as long as they're not actually used by the shader).

Pull Request: blender/blender#105770
2023-03-15 13:58:28 +01:00
c4d6f766de Fix #105180: "All" asset library includes subfolders of current file
The loading for the "All" asset library would include the "Current File"
library as if it were a regular asset libray on disk. Instead make sure
the latter is loaded properly first and is skipped when recursively
reading on disk libraries.
2023-03-15 13:06:39 +01:00
089e8a1887 Cycles: Fix Metal API validation error (use uint instead of ushort)
This PR fixes an error that is given when Metal API validation is enabled. The compute grid can exceed 65536 threads so `ushort` is not sufficient for `metal_grid_id [[threadgroup_position_in_grid]]`.

This PR also fixes OS version warnings ([Cycles Metal: Unguarded access to newer macOS features #105630](blender/blender#105630))

Pull Request: blender/blender#105763
2023-03-14 22:05:55 +01:00
a7cd6de244 Fix Cycles missing light from multiple distant lights with different visibility 2023-03-14 18:19:12 +01:00
3785dc8043 Fix #105146: Gpencil select does not work with Layer transforms
The transformations were applied two times and the old fix was wrong because it needs to use the evaluated point, not the original one. Also I did a small code cleanup.

Pull Request: blender/blender#105202
2023-03-14 16:57:46 +01:00
12fa62533e Fix #105606: Metal texture upload regression.
immDrarPixels performs significantly slower in OpenGL
than Metal. This was caused by two main factors. Firstly,
the additional overhead of tiled texture update, where all
memory needed to be kept in flight for each update, but
caused update to take a slow path. Avoidng tile update
with Metal is more efficient for both memory pressure
and GPU pipelining.

Secondly, on AMD platforms, the staging buffer used
for temporary texture data was page-faulting when
several texture updates would occur within one frame.
This is due to liimtations of allocating one large contiguous
memory chunk. Using the Metal buffer pool for staging
data is more efficient.

Authored by Apple: Michael Parkin-White

Ref #96261
2023-03-14 10:02:53 +00:00
96c6349cbf Fix #103605: Metal barycentric coordinate compilation failure
Fix support for Wireframe and parametric nodes by resolving
compilation failures surrounding barycentric coordinates.
A final missing part of the Metal implementation for barycentric
coordinates was missing.

Feedback also addressed to move barycentric calculation out
of code-gen and into surface_lib.

Authored by Apple: Michael Parkin-White

This also resolves #103606.
Ref #96261

Pull Request: blender/blender#105740
2023-03-14 08:23:02 +01:00
51e5417bd3 Fix #105678: Crash assigning Image.pixels to an undersized sequence
Now only dynamic function parameters that use ParameterDynAlloc support
dynamically sized parameters arrays.

Add tests for both dynamic arrays that don't support resizing
(Image.pixels) and dynamic sized arguments using
(VertexGroup.add(index=[..])).

Regression in [0] which extended support for dynamic sized function
arguments.

[0]: dfb8c5974e
2023-03-14 16:00:24 +11:00
1c88bf6ce1 Fix #105715: Freeing the edit-mesh causes future access to fail
The BPyBMesh in `BMesh::py_handle` was invalidated but not cleared,
causing future access to return a 'dead' bmesh.
2023-03-14 13:36:54 +11:00
708e84df90 Fix #105721: Fix crash accessing driver variables & targets
- DriverVariable.name update function passed DriverVar to
  BKE_driver_invalidate_expression as a ChannelDriver.

- DriverTarget.name update function passed DriverTarget to
  BKE_driver_invalidate_expression as a ChannelDriver.

- DriverVariable.type update function DriverVar accessed ChannelDriver,
  clearing a flag.

This was exposed by [0] however this issue existed beforehand.

[0]: c26566ad27
2023-03-14 12:16:22 +11:00
98bfa8d458 Fix 'use_occlusion_test' option not having effect on wireframe
This is a non-recent regression that strangely went unreported.

It is expected that when snapping, only visible elements are considered
which does not include faces in wireframe mode.

This works like this before, and this change doesn't appear to have
been intentional.

Ref #105664
2023-03-13 15:34:39 -03:00
f92bacee94 Cleanup: use macro for 'SCE_SNAP_MODE_GEOM'
One of the advantages of separating this enum member from the others is
because mixing several members in a single one hinders debugging since
in this case the IDE does not define which enums were set.

Also separating this item makes it more readable as `SCE_SNAP_MODE_GEOM`
is not a snap mode but a combination of modes.
2023-03-13 15:34:26 -03:00
ca2bf2f3a0 Fix #105625: GPencil sculpt crash with subdivide modifier
The created point hasn't a original point in the original stroke, so
must use only the valid points.

Pull Request: blender/blender#105627
2023-03-13 18:04:25 +01:00
69c6158cc8 Fix #105589: GPencil Paste duplicate active frame
The active frame is pasted always, so if multiframe is
copying the strokes don't need copy the active frame again.

Pull Request: blender/blender#105605
2023-03-13 18:02:36 +01:00
0b68e609fc Fix 105271: Luminance Matte not Working on NVIDIA.
Issue was that the clamping parameters were not in
the correct order. This leads to undefined behavior
and also lead to small artifacts on other platforms.

Pull Request: blender/blender#105735
2023-03-13 16:07:17 +01:00
6e4bcb7c87 Fix #100659: "Add F-Curve Modifier" applies only to Active F-Curve
In most places where it appears in a menu, the operator would already
apply to all selected F-Curves. Now it is done consistently and explicitly
from all menu items. The default of the operator is now also set to 'all
selected', so that it also behaves like that when called from the operator
search menu.
2023-03-13 15:23:57 +01:00