Commit Graph

13328 Commits

Author SHA1 Message Date
Jeroen Bakker
159e798cdb Vulkan: Add Viewport Array/Layer Workarounds
This PR adds workarounds for platforms that don't support `shaderOutputLayer`
or `shaderOutputViewportIndex`. Some NVIDIA laptop GPUs and ARM GPUs don't
have those device features.

The workaround uses the same approach as OpenGL. A geometry shader is injected
to emulate the feature.

For testing the workarounds they have also been connected to the
`--debug-gpu-force-workarounds` command line argument.

Fixes #113475 by implementing #113529

Pull Request: https://projects.blender.org/blender/blender/pulls/113605
2023-10-13 10:40:11 +02:00
Campbell Barton
ac82a7c3f8 Merge branch 'blender-v4.0-release' 2023-10-13 17:32:55 +11:00
Campbell Barton
5e6a34ac6c Fix memory leak with Wayland drag & drop
The data-offer for drag & drop wasn't freed when cancelled or not
dropped on a Blender owned surface.
2023-10-13 17:31:02 +11:00
Campbell Barton
c814c0295d Merge branch 'blender-v4.0-release' 2023-10-13 15:46:41 +11:00
Campbell Barton
3e9403bd76 Fix drag & drop crash when dragging over window decorations on Wayland
Missing null checks for drag events for non-GHOST surfaces
(typically window decorations).
2023-10-13 15:34:21 +11:00
Campbell Barton
3180f16cef Merge branch 'blender-v4.0-release' 2023-10-12 14:20:26 +11:00
Campbell Barton
3d90af5ae1 Merge branch 'blender-v4.0-release' 2023-10-12 14:20:19 +11:00
Campbell Barton
ecde39baf3 Fix #113328: Wrong startup window size with fractional scale on Wayland
The output's XDG scale wasn't available at startup, add a round-trip
to resolve this.
2023-10-12 14:18:53 +11:00
Campbell Barton
ee15925716 Fix incorrect screen-size under Wayland with transformed outputs
- The transform was incorrectly accessed as a flag.
- Missing checks for 270 degree rotation.
2023-10-12 14:18:51 +11:00
Harley Acheson
0deb4f3e98 Merge branch 'blender-v4.0-release' 2023-10-11 18:34:04 -07:00
Harley Acheson
6aeadce34b UI: Win32 Warp Margin Adjustment
Windows mouse warping bounds margin needs to be different when not
GHOST_kGrabHide, or else the visible wrapping occurs within the
area at an odd location. Making it 2, like it used to be.
2023-10-11 18:32:11 -07:00
Harley Acheson
fba58a1483 Merge branch 'blender-v4.0-release' 2023-10-11 16:05:09 -07:00
Harley Acheson
67e4af3ea1 Fix #113511: Win32 Warping Needs Screen Edge Margin
Windows mouse warping requires a margin when the bounds are at screen
edge. Setting a margin of 10% of bounds width tests sufficient.

Pull Request: https://projects.blender.org/blender/blender/pulls/113565
2023-10-12 01:03:53 +02:00
Campbell Barton
db093a4608 Merge branch 'blender-v4.0-release' 2023-10-12 09:27:43 +11:00
Campbell Barton
b8ad624006 Cleanup: use doxygen doc-strings, spelling in comments 2023-10-12 09:26:53 +11:00
Brecht Van Lommel
59f8712040 Merge branch 'blender-v4.0-release' into main 2023-10-11 21:14:05 +02:00
Brecht Van Lommel
09046e8121 Fix #113461: Cycles subsurface artifacts with volume interior
Ignore self for the volume stack update from the the subsurface entry to
the exit point. This was meant for other objects only.
2023-10-11 21:13:28 +02:00
Brecht Van Lommel
5baf173609 Fix #113527: Cycles OSL crash with empty closure for layering 2023-10-11 21:12:57 +02:00
Alaska
4f5e684e24 Fix Cycles OSL geometry node point cloud inconsistency
Update the OSL script for the "Geometry" node to follow the correct
Tangent code path when working with point clouds.

There should be no functional change for the end user since the correct
code path was already taken by accident.

