docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct UnityXRTextureData

    Container for different ways of representing texture data.

    • If the format (#UnityXRRenderTextureDesc::colorFormat or #UnityXRRenderTextureDesc::depthFormat) is a 'Reference' format, referenceTextureId must be set.
    • If the format is kUnityXRRenderTextureFormatSoftReferenceMSAA, both fields are used. Otherwise, nativePtr is used.
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.OpenXR.API
    Assembly: Unity.XR.OpenXR.dll
    Syntax
    public struct UnityXRTextureData

    Fields

    nativePtr

    @brief Native texture ID if you've allocated it yourself. The texture ID varies by graphics API. For example:

    • GL: texture name that comes from glGenTextures
    • DX11: ID3D11Texture2D*
    • Vulkan: vkImage*

    You can pass in #kUnityXRRenderTextureIdDontCare and have Unity allocate one for you.

    Declaration
    public IntPtr nativePtr
    Field Value
    Type Description
    IntPtr

    referenceTextureId

    Texture ID to share color / depth with in the case of reference color / depth format.

    Declaration
    public uint referenceTextureId
    Field Value
    Type Description
    uint
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)