Commit Graph

2830 Commits

Author SHA1 Message Date
Bastien Montagne
2d7f00e410 Merge branch 'blender-v4.2-release' 2024-06-26 11:50:27 +02:00
Bastien Montagne
c525e4db83 Revert "GHOST/Wayland: reference the stable tablet-v2 API"
The currently available `wayland-protocol` libraries in lib-linux_x64
repo do not appear to be advertised 1.36 (or 1.35) versions, since the
tablet protocol is not available among the stable ones.

This reverts commit 2a85eaaf169c51cfb24d4564fa58b4c89ce6d773.

Pull Request: https://projects.blender.org/blender/blender/pulls/123774
2024-06-26 11:48:55 +02:00
Campbell Barton
9ee6da08ab Merge branch 'blender-v4.2-release' 2024-06-26 16:29:57 +10:00
Campbell Barton
2a85eaaf16 GHOST/Wayland: reference the stable tablet-v2 API
The tablet API become stable in wayland-protocol 1.35
2024-06-26 16:26:18 +10:00
Jeroen Bakker
a7a554479f Vulkan: Fix compilation issue macOs due to renamed variable
Pull Request: https://projects.blender.org/blender/blender/pulls/123503
2024-06-20 19:21:47 +02:00
Jeroen Bakker
76cae1c4e6 Vulkan: Dynamic rendering unused attachments
Add support for VK_EXT_dynamic_rendering_unused_attachments. Although
this is required, it needs to be registered optional for now due to
lacking support when using renderdoc.

Pull Request: https://projects.blender.org/blender/blender/pulls/123483
2024-06-20 14:47:39 +02:00
Jeroen Bakker
faf0171c36 Vulkan: Make stencil export optional
`VK_EXT_shader_stencil_export` isn't supported by NVIDIA devices.
This extension was recently added to support EEVEE PBR layer selection.

This PR makes this extension optional and selects the work around
when not supported by the physical device.

Fixes #114385

Pull Request: https://projects.blender.org/blender/blender/pulls/123470
2024-06-20 14:12:07 +02:00
Jeroen Bakker
4353b7ffba Vulkan: Remove unused code
Vulkan backend has recently switched to a render graph approach. Many
code was left so we could develop the render graph beside the previous
implementation. Last week we removed the switch. This PR will remove
most of the unused code. There might be some left and will be removed
when detected.

Pull Request: https://projects.blender.org/blender/blender/pulls/123422
2024-06-20 11:34:19 +02:00
YimingWu
ef1d5c629b Fix #123212: Support LSGT key for X11.
The LSGT (GrLess) key is not processed in X11 while it's processed in
Win32. This attempts to fix the behaviour.

Pull Request: https://projects.blender.org/blender/blender/pulls/123354
2024-06-20 08:01:43 +02:00
Campbell Barton
295ffeeb02 Merge branch 'blender-v4.2-release' 2024-06-19 19:40:18 +10:00
Campbell Barton
50bb98fba5 Fix #123339: Blender fails to build with older versions of wayland
Follow up to [0] which only addressed one of the issues.

[0]: bc7cb481dab9d0f9c22d4c59e90930be9a3a6511
2024-06-19 19:36:10 +10:00
Campbell Barton
033a3f09b6 Merge branch 'blender-v4.2-release' 2024-06-18 20:38:38 +10:00
Campbell Barton
bc7cb481da Fix #123339: Blender fails to build with older versions of wayland 2024-06-18 20:37:25 +10:00
Campbell Barton
08ddd98d73 Merge branch 'blender-v4.2-release' 2024-06-18 19:50:40 +10:00
Anthony Roberts
794a8f35fa Windows: Update GPU error message on ARM64
This makes it more verbose, and a little clearer that devices prior to 8cx Gen3 are not supported in  >=v4.0. It makes the error message from #113674 more prominent than just being printed to cout.

Spurred by an email I got from someone trying to run blender on a Surface Pro X, and getting the not very helpful (to old devices) error.

