Skip to content

Conversation

@alcooper91
Copy link
Contributor

@alcooper91 alcooper91 commented Jan 21, 2026

Addes a maxRenderLayers attribute to XrSession and updates the updateRenderState algorithm to throw if a render state is provided with too many layers specified.


Preview | Diff

Addes a `maxRenderLayers` attribute to XrSession and updates the
`updateRenderState` algorithm to throw if a render state is provided
with too many layers specified.
@alcooper91 alcooper91 requested a review from cabanier January 21, 2026 21:13
@alcooper91
Copy link
Contributor Author

Fixes #323

webxrlayers-1.bs Outdated
};
</pre>

The <dfn attribute for="XRSession">maxRenderLayers</dfn> represents the maximum amount of layers that a session can render at a given time. It SHOULD be possible to create more than this number of layers at a given time, but they may not all be set via {{XRSession/updateRenderState()}} at once.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe more like "the maximum number of layers in the layers array in the renderstate that the compositor must handle".

The second sentence should be a NOTE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I intended the second sentence to be normative to indicate that this statement does NOT indicate that UAs should reject layer creation requests once maxRenderLayers have been created.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Further tweaked your provided language, PTAL

@alcooper91 alcooper91 requested a review from cabanier January 21, 2026 22:51
webxrlayers-1.bs Outdated
};
</pre>

The <dfn attribute for="XRSession">maxRenderLayers</dfn> represents the maximum number of layers that the compositor can handle, and thus the maximum size of any {{XRRenderStateInit}}'s {{XRRenderStateInit/layers}} array . It SHOULD be possible to create more than this number of layers at a given time.
Copy link
Member

Choose a reason for hiding this comment

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

can -> MUST
of any -> of the

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO both of these are fine as is:

can -> MUST (assuming "compositor can handle" -> "compositor MUST handle") doesn't feel appropriate to me, because what the compositor can handle is what sets the value, so saying it MUST handle it reads a bit weird to me? But maybe that's just default spec language?

of any-> of the (assuming "maximum size of any XRRenderStateInit's layer array"->"maximum size of the XRRenderStateInit's layer array") I'm intending there to be a plural on XRRenderStateInit e.g. any XRRenderStateInit you create must have its layers array smaller than this. But again, maybe this is also an abnormal spec convention of language?

Let me know your thoughts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then again, I guess we want to allow compositors to change this number. Swapped to MUST and added more context to the non-normative note.

@cabanier cabanier merged commit 0d61133 into main Jan 22, 2026
2 checks passed
github-actions bot added a commit that referenced this pull request Jan 22, 2026
SHA: 0d61133
Reason: push, by cabanier

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@alcooper91 alcooper91 deleted the max_layers branch January 22, 2026 17:07
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.

3 participants