Commit Graph

2635 Commits

Author SHA1 Message Date
Campbell Barton
a226b14984 Fix #114609: compose key sequences includes continuation keys on Wayland
Suppress characters typed while composing.
2023-11-30 16:42:42 +11:00
Campbell Barton
dfbda79cbd Cleanup: declare pointers const where possible 2023-11-30 16:42:40 +11:00
Campbell Barton
3b5031f1cb Cleanup: use 'r_' prefix for output arguments, order last
Also clarify some naming.
2023-11-30 10:42:18 +11:00
Campbell Barton
278e37f8ce Cleanup: use default initializers for members of GWL_Seat 2023-11-29 16:05:30 +11:00
Campbell Barton
258a083066 Fix #115160: Keyboard layout sometimes ignored on Wayland
When using multiple keyboard layouts, the first layout would always
be used for internal keyboard layout queries.

This meant for e.g. with English layouts QWERTY & DVORAK both active
Control-C always used the QWERTY location for C even when DVORAK was
active.

Resolve by detecting layout changes & run xkb_state_update_mask
on all xkb_state's so internal queries always use the active layout.

Based on !115161, extended to detect layout changes & account for all
internal states.

Co-authored-by: Eugene Kuznetsov <eugene.kuznetsov@amd.com>
2023-11-29 15:18:42 +11:00
Campbell Barton
85e2dd66a0 Fix #113059: file selector shrinks on each display under KDE
Under KDE the initial window size includes the window decorations.
Add a workaround to enforce the requested window size for new windows
under KDE.
2023-11-29 15:18:40 +11:00
Campbell Barton
f000b94a64 Cleanup: declare functions with overrides in GHOST_ContextVK 2023-11-27 10:59:54 +11:00
Campbell Barton
27c660707d Cleanup: spelling in comments, variables 2023-11-27 09:54:36 +11:00
Ray Molenkamp
1b6cd937ff Cleanup: CMake: Modernize bf_imbuf dependencies
Pretty straightforward

- Remove any bf_imbuf paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115425
2023-11-25 23:37:24 +01:00
Ray Molenkamp
b683bcc46c Cleanup: CMake: Modernize bf_intern_clog dependencies
Pretty straightforward

- Remove any bf_intern_clog paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115323
2023-11-24 17:12:24 +01:00
Jeroen Bakker
ec772ed2f1 Vulkan: Timeline Semaphores
This change adds timeline semaphores to track submissions. The previous
implementation used a fence.

Timeline semaphores can be tracked in more detail as it is an counter.
For each submission the counter can be stored locally and when waiting
for completion the counter can be retrieved again and checked if is
known to be succeeded by a higher value.

The timeline semaphore is stored next to the queue and can also be used
to synchronize between multiple contexts.

Pull Request: https://projects.blender.org/blender/blender/pulls/115357
2023-11-24 15:23:46 +01:00
Jeroen Bakker
d09d93febf Vulkan: Store Vertex, Index and Storage Buffers on Device Memory
Currently all buffer types were stored in host memory, which is visible to the GPU as well.
This is typically slow as the data would be transferred over the PCI bus when used.

Most of the time Index and Vertex buffers are written once and read many times so it makes
more sense to locate them on the GPU. Storage buffers typically require quick access as they
are created for shading/compute purposes.

This PR will try to store vertex buffers, index buffers and storage buffers on device memory
to improve the performance.

Uniform buffers are still located on host memory as they can be uploaded during binding process.
This can (will) reset the graphics pipeline triggering draw calls using unattached resources.

In future this could be optimized further as in:
* using different pools for allocating specific buffers, with a fallback when buffers cannot be
  stored on the GPU anymore.
* store uniform buffers in device memory

Pull Request: https://projects.blender.org/blender/blender/pulls/115343
2023-11-24 13:52:48 +01:00
Jeroen Bakker
27fdfb6538 Vulkan: Memory Statistics
This PR shows the memory footprint in the statusbar when activated.
Only memory allocated on the VRAM is counted. Memory allocated on host
memory is not counted.

![image](/attachments/33cedc89-9ada-4c0a-9a94-6c1b3e22b64b)

Pull Request: https://projects.blender.org/blender/blender/pulls/115184
2023-11-20 14:08:19 +01:00
Jesse Yurkovich
9eba3902c9 Fix: Allow Win32 clipboard to properly handle large images
The current code ran afoul of various arithmetic overflow conditions
when attempting to either Copy out or Paste in large images that would
overflow either the naive `w * h * 4` expression or the size of what the
DibV5 header allowed (DWORD, uint32_t).

Pull Request: https://projects.blender.org/blender/blender/pulls/115018
2023-11-18 22:46:41 +01:00
Germano Cavalcante
952d74ebbb Fix #114867: 'i' key in Turkish layout is marked as 'EVT_QUOTEKEY'
Different from most layouts. The Turkish keyboard layout treats the `i` as the lowercase `İ` and the `ı` as the lowercase `I`.

So we have 2 different types of i: `ı` and `İ`. And two different I key positions on the keyboard.

This key with a different position is mapped as special and returns the corresponding `event->type` of the US keyboard `"` (`EVT_QUOTEKEY`).

The apparently most appropriate event for this key would be `EVT_IKEY`.

This type of change needs to be treated with care, as it may alter other shortcuts that are already common to Turkish users.

Pull Request: https://projects.blender.org/blender/blender/pulls/114917
2023-11-15 15:45:45 +01:00
Clément Foucault
3ead36a8ba GHOST: Cleanup: Remove GHOST_OPENGL_ALPHA
This is never define and has no use in current blender.

If we want to keep this functionality, we should
at the very least rename it to `GHOST_WINDOW_ALPHA`.

Pull Request: https://projects.blender.org/blender/blender/pulls/114815
2023-11-14 20:24:55 +01:00
Jeroen Bakker
4ecd6abf78 Vulkan: Make Anisotropy Sampling Optional
Anisotropy samplers are optional in Vulkan. This change will disable
anisotropy samplers when the feature isn't available on the device.

The support for anisotropy samplers is around 90% so would not expect
any compatibility issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/114833
2023-11-14 12:24:46 +01:00
Campbell Barton
690d427045 Merge branch 'blender-v4.0-release' 2023-11-09 17:01:03 +11:00
Campbell Barton
391b5ac93c Fix uninitialized pending actions for Windows under Wayland
A windows pending actions wasn't cleared for new windows.
Although I'm not aware of user visible bugs, this prevents
unpredictable updates for new windows.
2023-11-09 16:57:06 +11:00
Campbell Barton
aaf05c2497 Cleanup: various C++ changes (use nullptr, function style casts) 2023-11-07 11:35:16 +11:00
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
Brecht Van Lommel
39107b3133 Revert changes from main commits that were merged into blender-v4.0-release
The last good commit was 8474716abb.

After this commits from main were pushed to blender-v4.0-release. These are
being reverted.

Commits a4880576dc from to b26f176d1a that happend afterwards were meant for
4.0, and their contents is preserved.
2023-10-30 21:40:35 +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]: 3eda5a114f
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