Pull Request: https://projects.blender.org/blender/blender/pulls/122732
2024-06-18 11:47:01 +02:00
Jeroen Bakker
07ea6a5c23 Vulkan: Enable render graph
This PR hooks up the vulkan backend with the render graph
for drawing. It can run Blender better than the previous
implementation so we also flipped it to be the default
implementation.

**Some highlights**
- Adds support for framebuffer load/store operations
- Adds support for framebuffer subpass transitions
- Fixes workbench shadows
- Performance is just below OpenGL performance when comparing
  fps. But the screen feels more fluent when using complex
  scenes.
- Current performance is without doing any optimizations so
  will improve in the future.
- EEVEE will not crash but has artifacts and many parts that
  require more work.

**Related to**
- #121648
- #118330

**Known Limitation**
- Similar to previous implementation resources can be freed when
  still in use crashing Blender. This is typically the case when
  playing back an animation or updating a material icon.

**Next steps**
- Remove old implementation
- Get EEVEE to work
- Fix double resource freeing
- Improve performance by identifying hotspots and change them

Pull Request: https://projects.blender.org/blender/blender/pulls/121787
2024-06-14 08:46:33 +02:00
Campbell Barton
7f7648c6ed Cleanup: spelling in code comments & minor edits
- Use uppercase NOTE: tags.
- Correct bNote -> bNode.
- Use colon after parameters.
- Use doxy-style doc-strings.
2024-06-06 09:55:13 +10:00
Campbell Barton
7b30f657a5 Fix memory leak on exit with tablet seat data on Wayland 2024-06-01 22:54:52 +10:00
Jeroen Bakker
12a5b2977f Vulkan: Do not enable layers
Vulkan layers should not be controlled from application, but
 should be enabled via `vkconfig`. There are configurations
in the layers that are mutual exclusive and hard to maintain from
within an application.

An example is that currently we are not able to use renderdoc efficient,
because there is an validation error triggered from within renderdoc.

This PR removes all vulkan layer configuration from Blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/122473
2024-05-30 11:11:21 +02:00
Campbell Barton
0cbadd00a3 Cleanup: various non functional changes 2024-05-28 14:09:40 +10:00
Jeroen Bakker
b6002872a1 Vulkan: Optional device extensions maintenance 4
When VK_EXT_maintenance4 extension is used at device creation its
extension should also be part of the device extension list.

This wasn't the case and would trigger UB in the validation layers.

Pull Request: https://projects.blender.org/blender/blender/pulls/122208
2024-05-24 13:39:04 +02:00
Jesse Yurkovich
1f243f1d36 Cleanup: fix -Wpessimizing-move warning in GHOST_XrGraphicsBinding 2024-05-24 07:28:55 +02:00
Jeroen Bakker
79dfe8d37f Vulkan: Enable device feature dynamic rendering
In the near future the legacy framebuffer/renderpass/pipeline drawing
will be replaced by dynamic rendering. Dynamic rendering provide a
flexible API to reuse pipelines between framebuffers if they share
the same image formats.

Dynamic rendering is provided by `VK_KHR_dynamic_rendering` extension
and is supported by all platforms we support (Intel since HD4000, NVIDIA
since 700, AMD since GCN2 and llvmpipe).

Functions provided by extensions are loaded in a struct inside
`VKDevice`.

Pull Request: https://projects.blender.org/blender/blender/pulls/121642
2024-05-10 10:22:58 +02:00
Campbell Barton
98f319ce02 Cleanup: spelling in comments 2024-05-04 15:24:46 +10:00
Campbell Barton
c7de9b9f4a Reapply "GHOST/Wayland: improve the error message for protocol errors"
This reverts commit 2b85314f05cf0c4b45465dc57b881e1b3b52a605.
2024-05-03 10:55:17 +10:00
Sergey Sharybin
1b0012d51c Refactor: Require C++ for users of BLI_simd.h
This is because sse2neon.h might be used to emulate SSE intrinsics
on ARM64 architecture, and it uses some preprocessor which is not
available for C language when using MSVC.

