Skip to content

Guard generated platform extensions with V build flags - #15

Merged
antono3 merged 1 commit into
masterfrom
fix/platform-extension-guards
Sep 22, 2026
Merged

antono3 merged 1 commit into
masterfrom
fix/platform-extension-guards

Conversation

@antono3

@antono3 antono3 commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Generate platform extension declarations behind V compile-time flags derived from the Vulkan registry's platform/protect metadata. The same flag supplies the matching VK_USE_PLATFORM_* C macro. Extension name and spec-version constants remain available by default.

For example, -d vulkan_xlib enables the Xlib types and commands plus VK_USE_PLATFORM_XLIB_KHR; XCB and Wayland use their own flags. This prevents V3 from emitting C function-pointer typedefs that reference platform types unavailable in the active Vulkan headers.

Verification

  • Generated Vulkan bindings locally from Vulkan-Docs v1.3.290 and v1.4.363.
  • Compiled the v1.4.363 published binding with released V 0.5.2, both by default and with -d vulkan_xlib.
  • Passed pinned V3 frontend checks for default and Xlib opt-in modes.
  • The PR CI covers four historical registries, Windows generation, and the pinned V3 frontend.

The checked-in src/vulkan.v snapshot predates the generator's current registry inputs, so it is left unchanged to keep this PR scoped to generator logic. The companion published-binding PR contains the regenerated v1.4.363 output.

@antono3
antono3 merged commit 336e513 into master Sep 22, 2026
7 checks passed
@antono3
antono3 deleted the fix/platform-extension-guards branch September 22, 2026 21:58
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