Table of Contents

Use Ganesh with Direct3D

Use the Direct3D backend on Windows when your host owns a DXGI adapter, D3D12 device, and command queue. Graphite has no direct Direct3D backend, so Ganesh is the SkiaSharp path when D3D12 is a requirement.

Create the Ganesh context

Build a GRD3DBackendContext from the native handles:

using var backendContext = new GRD3DBackendContext
{
    Adapter = adapterHandle,
    Device = d3d12DeviceHandle,
    Queue = commandQueueHandle,
};

using var context = GRContext.CreateDirect3D(backendContext);

Describe Direct3D resources

Use GRD3DTextureResourceInfo when constructing a GRBackendRenderTarget or GRBackendTexture for an existing D3D12 resource. Your host remains responsible for allocation, resource-state transitions, synchronization, presentation, and final release.

After constructing the backend target or texture, return to wrapping an existing Ganesh resource for the shared SKSurface.Create calls.