The old-style math file math_matrix.c uses this header, so needed
to become C++. Simple rename did not work since there is a new math
utility math_matrix.cc exists. Following some existing convention
the math_matrix.c is renamed to math_matrix_c.cc. Eventually all the
code should switch to use C++ style math, and the C style removed,
so it seems reasonable to not mix old and new style of API in the
same file.

There should be no functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/121335
2024-05-02 16:22:19 +02:00
Jacques Lucke
2b85314f05 Revert "GHOST/Wayland: improve the error message for protocol errors"
This reverts commit a63e44a61f21832eceead24d770e2632ac2b4884.

This lead to build failures on linux because `wl_display_get_protocol_error`
is not defined. The error happened on the buildbot too.
2024-05-02 10:23:42 +02:00
Campbell Barton
0f2827ff77 GHOST/Wayland: postpone mapping LIBDECOR windows
While there should be no user visible changes.
Follow LIBDECOR sample code by setting the app-id & title before
mapping the window.
2024-05-02 10:43:55 +10:00
Campbell Barton
a63e44a61f GHOST/Wayland: improve the error message for protocol errors
Include the interface that fails in a protocol error.
2024-05-02 10:28:35 +10:00
Campbell Barton
f735e4e611 GHOST/Wayland: prevent eternal loop in case of an error creating windows
Check & print a message if there is an error creating the window.
In both cases Blender will fail to start, it's just better to exit
quickly with a message instead of hanging.
2024-05-02 10:28:35 +10:00
Campbell Barton
2d152db090 GHOST/Wayland: use XDG_CURRENT_DESKTOP to detect GNOME
This change was made previously [0] but reverted as it caused the
title-bar to disappear on Ubuntu (see #121241).
Check if the value is set to GNOME delimited by `:`.

Previously checking the interfaces was used which has the down-side
that any compositor that adds `gtk_shell*` support may hang on startup
because of bugs in Blender/LIBDECOR as happened with WAYFIRE,
see reply to #76428.

[0]: 3a5389d5abe00aa229b5c6d35d346cb8f7cbe649
2024-05-02 10:22:39 +10:00
Campbell Barton
848f1d8792 Cleanup: assign display as a variable on window creation
Reduces noise accessing the same value multiple times.
2024-05-02 10:20:54 +10:00
Campbell Barton
d06c34b2e5 Cleanup: note that XDG_* environment variables can't be relied on
This assumption caused #121241.

Also correct `endif` comment.
2024-04-30 15:02:29 +10:00
Campbell Barton
e8de8ee85a Fix hang on startup under Wayland with the WayFire compositor (#2)
Disable use of LIBDECOR on WAYFIRE as it causes Blender to hang
on window creation.

Detect WAYFIRE using the presence of the `zwf_shell_manager_v*`
interface, don't use LIBDECOR if this is found.

This is an alternative fix to [0] which also disabled LIBDECOR
but caused LIBDECOR not to be used in GNOME on some systems.

I'm not keen on this solution, but it seems alternatives are less
reliable. See code-comment for details.

[0]: 3a5389d5abe00aa229b5c6d35d346cb8f7cbe649
2024-04-30 14:50:56 +10:00
Campbell Barton
3a2fafba73 Revert "Fix hang on startup under Wayland with the WayFire compositor"
This reverts commit 3a5389d5abe00aa229b5c6d35d346cb8f7cbe649.

It seems XDG_CURRENT_DESKTOP isn't reliably set,
causing no titlebar on GNOME, see #121241.

The WAYFIRE workaround will need to be resolved another way.
2024-04-30 14:34:55 +10:00
Campbell Barton
3a5389d5ab Fix hang on startup under Wayland with the WayFire compositor
Use XDG_CURRENT_DESKTOP to check if GNOME is running.

Previously the existence of a `gtk_shell*` interface was used however
the WAYFIRE compositor provides this interface which made GHOST require
LIBDECOR.

Initializing LIBDECOR was hanging as the initial configuration was
never seen. From a quick check it doesn't seem like a bug in Blender's
LIBDECOR use, the issue may be in either LIBDECOR or WAYFIRE.
Whatever the case, LIBDECOR isn't needed so workaround the bug by
changing how GNOME is detected.
2024-04-29 12:32:22 +10:00
Campbell Barton
c444f128d3 WM: add a capability flag for physical trackpad direction
Support detecting if the trackpad direction flag is propertly set
(currently unused).

Needed so Wayland compositors that don't support seat-version 9 or
newer (GNOME-46 & KDE5 for e.g) can have a working trackpad.

Eventually this option will be removed when the functionality is
widely supported.
2024-04-26 21:26:49 +10:00
Campbell Barton
d544082e1d Fix #120925: Smooth scrolling mouse wheel broken on Wayland
Accumulate scrolling for mouse wheels that create scroll values below
a single "click".

Regression in [0], caused by bumping the seat API.

[0]: 8d86fb43a4eab6e538796fd0d9f310e58a209315
2024-04-23 13:34:59 +10:00
Fermin
821b773d95 FIX #109121: VR: Render controllers only if they are active
When turning on VR mode, if no controllers are available,
a fallback model (a sphere) is rendered in the middle of the VR area.

This change uses the OpenXR API to check if the controllers are
available, sets new properties in `GHOST_XrPose` and `wmXrController`
that store if each controller is active or not, and uses
those properties to render the controllers in the VR view only
when they are active.

NOTE: in `wmXrController`, two state properties have been included,
but only `grip_active` is currently used. `aim_active` has been
included for consistency, but it could be removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/119989
2024-04-21 03:28:35 +02:00
Campbell Barton
fd589fdca4 Cleanup: various non functional C++ changes 2024-04-20 13:46:14 +10:00
Campbell Barton
4e8b24f1d1 Cleanup: spelling in comments & punctuation 2024-04-19 15:57:06 +10:00
Campbell Barton
cf37424203 Cleanup: use const pointers, quiet cppcheck unreadVariable warning 2024-04-17 11:36:38 +10:00
Campbell Barton
1f44a74947 Fix inverted table wheel on wayland
The tablet wheel direction matches the mouse wheel which also needed
to be inverted.
2024-04-15 11:39:04 +10:00
Campbell Barton
1e6716a903 Fix inverted mouse wheel on wayland after recent changes
Recent change from [0] inverted mouse wheel direction.

[0]: c9a79f9a3c283ba8269da253411b6c9ec49aaf28.
2024-04-15 11:06:47 +10:00
Campbell Barton
b405bb3268 GHOST/Wayland: constrain new window size on startup with XDG-decor
On KDE, running "blender -w" (windowed with borders) created window
which was too big: the window contents matched the screen-size
causing the window decorations be outside the screen-bounds.

Un-maximizing the default startup file would also move window to the
same over-sized location.

Resolve by clamping the size of new windows to the requested bounds.
2024-04-14 22:19:24 +10:00
Jacques Lucke
0a192c5da4 Cleanup: fix compilation
Missing from e27889dc12e16a9a7f2c72210fa3e6cb3b968100.
2024-04-14 10:50:54 +02:00
Campbell Barton
c9a79f9a3c WM: handle multiple wheel events from GHOST
Scrolling the mouse wheel fast can generate multiple click-steps
which were ignored by window manager events.

This meant scrolling fast with a trackpad (with "Multi-touch gestures"
disabled) for e.g. would zoom less than the gesture made more slowly.
2024-04-14 17:55:20 +10:00
Campbell Barton
c4745a24b2 GHOST/Wayland: bump xdg_toplevel_listener version from 1 to 6 2024-04-14 17:55:17 +10:00
Campbell Barton
cc9edd2d35 GHOST/Wayland: bump zxdg_output_manager_v1 version from 2 to 3 2024-04-14 17:55:15 +10:00
Campbell Barton
dcec5ce635 GHOST/Wayland: bump wl_compositor_interface version from 3 to 6 2024-04-14 17:55:14 +10:00