All Projects → st3r4g → Swvkc

st3r4g / Swvkc

Licence: mit
experimental Wayland Vulkan compositor

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Swvkc

Wine Wayland
Wine-wayland allows playing DX9/DX11 and Vulkan games using pure wayland and Wine/DXVK.
Stars: ✭ 284 (+170.48%)
Mutual labels:  vulkan, wayland
Vkmark
Vulkan benchmark
Stars: ✭ 80 (-23.81%)
Mutual labels:  vulkan, wayland
Obs Gnome Screencast
GNOME Screen Cast OBS Studio plugin
Stars: ✭ 80 (-23.81%)
Mutual labels:  wayland
Nova Rs
Nova Renderer, but in Rust
Stars: ✭ 98 (-6.67%)
Mutual labels:  vulkan
Evscript
A tiny sandboxed Dyon scripting environment for evdev input devices that lets you do e.g. xcape in Wayland
Stars: ✭ 91 (-13.33%)
Mutual labels:  wayland
Rust Game Development Frameworks
List of curated frameworks by the **Game Development in Rust** community.
Stars: ✭ 81 (-22.86%)
Mutual labels:  vulkan
Vk raytrace
Ray tracing glTF scene with Vulkan
Stars: ✭ 91 (-13.33%)
Mutual labels:  vulkan
Scrapengine
A very simple real-time Vulkan 3D game engine
Stars: ✭ 80 (-23.81%)
Mutual labels:  vulkan
Demos
Vulkan API crossplatform demos in Go
Stars: ✭ 103 (-1.9%)
Mutual labels:  vulkan
Bgfx
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
Stars: ✭ 10,252 (+9663.81%)
Mutual labels:  vulkan
Lumino
Lumino is a framework for building real-time graphics applications.
Stars: ✭ 97 (-7.62%)
Mutual labels:  vulkan
Waifu2x Ncnn Vulkan
waifu2x converter ncnn version, runs fast on intel / amd / nvidia GPU with vulkan
Stars: ✭ 1,258 (+1098.1%)
Mutual labels:  vulkan
Sway
i3-compatible Wayland compositor
Stars: ✭ 9,854 (+9284.76%)
Mutual labels:  wayland
Substrate
A cross-platform render-graph based rendering system written in Swift
Stars: ✭ 94 (-10.48%)
Mutual labels:  vulkan
Spvgentwo
SpvGenTwo is a SPIR-V building and parsing library written in plain C++17 without any dependencies. No STL or other 3rd-Party library needed.
Stars: ✭ 74 (-29.52%)
Mutual labels:  vulkan
Tiny Rtx
A Vulkan RTX Ray Tracer
Stars: ✭ 99 (-5.71%)
Mutual labels:  vulkan
Gpu Allocator
🦀 Memory allocator written in pure Rust for GPU memory in Vulkan and in the future DirectX 12
Stars: ✭ 84 (-20%)
Mutual labels:  vulkan
Skylane
Stars: ✭ 92 (-12.38%)
Mutual labels:  wayland
Vkgl
Core OpenGL over Vulkan
Stars: ✭ 105 (+0%)
Mutual labels:  vulkan
Practicalvulkan
Repository with code samples for "API without Secrets: The Practical Approach to Vulkan" series of articles.
Stars: ✭ 100 (-4.76%)
Mutual labels:  vulkan

swvkc (temporary name)

swvkc is an experimental Wayland compositor meant to explore the possibility of using Vulkan as a rendering backend.
swvkc prioritizes direct scanout of client buffers when possible. When compositing needs to be done, it renders to the screen with simple copy commands from the Vulkan API.
Some goals/directions of the project:

  • Do the minimal work necessary to display client buffers, do not introduce screen tearing/stuttering or input lag.
  • Stick to minimal window management features.
  • Try to write simple, easy to understand code.

Current status

  • The mechanism to import both shm and dma buffers into Vulkan has been quickly sketched, but it needs to be made more robust (some assumptions about the buffer formats should be removed too).
  • I tried for some time to implement tear-free single-buffered rendering (by restricting rendering to VBlank Intervals) but failed to achieve it consistently. Using double-buffering for now.
  • The Wayland protocol has been implemented partially so only some clients work at the moment.

Current features (or lack thereof)

  • Only one surface is focused and displayed at a time
  • One single client can be run at startup (I suggest a terminal)
  • Focus can be changed (see Usage notes)
  • No popups [coming soon...]
  • No clipboard [coming soon...]

Constraints

  • The hardware is required to support the modern DRM atomic commit interface
  • No XWayland support

Dependencies

swvkc tries to have minimal dependencies. Here is the full list:

  • Wayland
    • wayland-server, the core server API
    • wayland-protocols to generate protocol headers and code
  • DRM
    • libdrm for controlling the screen
    • libdrm_intel (optional) to use the intel buffer manager instead of GBM
  • Vulkan
    • vulkan-loader to load the appropriate vendor-specific libraries
    • the vendor-specific Vulkan implementation (e.g.: vulkan_intel or amdvlk)
  • Mesa
    • gbm for the GBM buffer manager but also required by egl
    • egl [legacy] I have to keep it to provide the wl_drm interface, on which Mesa relies to authenticate against DRM
  • xkbcommon for keyboard standardization, it is practically required by the Wayland spec
  • libudev for GPU discovery and monitor hotplugging (not yet)

Building

After installing meson, run the command:

$ meson build

and install any missing dependency that is reported. Then run:

$ ninja -C build

Upon successful compilation the binary is located inside the build directory.

Usage notes

  • The presence of the environment variable XDG_RUNTIME_DIR is required, and it must point to an appropriate folder (this is automatically set up by systemd or elogind)
  • Provide the required permissions (e.g. by adding the user to group video and input)
  • Start the program from the Linux console (not inside another X11/Wayland compositor)
  • Pass it the client (and its arguments) you want to run
  • Hold the LEFTMETA (Win) key and press ESC to exit
  • To change focus: hold LEFTMETA and start to type the client name until an unambiguous match is found
  • Keyboard settings (such as layout) are set through XKB_DEFAULT* environmental variables.

An issue

Importing memory created by DRM/GBM into Vulkan images is undefined behaviour without the VK_EXT_image_drm_format_modifier extension: even when the image is created with linear layout and without modifiers, there is no way to specify the correct row pitch (please correct me if I'm wrong):
From Issues in https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/chap44.html#VK_EXT_external_memory_dma_buf

How does the application, when creating a VkImage that it intends to bind to dma_buf VkDeviceMemory containing an externally produced image, specify the memory layout (such as row pitch and DRM format modifier) of the VkImage? In other words, how does the application achieve behavior comparable to that provided by EGL_EXT_image_dma_buf_import and EGL_EXT_image_dma_buf_import_modifiers?
+
RESOLVED. Features comparable to those in EGL_EXT_image_dma_buf_import and EGL_EXT_image_dma_buf_import_modifiers will be provided by an extension layered atop this one.

The extension mentioned in the last line is precisely VK_EXT_image_drm_format_modifier. If you are unable to display clients like weston-simple-shm, weston-terminal and firefox, the absence of this extension is likely to be the problem.

Relevant links (tracking progress of useful features)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].