ludic/runtime/native/gl_win_nowin.ll
Orkuncakilkaya 38d4ea72b1 feat(render3d): Vulkan in a macOS window through MoltenVK; window built-ins take a slice's elements; the NEAR_FADE SPIR-V
- a CAMetalLayer on the view (cocoa.ll win_metal_layer), VK_EXT_metal_surface, QuartzCore linked
  with Vk.*; the drawable measured after the layer sets the backing scale
- vk_mac.ll opens MoltenVK directly after any loader: a bundle ships only libMoltenVK.dylib
- a covered window is not presented to (win_visible); one frame in flight on macOS
  (R3D_VK_INFLIGHT), with images, buffers and descriptor pools held until it is done
- win_held / win_mouse / win_pad / win_touch / win_text / win_present pass slice elements (arg_buf):
  every windowed program died on its first input poll
- variants.list and SPIR-V for the three NEAR_FADE foliage programs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 00:52:45 +03:00

69 lines
1.5 KiB
LLVM

; ============================================================================
; gl_win_nowin.ll — the window half of Gl.* in a headless Windows build.
;
; gl.ludic names win_gl_* on its is_windowed() branch. A headless build compiles that
; branch to nothing, but the names still have to resolve; a windowed build links
; win32_gl.ll, which defines them on the real window, in place of this file.
; ============================================================================
define i32 @win_gl_attach() {
entry:
ret i32 0
}
define void @win_gl_resize(i32 %w, i32 %h) {
entry:
ret void
}
define void @win_gl_swap() {
entry:
ret void
}
define i32 @win_gl_scale() {
entry:
ret i32 1
}
define void @win_gl_swap_interval(i32 %n) {
entry:
ret void
}
define void @win_gl_drawable(ptr %out) {
entry:
ret void
}
define void @win_gl_update() {
entry:
ret void
}
define void @win_gl_retina(i32 %on) {
entry:
ret void
}
define void @win_toggle_fullscreen() {
entry:
ret void
}
; headless: no window, so nothing for a graphics API to make a surface on (win32.ll has the real ones)
define ptr @win_native_window() {
entry:
ret ptr null
}
define ptr @win_native_instance() {
entry:
ret ptr null
}
; macOS only (cocoa.ll): the CAMetalLayer MoltenVK presents to
define ptr @win_metal_layer() {
entry:
ret ptr null
}
; the window is always drawn to here (cocoa.ll asks macOS whether it is covered)
define i32 @win_visible() {
entry:
ret i32 1
}
define void @win_set_title(ptr %title) {
entry:
ret void
}