This change enables HDR support for wayland as an experimental feature.
It supports both non-linear extended sRGB and un-clamped sRGB.
Windows isn't supported as the HDR settings are not accessible via an
API and would require similar settings that games use to configure the
monitor. Adding those sliders isn't what we would like to add.
Vulkan (working group) is working on new extensions that might change
the shortcomings. It isn't clear yet what the extension will do and what
the impact is for applications that want to use it. When the extension
is out we should review at the situation again.
Pull Request: https://projects.blender.org/blender/blender/pulls/133159
When the colored titlebar decoration style was implemented in
PR #123982, both the titlebar background and foreground were exposed
to the OS backends to be used when styling the Blender window titlebar.
In practice, both backends that implement this decoration style (Win32
and macOS/Cocoa) only use the background color, and they either rely on
the OS to automatically set the text color or use the color HSV value
component to switch between the OS dark/white color.
While it was thought to still keep this value around for a potential
future backend implementation, the color settings parsed to obtain the
titlebar color (`TH_BUTBACK_TEXT_HI`, which wasn't properly suited for
this feature to begin with) has been replaced by `TH_TEXT` in #140726,
which ends up being too bright to be used as titlebar text for most
themes/use cases.
As such, this PR removes this unused titlebar decoration style setting.
Future backends that wishes the implement the colored titlebar
decoration style should either use an existing OS/DE text color or use
a set white/dark text color, similarly to what the Cocoa backend does.
Pull Request: https://projects.blender.org/blender/blender/pulls/140823
e934792169 introduced a workaround for
NVIDIA windows where NVIDIA drivers fail to allocate swapchain images
of minimized windows. The fix was to clamp it to 1,1. With this clamping
AMD driver seems to tell Blender that the created swapchain is suboptimal,
and needs to be recreated. This results in over and over creation of
swapchains as they are all considered sub-optimal.
This PR limits the clamping to NVIDIA drivers only.
Pull Request: https://projects.blender.org/blender/blender/pulls/140112
Descriptor sets/pools are known to be troublesome as it doesn't match
how GPUs work, or how application want to work, adding more complexity
than needed. This results is quite an overhead allocating and
deallocating descriptor sets.
This PR will use descriptor buffers when they are available. Most platforms
support descriptor buffers. When not available descriptor pools/sets
will be used.
Although this is a feature I would like to land it in 4.5 due to the API changes.
This makes it easier to fix issues when 4.5 is released.
The feature can easily be disabled by setting the feature to false if it has
to many problems.
Pull Request: https://projects.blender.org/blender/blender/pulls/138266
`xkb_compose_state_get_utf8` may return multiple characters, while
this isn't supported, prevent a buffer overflow & report a warning.
Co-authored-by: Phoenix Katsch <phoenixkatsch@gmail.com>
Ref: !114612
e.g. stands for "exempli gratia" in Latin which means "for example".
The best way to make sure it makes sense when writing is to just expand
it to "for example". In these cases where the text was "for e.g.", that
leaves us with "for for example" which makes no sense. This commit fixes
all 110 cases, mostly just just replacing the words with "for example",
but also restructuring the text a bit more in a few cases, mostly by
moving "e.g." to the beginning of a list in parentheses.
Pull Request: https://projects.blender.org/blender/blender/pulls/139596
On selected platforms there were some validation errors. It was caused by
platforms that returned a different number of swapchain images then were
requested. In that case the semaphores can get out of sync.
Current mechanism isn't future proof as the max number of images are
statically defined.
For this change the present semaphores is also separated from the frames
to better support out of order swapchain images.
Pull Request: https://projects.blender.org/blender/blender/pulls/139446
GHOST backend didn't use logging. This PR adds an initial ghost.vulkan
logging and improves the reporting of logging in vulkan.
logging can be enabled by `blender --log "gpu.vulkan,ghost.vulkan" --log-level 2`
it shows the optional extensions that are enabled and information about swap chain
events.
Pull Request: https://projects.blender.org/blender/blender/pulls/139437
Qualcomm devices don't support external memory, but there an external
memory pool was still being constructed. This PR skips the creation and
asserts when using external memory on those devices.
Pull Request: https://projects.blender.org/blender/blender/pulls/139326
This change will enable VK_EXT_robustness2.nullDescriptors feature.
It will be able to guarantee that shaders run even when some resources
are not attached.
There should not be any difference with before as this feature is often
the default behavior of GPUs. However it makes the intent more explicit
that failing allocations can still run similar to OpenGL. It is expected
that some tweaks are needed in Vulkan backend.
Pull Request: https://projects.blender.org/blender/blender/pulls/139090
Importing memory is done to often. when memory doens't change the
previous imported memory can be used.
The idea is to keep track of the last used buffer and keep reusing
it until the view/resolution has changed. This should not happen during
a session.
Pull Request: https://projects.blender.org/blender/blender/pulls/138984
Our IME input system relied on passing around pointers to global variables.
However this will not work as the Wayland input handling is multithreaded so the content of the global variable would change while the event loop were reading the data.
Pull Request: https://projects.blender.org/blender/blender/pulls/138871
First time a swap chain is created an incorrect resolution can be
reported back by the driver as the window is still initializing. We
stretch the swap chain to cover to reduce a black line rendering in top
of the window (due to content flipping). Any subsequent frame will not
do stretching to reduce artifacts when resizing the window.
Pull Request: https://projects.blender.org/blender/blender/pulls/138964
- Reduce artifacts during resizing to also recreate the swapchain
when acquire image is suboptimal
- Do not stretch when backbuffer and swapchain have a different size
Pull Request: https://projects.blender.org/blender/blender/pulls/138925
Some mice have an additional horizontal scroll wheel. This patch adds support
for receiving such events. By default it is used to scroll 2D editors left and right.
I originally developed this because I was missing it in the spreadsheet, but it
seems to be useful in many other editors too.
It's supported on Linux (Wayland), Windows and macos.
Pull Request: https://projects.blender.org/blender/blender/pulls/138758
Fixes a few render synchronization soundness issues I discovered when investigating
why resetting the pools after the submission fence in #137305 ended up causing #137395.
1. Ensure the number of submission fences in GHOST_ContextVK is the same
as the number of resource pools in VKThreadData. Otherwise, the
fences might get misaligned, making it difficult to predict which
submission a fence's signal corresponds to.
2. In swapBuffers, pass the current m_frame_data's fence and semaphores
to the Vulkan backend callbacks, rather than the following
m_frame_data. This fixes an observed soundness issue where the fences
were off-by-one. Now, the backend callbacks can be sure that both the
next frame is ready for construction (and it's resources can be
cleaned), and will use the correctly aligned fences and semaphores
during command buffer submission.
3. Do not recreate the m_frame_data's fences during recreateSwapchain.
This would lead to unsoundness immediately following
recreateSwapchain where all the fences are signaled but those frames
might still be in flight.
Pull Request: https://projects.blender.org/blender/blender/pulls/137580
Minimized windows have the resolution of 0,0. The surface supports
swapchains with this resolution, however it doesn't work and leads
to crashes and UBs.
This PR fixes this to use a minimum resolution of 1,1.
Pull Request: https://projects.blender.org/blender/blender/pulls/138750
With two or more monitors of different scales, Blender would fail to
start in some cases when it opened on a monitor at a size that wasn't
a multiple of the monitors scale.
This seemed only to cause problems with LIBDECOR however the buffer size
should always be a multiple of the buffer scale, so ensure its always
valid.
See #135764 for details (a closely related bug).
There are issues with our implementation.
- X11 can flip image incorrectly.
- VVL complains of incorrect usage.
Disabling the extension for now until it is more clear what is not
correct.
This size isn't used unless `has_size_logical` is true,
setting fallback values that aren't used is confusing especially since
output rotation isn't applied - unlike the actual logical size.
Rotated outputs caused a workaround for a bug in GNOME to fail.
Also check the native size since the `size_logical` would always
be set to match the `size_native`.
Check for both `CF_TEXT` and `CF_UNICODETEXT` in
`GHOST_DropTargetWin32::getGhostType` because, unlike for the clipboard,
Windows does not synthesize `CF_TEXT` from `CF_UNICODETEXT` and vice
versa for drag and drop operations. Since `getGhostData` already
supports `CF_UNICODETEXT`, this is all that's necessary to make it work.
I encountered this issue when trying to drag text from Notepad++ into
Blender's text editor.
Pull Request: https://projects.blender.org/blender/blender/pulls/138524
The GHOST_DisplayManager and its implementations are for the most part
unmaintained and almost completely unused in all backends. To clean
things up, and avoid any confusion about how displays are handled in
each respective GHOST backend, this PR completely removes the GHOST
Display Manager, and move the few remaining logic it still held directly
to the corresponding backends.
The backends that were modified (apart from removing the display manager
initialization call from their init) are:
- Win32: `GHOST_SystemWin32::getNumDisplays()` was calling
`m_displayManager->getNumDisplays`, the underlying system metric call
(`GetSystemMetrics(SM_CMONITORS)`) was substituted in place.
- SDL: `GHOST_SystemSDL::createWindow` was calling
`GHOST_DisplayManagerSDL::getCurrentDisplayModeSDL` which returned its
`m_mode` data member by reference. Since none of the
`GHOST_DisplayManagerSDL` member function that modified this data member
were ever called, the variable `memset` initialization call was
substituted in place from the `DisplayManagerSDL` constructor
Pull Request: https://projects.blender.org/blender/blender/pulls/138066
Previously spell checker ignored text in single quotes however this
meant incorrect spelling was ignored in text where it shouldn't have
been.
In cases single quotes were used for literal strings
(such as variables, code & compiler flags),
replace these with back-ticks.
In cases they were used for UI labels,
replace these with double quotes.
In cases they were used to reference symbols,
replace them with doxygens symbol link syntax (leading hash).
Apply some spelling corrections & tweaks (for check_spelling_* targets).