C Specification
The xrGetSceneMeshBuffersMSFT function retrieves the scene mesh vertex buffer and index buffer for the given scene mesh buffer identifier.
Note
Applications may use the scene mesh buffer identifier as a key to cache the vertices and indices of a mesh for reuse within an XrSceneMSFT or across multiple XrSceneMSFT for the same XrSession. Applications can avoid unnecessarily calling xrGetSceneMeshBuffersMSFT
for a scene component if XrSceneComponentMSFT:: |
This function follows the two-call idiom for filling multiple buffers in a struct.
The xrGetSceneMeshBuffersMSFT function is defined as:
// Provided by XR_MSFT_scene_understanding
XrResult xrGetSceneMeshBuffersMSFT(
XrSceneMSFT scene,
const XrSceneMeshBuffersGetInfoMSFT* getInfo,
XrSceneMeshBuffersMSFT* buffers);
Parameters
Description
Applications can request the vertex buffer of the mesh by including
XrSceneMeshVertexBufferMSFT in the
XrSceneMeshBuffersMSFT::next
chain.
Runtimes must support requesting a 32-bit index buffer and may support
requesting a 16-bit index buffer.
Applications can request a 32-bit index buffer by including
XrSceneMeshIndicesUint32MSFT in the
XrSceneMeshBuffersMSFT::next
chain.
Applications can request a 16-bit index buffer by including
XrSceneMeshIndicesUint16MSFT in the
XrSceneMeshBuffersMSFT::next
chain.
If the runtime for the given scene mesh buffer does not support requesting a
16-bit index buffer then XR_ERROR_VALIDATION_FAILURE
must be
returned.
The runtime must support reading a 16-bit index buffer for the given scene
mesh buffer if XrScenePlaneMSFT:supportsIndicesUint16 or
XrSceneMeshMSFT:supportsIndicesUint16 are XR_TRUE
for the scene
component that contained that scene mesh buffer identifier.
The runtime must return XR_ERROR_SCENE_MESH_BUFFER_ID_INVALID_MSFT
if
none of the scene components in the given XrSceneMSFT contain
XrSceneMeshBuffersGetInfoMSFT::meshBufferId
.
The runtime must return XR_ERROR_SCENE_MESH_BUFFER_ID_INVALID_MSFT
if
XrSceneMeshBuffersGetInfoMSFT::meshBufferId
is zero.
The runtime must return XR_ERROR_VALIDATION_FAILURE
if both
XrSceneMeshIndicesUint32MSFT and XrSceneMeshIndicesUint16MSFT
are included in the XrSceneMeshBuffersMSFT::next
chain.
The runtime must return XR_ERROR_VALIDATION_FAILURE
if the
XrSceneMeshBuffersMSFT::next
does not contain at least one of
XrSceneMeshVertexBufferMSFT, XrSceneMeshIndicesUint32MSFT or
XrSceneMeshIndicesUint16MSFT.
The runtime must return the same vertices and indices for a given scene mesh buffer identifier and XrSession. A runtime may return zero vertices and indices if the underlying mesh data is no longer available.
See Also
Document Notes
For more information, see the OpenXR Specification
This page is extracted from the OpenXR Specification. Fixes and changes should be made to the Specification, not directly.
Copyright
Copyright 2014-2024, The Khronos Group Inc.
This work is licensed under a Creative Commons Attribution 4.0 International License.