Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer Size Parameter elementCountOutput inconsistency #4

Closed
pH5 opened this issue Mar 21, 2019 · 2 comments

Comments

@pH5
Copy link

commented Mar 21, 2019

The Buffer Size Parameter Behavior section states:

2.11. Buffer Size Parameters

Buffer Size Parameter Behavior

  • Independent of elementCapacityInput or elements parameters, elementCountOutput must be a valid pointer, and the function sets elementCountOutput

But the Valid Usage (Implicit) sections of many functions seem to imply that their elementCountOutput parameter may be NULL. For example:

7.3.1. xrEnumerateReferenceSpaces

Valid Usage (Implicit)

  • If spaceCountOutput is not NULL, spaceCountOutput must be a pointer to a uint32_t value

Why not just:

  • spaceCountOutput must be a pointer to a uint32_t value
@brycehutchings

This comment has been minimized.

Copy link

commented Mar 25, 2019

Agreed we should simplify it to just be required, especially because there is no guarantee in the spec that the elementCountOutput won't change between calls (it's explicitly called out that the elementCountOutput can change). It seems like the two-call idiom section contradicts itself both saying elementCountOutput must be a valid pointer and that it can be null for some cases:

  • Independent of elementCapacityInput or elements parameters, elementCountOutput must be a valid pointer, and the function sets elementCountOutput.
  • [...]
  • elementCountOutput can be NULL for cases in which elementCapacityInput is greater than 0, in which case it is unused by the function. However, XR_ERROR_SIZE_INSUFFICIENT may still be returned by the function in the case that elementCapacityInput is too small.
@rpavlik

This comment has been minimized.

Copy link
Contributor

commented Jul 30, 2019

This has been clarified in 1.0.0 to always be required. Additionally, in most cases, the value can only change at distinct points in time, so it should generally be constant, but we've made it always required anyway.

@rpavlik rpavlik added the bug label Jul 30, 2019

@rpavlik rpavlik closed this Jul 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.