Skip to content

[3.0] Add multi-platform generation and finish initial OpenXR bindings - #2628

Draft
Exanite wants to merge 199 commits into
develop/3.0from
feature/openxr-multiplatform-generation
Draft

Exanite wants to merge 199 commits into
develop/3.0from
feature/openxr-multiplatform-generation

Conversation

@Exanite

@Exanite Exanite commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary of the PR

This PR adds support for multi-platform scraping to ClangScraper and updates the Khronos bindings to include platform-specific APIs. Notably, this means finishing the initial OpenXR bindings and making it so that the OpenXR bindings are functional.

Related issues, Discord discussions, or proposals

Discord thread for this PR: https://discord.com/channels/521092042781229087/1560213833249726474

Further Comments

Original comments from my OpenCL/XR PR (#2590):

Most Khronos APIs have additional headers that interop with platform-specific/other Khronos/other graphics APIs.
OpenXR notably will not work without these additional headers, but generating bindings for these headers requires additional work. See this to understand the planned solution: https://discord.com/channels/521092042781229087/587346162802229298/1529139068288503900

Tasks

  • Add support for multi-platform scraping to ClangScrape
    • This might be easier than it sounds since we can now run the same mod multiple times with different configs
  • Fix scrape vs cache inconsistencies
    • Investigate members being generated in different orders (probably due to file ordering)
    • Investigate SupportedApiProfile differences
  • Investigate why this diff has additions not equal to deletions. I only did a rename here so they should be equal. 3a10ed2
    • AddApiProfiles adds profiles based on source directory. I renamed the directory, but not the AddApiProfiles config. Fixed.
  • Add bindings regeneration workflow
    • Cache population
    • Bindings regeneration
    • Add ability for ClangScraper to abort the job if a certain command line arg is provided
      • This is intended for cache regeneration.
      • Note, this should abort the job, not the entire process since other jobs might need to finish populating their caches.
    • Add option to run ClangScraper with cache only.
      • This is to remove the need to download submodules and dependencies during the final bindings regeneration step since the cache should have been populated already.
    • Auto commit and push
    • Figure out how we want to handle cache updates for multiple jobs. One Github Actions runner per bindings job?
  • Make sure to handle field merging in BakeSourceSets
    • Expand the type and initializer check to all fields, not just struct fields
  • Remove redundant settings in RSPs used by SilkTouch
    • Rename headers for clarity
    • Remove child output folder since that folder is ignored by BakeSourceSets
  • Ensure ClangScraper caches are deterministic. Currently caches always change after rerunning the generator.
  • Fix SDL test project. Don't know why the type references in the test project are not renamed in CI, but seems fine locally. See commit: github.com/[3.0] Add multi-platform generation and finish initial OpenXR bindings #2628/commits/cd83ade65c6c69ff00f064682af8a34d332c3532
  • Disable OpenXR DirectX integration since we don't have any Win32/DirectX bindings yet.
    • Re-enabled since we want to map these types to primitives
    • Map OpenXR DirectX types to primitives
  • Regenerate using CI
  • Self code review
  • Revert 9191d8c6fc - Revert "Rename bindings output folders for consistency" and regenerate after code review. It leads to a lot of diff noise due to folder renames.
    • Also revert 8a0e24bb92 - Temporary: Rename xr folder to OpenXR to avoid diff noise

Moved to later PR

Native/bindings regeneration workflows (from tracker):

  • Prevent native builds from triggering unnecessarily when the PR description is edited
    • Native builds should only trigger once. If the last commit in the PR is from the native builds workflow, it should not run again.
  • Figure out how to make our CI workflows work with forks.

Native/bindings regeneration workflows (from this PR, may duplicate with above):

  • Snapshot the commit hash and ensure all jobs use the same one
  • Trigger using PR comment instead of workflow dispatch
  • Ensure works for forks

Platform integrations:

  • Add OpenXR DirectX integration back once we have Win32/DirectX bindings.
  • Add platform integration headers for each API
    • Not exhaustive, but I'll start with these
    • OpenXR
    • OpenCL
    • Vulkan

Validation:

  • Investigate OpenCL empty enums
    • Most of these should be populated once the other headers are included
    • cl_command_buffer_info_khr
    • cl_command_buffer_properties_khr
    • cl_command_buffer_state_khr
    • cl_command_buffer_update_type_khr
    • cl_command_properties_khr
    • cl_compiler_mode_altera
    • cl_d3d10_device_set_khr
    • cl_d3d10_device_source_khr
    • cl_d3d11_device_set_khr
    • cl_d3d11_device_source_khr
    • cl_dx9_device_set_intel
    • cl_dx9_device_source_intel
    • cl_gl_context_info
    • cl_gl_object_type
    • cl_gl_texture_info
    • cl_layer_properties
    • cl_media_adapter_set_khr
    • cl_media_adapter_type_khr
    • cl_mutable_command_info_khr
    • cl_mutable_dispatch_asserts_khr (Flags so by default 1 None member)
    • cl_mutable_dispatch_fields_khr (Flags)
    • cl_platform_command_buffer_capabilities_khr (flags)
    • cl_queue_properties_khr
    • cl_semaphore_reimport_properties_khr
    • cl_svm_alloc_properties_khr
    • cl_svm_capabilities_khr (Flags)
    • cl_svm_free_flags_khr (Flags)
    • cl_svm_free_properties_khr
    • cl_svm_pointer_info_khr
    • cl_va_api_device_set_intel
    • cl_va_api_device_source_intel
  • Also investigate any other empty enums, if there are any. Make sure to check for [Flags] enums as well, since these will not be empty and instead have a single None member.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

File Coverage
All files 22% ✅

Minimum allowed coverage is 0%

Generated by 🐒 cobertura-action against f10177d

@Exanite
Exanite force-pushed the feature/openxr-multiplatform-generation branch from 2b08755 to ccaa202 Compare October 15, 2026 08:28
@Exanite
Exanite changed the base branch from develop/3.0 to feature/silktouch-config-overhaul October 18, 2026 00:52
@Exanite Exanite mentioned this pull request Oct 25, 2026
21 of 26 tasks
Base automatically changed from feature/silktouch-config-overhaul to develop/3.0 October 25, 2026 20:13
@Exanite

Exanite commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

Going to be a bit of churn until I figure out why SDL's test project types are not getting renamed properly. I can't reproduce the problem locally for some reason.

Exanite and others added 27 commits October 28, 2026 00:11
This reverts commit 4d28a14.

Revert "Dump test project doc states"

This reverts commit 137bed0.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants