internal unsafe void __MarshalFrom(ref BuildRaytracingAccelerationStructureInputs.__Native @ref)
        {
            Type             = @ref.Type;
            Flags            = @ref.Flags;
            DescriptorsCount = @ref.NumDescs;
            Layout           = @ref.DescsLayout;

            if (@ref.NumDescs > 0)
            {
                if (@ref.Type == RaytracingAccelerationStructureType.TopLevel)
                {
                    InstanceDescriptions = Utilities.Read <long>(@ref.Ptr);
                }
                else
                {
                    GeometryDescriptions = new RaytracingGeometryDescription[@ref.NumDescs];
                    Utilities.Read(@ref.Ptr, this.GeometryDescriptions, 0, @ref.NumDescs);
                }
            }
        }
        internal unsafe void __MarshalTo(ref BuildRaytracingAccelerationStructureInputs.__Native @ref)
        {
            @ref.Type        = Type;
            @ref.Flags       = Flags;
            @ref.NumDescs    = DescriptorsCount;
            @ref.DescsLayout = Layout;

            if (GeometryDescriptions != null &&
                GeometryDescriptions.Length > 0)
            {
                @ref.Ptr = Marshal.AllocHGlobal(Utilities.SizeOf <RaytracingGeometryDescription>() * @ref.NumDescs);
                Utilities.Write(@ref.Ptr, GeometryDescriptions, 0, @ref.NumDescs);
            }
            else
            {
                @ref.Ptr = Marshal.AllocHGlobal(Utilities.SizeOf <long>());
                var instanceDescriptions = InstanceDescriptions;
                Utilities.Write(@ref.Ptr, ref instanceDescriptions);
            }
        }
 internal unsafe void __MarshalFree(ref BuildRaytracingAccelerationStructureInputs.__Native @ref)
 {
     @ref.__MarshalFree();
 }