Pull Request: https://projects.blender.org/blender/blender/pulls/113472
2023-10-11 21:05:41 +02:00
Sergey Sharybin
79dc2c7672 Merge branch 'blender-v4.0-release' 2023-10-11 19:12:12 +02:00
Sergey Sharybin
534e7f4470 Fix #112935: Wrong window order handling on macOS 14
The issue was caused by the custom code which was ensuring that closing
About window does not leave application without any key
windows.

Turns out that the windowWillClose is executed when menu is closed,
forcing the custom code to ensure a key window.

The solution is to only perform manual re-ordering if the closing window
was a key window. This both keeps old behavior of ensuring there is a
key window after closing About, and solves the ordering issues when a
window is created or activated via menus.

Pull Request: https://projects.blender.org/blender/blender/pulls/113515
2023-10-11 19:11:41 +02:00
Xavier Hallade
5aed85dcd7 Cycles: oneAPI: query graphics compiler for supported targets
In case a target isn't supported by the graphics compiler, it will be
filtered out from the target architectures to build for.

Pull Request: https://projects.blender.org/blender/blender/pulls/112669
2023-10-11 18:19:48 +02:00
Xavier Hallade
79b9fff399 Revert "Cycles: oneAPI: query graphics compiler for supported targets"
This reverts commit ad8c5fd441.
As it's currently failing on linux buildbot.
2023-10-11 15:44:55 +02:00
Sergey Sharybin
36e603c430 Cycles: Add option to control smoothing when using bump map
Cycles implements the "Taming the Shadow Terminator" paper by Matt Jen-Yuan
Chiang to solve shadow terminator issues when a bump map is applied, as well
as similar approach for the glossy reflection to ensure ray does not get
reflected to inside of the object.

This correction term is applied unconditionally, which makes it harder to have
full control over shading via normals for stylistic reasons.

This change exposes this corrective term as an option called "Bump Map
Correction" which is available in the shader settings next to the
"Transparent Shadows".

The reason to make it per-shader rather than per-object is to allow flexibility
of a control: it is possible that an object has multiple shaders attached to it,
and only some of them used for bump mapping. Another, and possibly stronger
reason to have it per-shader is ease of assets control: shader brings settings
which are needed for its proper behavior. So if material at some point
decides to take over normals, artists would not need to update settings on
every asset which uses that material.

The option is enabled by default, so there is no changes for existing setups.

Pull Request: https://projects.blender.org/blender/blender/pulls/113480
2023-10-11 15:07:21 +02:00
Xavier Hallade
ad8c5fd441 Cycles: oneAPI: query graphics compiler for supported targets
In case a target isn't supported by the graphics compiler, it will be
filtered out from the target architectures to build for.
2023-10-11 14:59:26 +02:00
Xavier Hallade
c4b49aa391 Cycles: oneAPI: rename target intel arch cmake setting
CYCLES_ONEAPI_SPIR64_GEN_DEVICES -> CYCLES_ONEAPI_INTEL_BINARIES_ARCH
so it's more aligned with the name for the other backends, such as
CYCLES_CUDA_BINARIES_ARCH.
2023-10-11 14:59:26 +02:00
Xavier Hallade
ef80392721 Cycles: oneAPI: update windows ocloc to 101.4723
The first public Windows driver version with a higher number is
101.4824, so we bump the min-required driver version on Windows to this
one to ensure compatibility.
2023-10-11 14:47:48 +02:00
Campbell Barton
b0a6c6c1de Merge branch 'blender-v4.0-release' 2023-10-11 10:44:23 +11:00
Campbell Barton
58442a420e Cleanup: comment for release configuration, quote-style & remove parens 2023-10-11 10:41:16 +11:00
Campbell Barton
5e7a85539d Merge branch 'blender-v4.0-release' 2023-10-10 11:06:29 +11:00
Campbell Barton
951ae52912 GHOST/Wayland: disable assert which can happen during debugging 2023-10-10 11:04:36 +11:00
Campbell Barton
137f8dd7bc Cleanup: spelling in comments 2023-10-10 09:44:57 +11:00
Harley Acheson
a6a4d45538 Merge branch 'blender-v4.0-release' 2023-10-09 13:10:22 -07:00
Harley Acheson
1d141e721c Fix #109968: Allow Warping on Actual Mouse Bounds
For Color Circle (and Square) and for Walk Navigation, use the actual
region bounds for mouse warping.

