Commit Graph

2614 Commits

Author SHA1 Message Date
Jeroen Bakker
e7148fc28e Vulkan: Enable Optional Vulkan 12 Features
`shaderOutputLayer` and `shaderOutputViewportIndex` are optional in
Blender, but when used they should be activated on physical device level.
This wasn't the case and when used the validation layer reported an error.

This PR activates the features when creating the device if the features
are available.

Pull Request: https://projects.blender.org/blender/blender/pulls/114303
2023-10-31 08:37:31 +01:00
Campbell Barton
28394dd42e Merge branch 'blender-v4.0-release' 2023-10-25 21:20:28 +11:00
Campbell Barton
8e38cd9b8f Correct potential error in recent Wayland/LIBDECOR window size change
While the fix worked in my tests, the compositor is allowed to ignore
a requested window state change which could have entered an eternal
loop. Avoid this by limiting the while loop to 2x round-trips.
2023-10-25 21:17:31 +11:00
Campbell Barton
ab1be3bd48 Merge branch 'blender-v4.0-release' 2023-10-25 20:47:41 +11:00
Campbell Barton
dcaeed7522 Fix Wayland/LIBDECOR size on startup when maximized
Even though the window was maximized, the non-maximized size was used.
Since the display size was used the window would be slightly larger,
clipping the status bar in GNOME.
2023-10-25 20:42:27 +11:00
Campbell Barton
6ba74de1f2 Merge branch 'blender-v4.0-release' 2023-10-25 15:43:27 +11:00
Campbell Barton
3638aa5b77 Fix Wayland/LIBDECOR assuming a normal window state on startup
As the window state will have been initialized, read the current window
state instead of assuming normal so changes are properly detected.

Also note that the cause of #107314 has been fixed up-stream.
2023-10-25 11:21:17 +11:00
Campbell Barton
63dc379dcc Merge branch 'blender-v4.0-release' 2023-10-24 11:44:09 +11:00
Campbell Barton
ca32ba33ae Fix #113961: Incorrect window size for new windows on Wayland
When the output wasn't fractionally scaled but the compositor supports
fractional scaling, new windows were smaller than requested.

Caused by [0] which was incorrectly calculating the non-fractional scale
used by LIBDECOR (which isn't accessible via it's API).

Resolve by only using fractional scaling logic when outputs
have a fractional component.

[0]: 3eda5a114f14d14e1a454d97c9e5496247fe6c21
2023-10-24 11:42:18 +11:00
Sebastian Parborg
b77209e617 Merge branch 'blender-v4.0-release' 2023-10-23 15:03:43 +02:00
Sebastian Parborg
72d011a87c Fix: Missing null pointer check in wayland xkb code
Each locale is not guaranteed to have a compose file.
We have to check if the generated table is a null pointer.
2023-10-23 15:00:32 +02:00
Campbell Barton
c8c2343b4b Cleanup: spelling in comments 2023-10-23 10:09:05 +11:00
Campbell Barton
2864c20302 Cleanup: various C++ changes (use nullptr, function style casts) 2023-10-21 21:17:57 +11:00
Sergey Sharybin
21c8af467d Cleanup: Convert winfunc and utfconv to C++
Basically, the intern/utfconv directory, as well as users of
these headers.

Pull Request: https://projects.blender.org/blender/blender/pulls/113901
2023-10-20 10:27:31 +02:00
Campbell Barton
eaffcee074 Cleanup: remove printf left in by mistake 2023-10-20 17:51:33 +11:00
Campbell Barton
6f197f6df3 Merge branch 'blender-v4.0-release' 2023-10-20 14:00:41 +11:00
Campbell Barton
57a5c6c4be GHOST/Wayland: add support for dead keys via xkb_compose
Dead keys worked in X11 but not Wayland (or XWayland),
use XKB APIs to support composition.

