Skip to content

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

Merged
Exanite merged 234 commits into
develop/3.0from
feature/openxr-multiplatform-generation
Nov 7, 2026
Merged

Exanite merged 234 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

I started working on the bindings regeneration workflow here since I needed to regenerate bindings on Mac, which I don't have a device for. The work in this PR is functional, but isn't the final design. The final design is implemented in #2635 and #2634.

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
  • Reapply OpenXR compile error workaround since ClangSharp hasn't updated yet.
  • Update ClangSharp
  • Regenerate using CI
  • 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
    • Also fix incorrect input SourceSubdirectory for Vulkan AddApiProfiles
  • Regenerate using CI

Moved to later PRs

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 dde50e8

@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 mentioned this pull request Nov 7, 2026
12 tasks
@Perksey
Perksey enabled auto-merge (squash) November 7, 2026 17:20
* Support wildcard for specifying all jobs

(cherry picked from commit ed742c6b585d2bf7e736759c7a08d8f7fe71de08)

* Disable bindings/native workflows now that they have been reimplemented on main

* Update native build reminder wording

* Include required submodules as part of native/workflow-matrix output

* Remove submodule init from native build scripts (now handled by CI)

* Revert "Remove submodule init from native build scripts (now handled by CI)"

This reverts commit 127c3de.

* Remove submodules from native/workflow-matrix output since native submodules need more specific handling

Their build system might rely on git history, etc.

* Add workflow-affected-comment and workflow-dependencies native scripts

* Add similar workflow deps/comment scripts for bindings

* Add ability to specify additional dependencies per job

* Add dependencies to each bindings job

* Add script for testing workflow scripts

* Add snapshot testing to workflows scripts

* Adjust snapshot output, but apparently pwsh iteration order isn't stable

* Use ordered sets

* Work on check affected workflow

* Add artifact upload steps

* Only trigger check affected on synchronize

* Wrap all job definitions with a jobs object

* Add support for shared dependencies

* Fix dependency paths format

* Remove unnecessary env var

* Fix issue where workflow-reminder did not parse JSON

(cherry picked from commit 75bada7)

* Remove old code

* Also output the message to logs for debugging

* Fix wrong script

Probably explains why it didn't work doesn't it

* Always upload an artifact since download artifact fails on missing artifact

(cherry picked from commit 9b76580)

* Revert "Always upload an artifact since download artifact fails on missing artifact"

This reverts commit f69e6bd.

* Also upload PR number

(cherry picked from commit 8098981)

* Use overwrite: true

(cherry picked from commit 80fe34c)

* Adjust reminder message wording

* Adjust formatting to avoid ugly line breaks

(cherry picked from commit a9a8743)

* Adjust wording again

* Format publish site

* Format dotnet workflow

* Update snapshot

* Clarify that push permissions are required to run the command

* Edit build-system.md wording/formatting

* Update changelog now that OpenXR bindings are complete

Still untested though.

* Further edit wording in build-system.md

* Work on writing the new natives/bindings workflow doc section

* Finish updating the build-system docs to explain the new native/bindings workflows

* Add also a "Creating new bindings projects" section

* Remove "isolated" job that outputs the PR number since it's not actually isolated

* Use matrix in check-affected.yml

* Use Silk.NET instead of Silk in reminder comment and update snapshot

* Shorten workflow script names since the folder name implies that they are workflow scripts

* Work on prerequisites scripts and alphabetize test calls

* Enable snapshot testing for prerequisites script

* Fix duplicate lines in test snapshot

* Implement native/prerequisites.ps1

* Remove submodule inits from the individual build scripts since they are handled centrally now

* Remove todos since we now validate the PR number given on the workflow_run side

* Remove push permission requirement since we decided it was unnecessary

* Add step for installing dependencies and update snapshot

* cd to repo root to avoid relative path issues

* Fix $command not being ran

* Reapply "Rename bindings output folders for consistency"

This reverts commit 9191d8c.
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Silk.NET native build reminder

Some of the native builds are likely affected by this PR.
Please rebuild these by posting a comment with /native OpenAL-Soft SDL.

If you believe this to be in error, then please write a comment explaining why and ignore this reminder.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Silk.NET bindings regeneration reminder

Some of the bindings are likely affected by this PR.
Please regenerate these by posting a comment with /bindings OpenAL OpenCL OpenGL OpenXR SDL Vulkan.

If you believe this to be in error, then please write a comment explaining why and ignore this reminder.

Apparently you don't need them for GitHub and Discord doesn't render them properly.
I think literally everything else uses latest instead of a locked version and there's seemingly no reason not to.
I'm guessing this was a copy-paste/typo.
@Exanite
Exanite disabled auto-merge November 7, 2026 19:13
@Exanite
Exanite merged commit 305a88c into develop/3.0 Nov 7, 2026
19 checks passed
@Exanite
Exanite deleted the feature/openxr-multiplatform-generation branch November 7, 2026 19:23
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Silk.NET Development Tracker Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants