Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-gpu

Source of release 0.5.5

0.5.5 / src / gpu / vulkan / presentation / module.lucb

#==============================================================================================
#
#   module - Vulkan window-system integration
#
#   DESCRIPTION:
#       Native window-system integration is independent of Vulkan rendering. An OS adapter
#       supplies instance extensions, a queue preflight and surface creation. Actual support for
#       the particular surface is checked by shared surface code.
#
#==============================================================================================

func vulkan_presentation_extensions() -> const c.str[]!:
    if platform.windows:
        return vulkan_windows_extensions
    if platform.linux:
        return vulkan_x11_extensions
    error(unavailable, "Vulkan presentation is unavailable on this host")

func vulkan_presentation_support(physical: u64, family: u32) -> bool:
    if platform.windows:
        return vulkan_windows_support(physical, family)
    # X11 needs the display and visual to ask; the surface's own support is
    # checked when it is made (see module comment).
    if platform.linux:
        return true
    return false

func vulkan_presentation_surface(instance: u64, host: window.Presentation) -> u64!:
    if platform.windows:
        return try vulkan_windows_surface(instance, host)
    if platform.linux:
        return try vulkan_x11_surface(instance, host)
    error(unavailable, "Vulkan presentation is unavailable on this host")