feat(runtime): the native window, for a graphics API that makes its own surface

win_native_window / win_native_instance hand a Vulkan swapchain what it is created on: the
HWND and module instance on Windows (VkWin32SurfaceCreateInfoKHR), the game's view on macOS.
Headless builds define both as null (weak on macOS, so a windowed link keeps cocoa.ll's), so
code that asks for them links everywhere and simply finds no window.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-15 10:42:19 +03:00
parent f97d54aa2a
commit 51d82063aa
4 changed files with 48 additions and 0 deletions

View file

@ -1670,3 +1670,16 @@ go:
out:
ret void
}
; ---- the native window, for a graphics API that makes its own surface ------------------
; win32.ll's contract: on macOS the view the game draws in (a Metal-backed layer would hang
; off it); there is no module instance to hand over, so that one is null.
define ptr @win_native_window() {
entry:
%v = load ptr, ptr @W_view
ret ptr %v
}
define ptr @win_native_instance() {
entry:
ret ptr null
}