Resolve #113724.
2023-10-20 13:51:08 +11:00
Campbell Barton
661da427d7 Build: attempt to fix linking error WITH_INPUT_IME & GHOST
Always define WITH_INPUT_IME when IME is enabled so both WM and GHOST
can rely on functions existing when enabled from CMake.
2023-10-19 21:05:27 +11:00
Campbell Barton
a38a49b073 GHOST/Wayland: IME support using the text-input protocol
Tested with IBUS on GNOME 45.
Added a capabilities flag to GHOST since support for IME works on
Wayland but not on X11, so runtime detection is needed.
2023-10-19 17:29:32 +11:00
Campbell Barton
d288b73062 Merge branch 'blender-v4.0-release' 2023-10-18 14:40:42 +11:00
Campbell Barton
df6cedeee1 Merge branch 'blender-v4.0-release' 2023-10-18 14:40:39 +11:00
Campbell Barton
176218fce1 Merge branch 'blender-v4.0-release' 2023-10-18 14:40:34 +11:00
Campbell Barton
d35dd83701 Merge branch 'blender-v4.0-release' 2023-10-18 14:40:31 +11:00
Campbell Barton
3eda5a114f Fix Wayland/LIBDECOR window size on startup without a hack
The USE_LIBDECOR_FRACTIONAL_SCALE_HACK worked on my system but made
window size issues worse in older versions of GNOME, see: #109194.

Replace the hack with logic to set the window size using frational
scaling information from the output.
2023-10-18 14:37:12 +11:00
Campbell Barton
bafb36f8bc Fix glitches resizing windows on Wayland, LIBDECOR & fractional scaling
When fractional scaling is used, window sizes from LIBDECOR are still
divided by the window-decorations internal buffer scale which doesn't
match the GHOST window (always 1 in the case of fractional scale).

Also resolve glitches caused by recalculating the window size when
no size change was intended. In this case reuse LIBDECOR's internal
size so there are never any changes (caused by rounding for e.g.).
2023-10-18 14:37:11 +11:00
Campbell Barton
3ad21b2169 Fix invalid surface size under Wayland when GHOST set the window size
When the window manager set the window size, there were no checks
the size is a multiple of the buffer scale (a requirement for Wayland).

This meant setting the window size could exit Blender without warning
if an invalid window size was set.
2023-10-18 14:37:09 +11:00
Campbell Barton
46159c131d Cleanup: add rounding utilities for GHOST/Wayland
Prepare for fixes that use add additional rounding.
2023-10-18 14:37:08 +11:00
Campbell Barton
89efeedd5b Merge branch 'blender-v4.0-release' 2023-10-16 10:35:45 +11:00
Campbell Barton
db36c9f204 Merge branch 'blender-v4.0-release' 2023-10-16 10:35:42 +11:00
Campbell Barton
f95ee3e871 Fix incorrect window decoration size with Wayland & libdecor on startup
When fractional scaling was used with libdecor the window decorations
would not match the window size on startup, drawing small and on top
of Blender's window.
While there are still glitches with fractional-scaling & libdecor
(which doesn't support fractional scaling),
see #109194 this at least resolves one of the worst issues.
2023-10-16 10:01:00 +11:00
Campbell Barton
e8f2c3e45f GHOST/Wayland: don't preempt new windows buffer fractional scale
When a new window is created the final buffer scale isn't known
so setting the buffer scale assuming the final state was just a guess
and only had the minor advantage of preventing rounding the window size
on startup.

Removing this to resolve a bug with LIBDECOR & fractional scaling
relating to #109194 (will commit separately).
2023-10-16 09:50:44 +11:00
Jeroen Bakker
8ebe7d98d7 Vulkan: Remove Renderdoc Extension
When running Blender inside renderdoc an extension can be used to print
from any shader stage to the console. This is useful during developing,
but not so during running/triaging. For now we remove the extension to
not confuse by incorrect error messages.

Pull Request: https://projects.blender.org/blender/blender/pulls/113654
2023-10-13 11:35:56 +02:00
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
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
Campbell Barton
5e7a85539d Merge branch 'blender-v4.0-release' 2023-10-10 11:06:29 +11:00