Pull Request: https://projects.blender.org/blender/blender/pulls/113066
2023-10-09 22:09:04 +02:00
Brecht Van Lommel
5bb729b155 Merge branch 'blender-v4.0-release' into main 2023-10-09 19:19:11 +02:00
Alaska
85c4df2c42 Cycles: Update Glass BSDF to generalized_schlick
Update the Glass BSDF to internally use Generalized Schlick fresnel.
This allows for easier expansion of certain features in the future.

There should be no functional change from the users perspective.

Pull Request: https://projects.blender.org/blender/blender/pulls/112701
2023-10-09 19:17:15 +02:00
Brecht Van Lommel
03b2523df8 Merge branch 'blender-v4.0-release' into main 2023-10-09 16:14:39 +02:00
Alaska
990a9440ad Fix some complex Principled BSDF setups not working correctly
Update the max closure count.

Pull Request: https://projects.blender.org/blender/blender/pulls/113390
2023-10-09 16:13:44 +02:00
Campbell Barton
39295476d0 Cleanup: store const events in GHOST's event handling logic 2023-10-08 15:23:40 +11:00
Campbell Barton
fc78182cc8 Refactor: use const event data, use static_casts
In some cases processing events was modifying them, as there can be
multiple event consumers, manipulating events isn't correct.
Even though in practice it didn't cause issues, it's straightforward
not to do this and makes logic easier to reason about.
2023-10-08 15:23:39 +11:00
Campbell Barton
0bf7d15fa6 Cleanup: replace strncpy with memcpy for buffers of a known size 2023-10-08 14:34:27 +11:00
Campbell Barton
8f8a9ef488 Cleanup: remove unused GHOST_kEventTimer
There was a type error assigning customdata, (wmTimer *) was expected
although this data isn't created so it was never hit.
2023-10-08 14:31:15 +11:00
Campbell Barton
0742ef808f Fix writing past struct bounds of GHOST_TEventImeData
IME editing would cast GHOST_TEventImeData to wmIMEData then read/write
an additional member that doesn't exist in GHOST_TEventImeData.

In practice it's likely struct padding prevented this from showing up
as a bug. Nevertheless it's bad practice to rely on this.

- Make GHOST_TEventImeData read-only, move the is_ime_composing boolean
  into the window.
- Add static assert to ensure both structs are the same size.
- Correct code comments.
2023-10-08 14:29:08 +11:00
Campbell Barton
519d29423d Fix building WITH_GHOST_DEBUG without NDOF 2023-10-08 14:28:25 +11:00
Campbell Barton
0c91466785 GHOST/Wayland: remove WITH_GHOST_WAYLAND_DBUS
This was only used for accessing cursor themes which only worked
with gnome and wasn't used in official releases.
Use the default theme or the theme defined by XCURSOR_THEME.

Eventually wp_cursor_shape_manager_v1 can be supported which avoids
having to access the theme.
2023-10-07 21:31:15 +11:00
Campbell Barton
e8834565a3 CMake: support building GHOST/X11 without OpenGL 2023-10-07 21:22:15 +11:00
Campbell Barton
f3f494fd63 macOS: fix issues building without OpenGL headers
macOS has WITH_OPENGL_BACKEND disabled but still included
`epoxy/gl.h` and defined an unused NSOpenGLContext.
2023-10-07 20:51:24 +11:00
Campbell Barton
149d80946e Cleanup: CMake formatting 2023-10-07 19:46:38 +11:00
Campbell Barton
1bb098bf44 CMake: WITH_OPENGL_BACKEND=OFF excludes EGL/EPOXY includes & libraries
This isn't complete as opensubdiv, hydra & XR still depend on OpenGL.
2023-10-07 18:30:17 +11:00
Campbell Barton
a17d6efe98 Cleanup: correct enums used as booleans 2023-10-07 18:28:09 +11:00