Vulkan: Wayland Windowing #113007
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Blocks
#113057 Vulkan: Enable as Experimental Option
blender/blender
Reference: blender/blender#113007
Loading…
Reference in New Issue
No description provided.
Delete Branch "Jeroen-Bakker/blender:vulkan/wayland-surface"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Wayland WSI would crash the system when used. The reason is that the
wayland vulkan WSI doesn't provide windowing support. Vulkan gets full access
to the desktop of the OS and it is the responsibilty of the application to
do the right thing.
For OpenGL Wayland proved basic windowing support using
wayland-egl.h
.Which essentially is a tiny wrapper that keeps track of the window position and
size.
This PR changes a few things to make the Wayland surface usable:
--debug-gpu
.WIP: Vulkan: Wayland Surfaceto Vulkan: Wayland SurfaceVulkan: Wayland Surfaceto Vulkan: Wayland WindowVulkan: Wayland Windowto Vulkan: Wayland Windowing@ -471,6 +474,22 @@ GHOST_TSuccess GHOST_ContextVK::swapBuffers()
return GHOST_kFailure;
}
/* Wayland doesn't provice a WSI with windowing capabilities, therefore cannot detect whether the
picky (provide).
@ -474,0 +479,4 @@
* presenting. */
#ifdef WITH_GHOST_WAYLAND
if (m_wayland_window) {
const bool recreate_swapchain = m_render_extent.width != m_wayland_window->width ||
This comparison should use
std::max(m_wayland_window->width, capabilities.minImageExtent.width)
, else it will continuously recreate the swapchain (not sure if it's an issue in practice, noting for correctness).. For this to be practicalminImageExtent
should probably be stored in the class.Testing over the patch and I agree that using an EGL context with Vulkan is a concern. Even though it works for me, the graphics driver may run callbacks from the EGL functions which could interfere with Vulkan operations.
So unless there a strong reason to keep the EGL window, I'd rather avoid using it for Vulkan.
Attached a patch that only uses EGL with the OpenGL back-end.
Attached patch with requested changes that remove EGL window usage:
wayland_vulkan_no_egl.diff
Some additional notes:
Resizing the window produces some glitches/artifacts though don't show up with OpenGL (not a blocker, but would be good to resolve).
When looking into this patch I checked on how other applications deal with Wayland+Vulkan swap-chains. There looks to be possible optimizations re-creating the swap-chain, https://code.videolan.org/videolan/libplacebo which looks to be a good reference. (used by VideoLan / MPV and deals with this issue too), specifically vk_sw_recreate.
Improvements here can be part of regular development though.
97cf0746f6
to5bf4bb2fe0
I applied your patch and changed a
#if WITH_GHOST_WAYLAND
to#ifdef WITH_GHOST_WAYLAND
.Your changes are aligned to one of my proposals of this patch so seems fine to continue.
During testing I sometimes get a connection lost between ghost and wayland. Unsure when it happens.
This might be something to check in a later stage.
Yes there are some other extensions as well to better support Wayland.
I am aware that wayland is still far from optimal and needs more development.
thanks for looking into and thinking along!