KhronosGroup / KhronosGroup/OpenXR-Docs

Can length annotations for the output sizes of returned arrays be added?

Open
#69 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement question synced to gitlab waiting for reporter
Dominant language
Python
Stars
181
Forks
74
PR merge metrics
No merged PRs in 30d

Description

For example the spec says here that the length of displayRefreshRates is displayRefreshRateCapacityInput, but this doesn't tell the whole story after the function is called! Is it possible to expand the spec with information about how many values in the array are valid (i.e. displayRefreshRateCountOutput) after the call returns?

      <command successcodes="XR_SUCCESS,XR_SESSION_LOSS_PENDING" errorcodes="XR_ERROR_INSTANCE_LOST,XR_ERROR_SESSION_LOST,XR_ERROR_RUNTIME_FAILURE,XR_ERROR_HANDLE_INVALID,XR_ERROR_SIZE_INSUFFICIENT,XR_ERROR_FUNCTION_UNSUPPORTED,XR_ERROR_VALIDATION_FAILURE">
        <proto><type>XrResult</type> <name>xrEnumerateDisplayRefreshRatesFB</name></proto>
        <param><type>XrSession</type> <name>session</name></param>
        <param optional="true"><type>uint32_t</type> <name>displayRefreshRateCapacityInput</name></param>
        <param><type>uint32_t</type>* <name>displayRefreshRateCountOutput</name></param>
        <param optional="true" len="displayRefreshRateCapacityInput"><type>float</type>* <name>displayRefreshRates</name></param>
      </command>

FWIW the Vulkan spec uses the same parameter for input and output so doesn't fall into this problem, although it's probably too late to change things now!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the XML command definition for xrEnumerateDisplayRefreshRatesFB shown in the issue, focusing on displayRefreshRateCapacityInput, displayRefreshRateCountOutput, and displayRefreshRates. Review how the specification represents output-array validity, then determine whether the requested annotation can be expressed consistently. Done means the specification clearly communicates how many returned array values are valid, or documents why it cannot.

Written by the indexing model from the issue text.

Assessment

Domain
api, documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.