Home

xrEnumerateViewConfigurations

xrEnumerateViewConfigurations and xrEnumerateViewConfigurationViews are functions in the OpenXR API used to discover rendering configurations and per-eye rendering requirements for a given XR system. They form part of the process for preparing the swapchain and view setup before rendering a scene.

xrEnumerateViewConfigurations reports the view configurations supported by a given system. Calling it requires an OpenXR instance

xrEnumerateViewConfigurationViews queries per-view details for a chosen view configuration on a given system. After selecting a

Typical usage involves obtaining a system, enumerating available view configurations, choosing one, and then querying its

and
a
system
identifier.
The
function
first
returns
the
number
of
supported
view
configurations
when
the
output
array
parameter
is
NULL.
If
a
caller
provides
an
array,
the
runtime
fills
it
with
XrViewConfigurationType
values
up
to
the
reported
count.
Typical
return
codes
include
XR_SUCCESS
on
success,
XR_ERROR_SIZE_INSUFFICIENT
if
the
provided
array
is
too
small,
and
other
standard
error
codes
for
invalid
handles
or
states.
The
set
of
view
configuration
types
is
defined
by
the
OpenXR
specification
and
may
include
configurations
such
as
primary
stereo
rendering.
configuration
type,
the
function
can
be
invoked
with
a
NULL
array
to
obtain
the
number
of
views
(usually
two
for
stereoscopic
setups).
A
subsequent
call
provides
an
array
of
XrViewConfigurationView
structures
describing
per-eye
rendering
parameters,
such
as
image
rectangle
dimensions
and
viewport
or
swapchain
requirements.
The
returned
information
guides
the
allocation
and
sizing
of
swapchains
and
the
setup
of
per-eye
rendering
targets.
per-view
configuration
to
size
swapchains
and
viewports
accordingly.
These
functions
help
ensure
rendering
aligns
with
the
capabilities
of
the
hardware
and
the
runtime,
enabling
correct
stereo
rendering
and
efficient
resource
management.