VelloSharp.Ffi.Gpu
VelloSharp.Ffi.Gpu
extends the FFI layer with GPU-specific bindings required to operate native rendering pipelines.
Getting Started
- Install using
dotnet add package VelloSharp.Ffi.Gpu
. - Add
using VelloSharp.Ffi.Gpu;
in modules that configure GPU-backed rendering through native interop. - Make sure the GPU native binaries are available via the
VelloSharp.Native.*
bundles that match your platform. - Wrap the GPU handles with managed abstractions or use them through
VelloSharp.Gpu
to simplify resource lifetime management.
Usage Example
using System;
using VelloSharp;
var rendererHandle = NativeMethods.vello_renderer_create(800, 600);
if (rendererHandle == IntPtr.Zero)
{
throw new InvalidOperationException(NativeHelpers.GetLastErrorMessage() ?? "Renderer creation failed.");
}
NativeMethods.vello_renderer_destroy(rendererHandle);
Next Steps
- Review the API reference for the list of exported GPU commands and structures.
- Validate compatibility with your target backend (Vulkan, Metal, Direct3D) before enabling advanced features in production.