Repository navigation
Open
Description
Document the Vulkan memory allocator APIs added by mono/SkiaSharp#4585.
Namespace: SkiaSharp
New type:
GRVkMemoryAllocator— a Skia-owned Vulkan memory allocator (the default VMA-backed implementation) that can be supplied to Ganesh and Graphite Vulkan contexts.
public static GRVkMemoryAllocator CreateDefault(
IntPtr vkInstance, IntPtr vkPhysicalDevice, IntPtr vkDevice, IntPtr vkQueue,
uint maxApiVersion, GRVkGetProcedureAddressDelegate getProcedureAddress);
public static GRVkMemoryAllocator CreateDefault(
IntPtr vkInstance, IntPtr vkPhysicalDevice, IntPtr vkDevice, IntPtr vkQueue,
uint maxApiVersion, GRVkGetProcedureAddressDelegate getProcedureAddress,
bool threadSafe);
public static GRVkMemoryAllocator CreateDefault(
IntPtr vkInstance, IntPtr vkPhysicalDevice, IntPtr vkDevice, IntPtr vkQueue,
uint maxApiVersion, GRVkGetProcedureAddressDelegate getProcedureAddress,
bool threadSafe, bool protectedContent);New properties:
GRVkBackendContext.MemoryAllocatorSKGraphiteVkBackendContext.MemoryAllocator
Points worth covering:
vkQueueis required;CreateDefaultthrowsArgumentExceptionwhen it (or the instance, physical device or device) is null, andArgumentNullExceptionfor a nullgetProcedureAddress.- Returns
nullwhen Vulkan support is not compiled into the native library or allocator initialization fails. threadSafeshould match the context's threading model:falsefor Ganesh and non-thread-safe Graphite,truefor thread-safe Graphite or parallel multi-recorder use.protectedContentrequests an allocator that serves protected (DRM) memory.- The context takes its own reference to the allocator, so the managed wrapper may be disposed as soon as the context has been created.
- Leaving
MemoryAllocatornull keeps the existing behavior: the native layer creates Skia's default allocator automatically. - The
getProcedureAddressdelegate is only needed for the duration ofCreateDefault; the allocator caches the resolved function pointers.
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
No labels
Activity