Skip to main content

IExternalObjectsHandleWrapRenderInterfaceContextFeature Interface

Definition

Assembly:Avalonia.Base
Package:Avalonia

This interface allows proper management of ref-counted platform handles. If we immediately wrap the handle, the caller can destroy its copy immediately after the call This is needed for MoltenVK-based users that can e.g. get an MTLSharedEvent from a VkSemaphore. This does NOT actually increase the ref-counter of MTLSharedEvent, since it's declared as __unsafe_unretained in vulkan headers. Same happens with exporting an IOSurfaceRef from a VkImage. So in a case when the VkSemaphore or VkImage is destroyed, the "handle" which is actually a pointer will be pointing to a dead object. To prevent this we need to increase the reference counter in a handle-specific means synchronously before returning control back to the user.

This is not needed for fds or DXGI handles, since those are created on demand as proper NT handles

public interface IExternalObjectsHandleWrapRenderInterfaceContextFeature

Methods

NameDescription
WrapImageHandleOnAnyThreadNo summary available.
WrapSemaphoreHandleOnAnyThreadNo summary available.

WrapImageHandleOnAnyThread Method

public Avalonia.Platform.IExternalObjectsWrappedGpuHandle WrapImageHandleOnAnyThread(Avalonia.Platform.IPlatformHandle handle, Avalonia.Platform.PlatformGraphicsExternalImageProperties properties)

Parameters

handle Avalonia.Platform.IPlatformHandle

properties Avalonia.Platform.PlatformGraphicsExternalImageProperties

Returns

Avalonia.Platform.IExternalObjectsWrappedGpuHandle

WrapSemaphoreHandleOnAnyThread Method

public Avalonia.Platform.IExternalObjectsWrappedGpuHandle WrapSemaphoreHandleOnAnyThread(Avalonia.Platform.IPlatformHandle handle)

Parameters

handle Avalonia.Platform.IPlatformHandle

Returns

Avalonia.Platform.IExternalObjectsWrappedGpuHandle