Skip to content

glue: add Vulkan renderer variant for Windows (VK_KHR_win32_surface) - #36

Merged
igagis merged 3 commits into
cppfw:mainfrom
igagis-bot:vulkan-windows-glue
Nov 25, 2026
Merged

igagis merged 3 commits into
cppfw:mainfrom
igagis-bot:vulkan-windows-glue

Conversation

@igagis-bot

Copy link
Copy Markdown
Contributor

Adds a Vulkan build variant of the Windows platform glue, mirroring the existing Linux (xorg/wayland) Vulkan glue:

  • window: new constructor that does not create a WGL context (the Vulkan device owns the swapchain); expose the HWND
  • application: create the Vulkan instance (VK_KHR_SURFACE, VK_KHR_WIN32_SURFACE), physical device and logical device (VK_KHR_SWAPCHAIN); create a VK_KHR_win32_surface from the window handle in make_window() and construct the Vulkan render context
  • build: ruisapp-vulkan CMake variant and test app on Windows, ruisapp-vulkan rule in the makefile

Adds a Vulkan build variant of the Windows platform glue, mirroring the
existing Linux (xorg/wayland) Vulkan glue:

- window: new constructor that does not create a WGL context
  (the Vulkan device owns the swapchain); expose the HWND
- application: create the Vulkan instance (VK_KHR_SURFACE,
  VK_KHR_WIN32_SURFACE), physical device and logical device
  (VK_KHR_SWAPCHAIN); create a VK_KHR_win32_surface from the window
  handle in make_window() and construct the Vulkan render context
- build: ruisapp-vulkan CMake variant and test app on Windows,
  ruisapp-vulkan rule in the makefile
Comment thread build/cmake/CMakeLists.txt Resolved
Comment thread build/cmake/CMakeLists.txt Resolved
Comment thread src/ruisapp/glue/windows/window.cxx Resolved
- cmake: drop the name variable, use PROJECT_NAME in place
- cmake: explicit WIN32 and EMSCRIPTEN branches; FATAL_ERROR on unknown OS
- windows: rename make_device() to make_vulkan_device()
- windows: explain the 1x1 hidden window in a comment (same as wayland)
- makefile: do not build the vulkan variant (the mingw CI has no vulkan
  headers; the CMake/vcpkg build is the one that provides it)
The Vulkan renderer does not use a shared GL context, so the
shared_gl_context_native_window member and the 1x1 dummy window it
required are dropped from the Vulkan build. The native_window
constructor no longer takes the shared context pointer.
@igagis
igagis merged commit 6965bae into cppfw:main Nov 25, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants