mcpp index

compat.vulkan

#include

Khronos Vulkan loader — static ICD-dispatch library

#include <vulkan/vulkan.h>
mcpp add compat.vulkan@1.4.357.0

Usage

From this repository's own test project — built and run by CI, not written for the website.

// Behavioral test — verify compat.vulkan builds a working loader and that a
// consumer can link its trampolines.
//
// Everything asserted here is answered by the LOADER itself, before any ICD is
// involved, so it is meaningful on a CI runner with no GPU and no driver.
// That constraint is sharper than it looks: the loader advertises the WSI
// surface extensions only when some ICD supports them, so `VK_KHR_surface` is
// legitimately ABSENT on a driverless machine and asserting on it would just be
// testing the runner's hardware.
//
// HAVE_VULKAN_LOADER is set by THIS project's own [target.'cfg(...)'.build]
// cxxflags, because compat.vulkan has no windows entry. A consumer that keys
// its source off a dependency's presence has to declare that itself.
#if defined(HAVE_VULKAN_LOADER)
#include <vulkan/vulkan.h>
#endif
import std;

#if !defined(HAVE_VULKAN_LOADER)
int main() {
    std::println("compat.vulkan: skipped (no windows build — static loader unsupported upstream)");
    return 0;
// …

tests/examples/vulkan/tests/loader.cpp · project tests/examples/vulkan

Build

targets
vulkan (lib)
language
c++23
C standard
c11
import std
no
include dirs
*/loader, */loader/generated, mcpp_generated

Sources (14)

  • */loader/allocation.c
  • */loader/cJSON.c
  • */loader/debug_utils.c
  • */loader/extension_manual.c
  • */loader/gpa_helper.c
  • */loader/loader.c
  • */loader/loader_environment.c
  • */loader/loader_json.c
  • */loader/log.c
  • */loader/settings.c
  • */loader/terminator.c
  • */loader/trampoline.c
  • */loader/unknown_function_handling.c
  • */loader/wsi.c

Generated files

  • mcpp_generated/mcpp_vulkan_paths.h
  • mcpp_generated/vulkan_import_anchor.c

Versions

VersionPlatforms Mirrorssha256
1.4.357.0 latest LinuxWindowsmacOS CN GLOBAL 54f2537df223…