Skip to content

Builder pattern allows invalid usage #163

Description

@Timbals

The generated builders zero out all fields other than ty when created.
Some structures aren't valid with zeroed out fields, but they can be submitted to functions anyway.
Some examples:

  • XrCompositionLayerProjection::viewCount must be greater than 0.
  • XrCompositionLayerProjection::space must be a valid XrSpace handle.
  • XrInteractionProfileDpadBindingEXT::actionSet must be a valid XrActionSet handle
  • generally everything that includes a handle

The solution to this is probably to take all required fields as arguments to the new functions instead of using a builder.
I will work on a PR for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions