Skip to content

chore: upgrade OpenXR-SDK 1.1.54 and fix build issues#205

Merged
Ralith merged 6 commits into
Ralith:masterfrom
MungbeanOuO:feature/dependency-update
Jan 15, 2026
Merged

chore: upgrade OpenXR-SDK 1.1.54 and fix build issues#205
Ralith merged 6 commits into
Ralith:masterfrom
MungbeanOuO:feature/dependency-update

Conversation

@MungbeanOuO

@MungbeanOuO MungbeanOuO commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

Notes regarding Generator Workarounds:

Polymorphic Builders Exclusion: I've temporarily excluded XrFutureCompletionBaseHeaderEXT. It seems the SDK update introduced a need for manual handle processing here, which is out of scope for this PR.

Android Structs: Excluded XrRaycastHitResultANDROID from simple_structs generation due to re-export conflicts.

Default Trait: Added logic to derive Default for enums (needed for SpatialBufferEXT), but had to patch XrNegotiateLoaderInfo manually to prevent it from cascading incorrectly.

Questions:

Uuid Usage: I noticed Uuid and UuidEXT are used separately in lib.rs. Is this the intended behavior or should they be unified?

Warnings: There is currently a dead_code warning on InteractionRenderModelsChangedEXT (field 0 never read). I plan to address this in a follow-up commit, but heads-up if you see it in CI.

@Ralith

Ralith commented Jan 7, 2026

Copy link
Copy Markdown
Owner

Uuid Usage: I noticed Uuid and UuidEXT are used separately in lib.rs. Is this the intended behavior or should they be unified?

I'm not sure what you're referring to here. I don't see any references to Uuid in any lib.rs. UuidEXT appears to be a type alias to Uuid, so I'm not sure there's anything to unify? If you're asking whether the reexport situation is intentional, not AFAIK; reexporting both and marking the EXT version as deprecated (and perhaps hidden) is probably the friendly thing to do.

Update the generator to handle new types and requirements introduced in OpenXR SDK 1.1.54.

Generator changes:
- Derive `Default` for enums with a `0` value (required by `SpatialBufferEXT`).
- Relax `has_non_default` check for enums; added workaround for `XrNegotiateLoaderInfo` to avoid unwanted implementations.
- Fix identifier normalization for `XrSpatialMarkerArucoDict` and `XrSpatialMarkerAprilTagDict` (prevents invalid starting digits).
- Exclude `XrRaycastHitResultANDROID` re-exports in high-level generation to avoid conflicts.
- Temporarily exclude `XrSpatialAnchorsCreateInfoBaseHeaderML` and `XrFutureCompletionBaseHeaderEXT` from polymorphic builders due to complexity changes.

Manual adjustments:
- Update `sys/lib.rs` and `openxr/lib.rs` with necessary use statements and basetype workarounds.
- Refactor `SpaceUserIdFB` and `FutureEXT` to use the `wrapper!` macro.
@MungbeanOuO MungbeanOuO force-pushed the feature/dependency-update branch from 961bc88 to a7bcba2 Compare January 7, 2026 06:32
@MungbeanOuO

Copy link
Copy Markdown
Contributor Author

Thanks for the clarification!

To explain my original confusion: I noticed that generated.rs contains references to both Uuid and UuidEXT separately, which seems to stem from the upstream XML specification mixing them.

For this PR, I'll proceed with:

  1. Using Uuid as the primary type.
  2. Re-exporting UuidEXT as a type alias to Uuid without the deprecation attribute.

Since I'm not yet sure how strictly the generated code relies on the EXT variant (given the XML situation), I'd prefer to land this safely first. I will investigate the proper way to handle deprecation and unification in a future iteration.

This commit addresses several warnings and compilation errors across the crate:

1. Generator:
   - Modified `generate_reader` to conditionally apply `#[allow(dead_code)]` to struct fields when no getters are generated.
   - This fixes the "field 0 never read" warning observed in empty event structs like `InteractionRenderModelsChangedEXT`.

2. Refactor:
   - Changed `UuidEXT` from a direct re-export to a type alias of `Uuid`.
   - Note: The `#[deprecated]` attribute is currently commented out to prevent internal warnings, pending a future cleanup.

3. Fixes:
   - Added missing `unsafe` blocks in `opengles.rs` required by recent edition/compiler updates.
   - Added hardcoded `AIBinder` definition in `platform.rs` to fix build errors.
@MungbeanOuO MungbeanOuO changed the title Upgrade OpenXR-SDK 1.1.54 [WIP] chore: upgrade OpenXR-SDK 1.1.54 and fix build issues Jan 9, 2026
@MungbeanOuO MungbeanOuO marked this pull request as ready for review January 9, 2026 06:48
Comment thread generator/src/main.rs Outdated
Comment thread generator/src/main.rs
Comment thread generator/src/main.rs Outdated
Comment thread generator/src/main.rs
Comment thread openxr/src/lib.rs Outdated
Comment thread openxr/src/lib.rs Outdated
- refactor(parser): pre-compute `has_zero` for Enums during parsing to avoid redundant iterations in generator.
- refactor(lib): implement `Default` for `Version` (0.0.0), removing the need for `XrNegotiateLoaderInfo` special case in generator.
- docs: add explanation for filtering Android-specific types due to OS/Vendor distinction issues.
- docs: explain `dead_code` suppression for event structs without payload fields.
- cleanup: remove redundant `UuidEXT` alias and commented-out code.
@MungbeanOuO

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review! I've addressed all comments.

Summary of changes:

Refactor: Pre-computed has_zero in the parser to optimize generator logic.

Refactor: Implemented Default for Version in lib.rs, removing the special handling for XrNegotiateLoaderInfo.

Docs: Added explanations for dead_code suppression and Android type filtering.

Cleanup: Removed redundant aliases and deprecated code.

@MungbeanOuO MungbeanOuO requested a review from Ralith January 12, 2026 09:21

@Ralith Ralith left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread generator/src/main.rs Outdated
Comment thread generator/src/main.rs
@Ralith Ralith merged commit b0174e8 into Ralith:master Jan 15, 2026
6 checks passed
@Ralith

Ralith commented Jan 15, 2026

Copy link
Copy Markdown
Owner

Published as 0.21.1.

@MungbeanOuO MungbeanOuO deleted the feature/dependency-update branch January 16, 2026 02: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