WACS.WASI.GFX 0.3.0-preview

This is a prerelease version of WACS.WASI.GFX.
dotnet add package WACS.WASI.GFX --version 0.3.0-preview
                    
NuGet\Install-Package WACS.WASI.GFX -Version 0.3.0-preview
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WACS.WASI.GFX" Version="0.3.0-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WACS.WASI.GFX" Version="0.3.0-preview" />
                    
Directory.Packages.props
<PackageReference Include="WACS.WASI.GFX" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WACS.WASI.GFX --version 0.3.0-preview
                    
#r "nuget: WACS.WASI.GFX, 0.3.0-preview"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WACS.WASI.GFX@0.3.0-preview
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WACS.WASI.GFX&version=0.3.0-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=WACS.WASI.GFX&version=0.3.0-preview&prerelease
                    
Install as a Cake Tool

WACS.WASI.GFX

Host bindings for wasi-gfx — the WebAssembly System Interface proposal for graphics and GPU compute (Phase 2). Ships all four wasi-gfx WIT packages — wasi:graphics-context@0.0.1, wasi:surface@0.0.1, wasi:frame-buffer@0.0.1, wasi:webgpu@0.0.1 — through a single Silk.NET/SDL + wgpu-native backend that drives the full family against one SDL window.

Packages

Package Role
WACS.WASI.GFX Core: WasiGfxConfiguration, WasiGfxHost (IBindable), IBackend SPI, vendored WIT + source-gen [WitSource] interfaces under Wacs.WASI.GFX.{GraphicsContext, FrameBuffer, Surface}.
WACS.WASI.GFX.Webgpu webgpu contract: source-gen [WitSource] interfaces under Wacs.WASI.GFX.Webgpu, canonical-ABI hand-written bindings, IGpuBackend SPI.
WACS.WASI.GFX.Silk Silk.NET/SDL + wgpu-native backend. Owns the OS window, SDL event pump, CPU pixel blit path, and the wgpu adapter/device/swap-chain bridge. Bundled with the CLI for --wasi-gfx.
WACS.WASI.GFX.DependencyInjection DI bundles for the transpiler-direct-link path: WasiGfxBundle, WasiWebgpuBundle, WasiPreview2GfxBundle composite, services.AddWasiGfx(...) / .AddWasiWebgpu(...) / .AddWasiPreview2GfxBundle() registration.

Threading model

Driving an OS window means owning the main thread on macOS (AppKit hard requirement). Contract: the embedder runs wasm on a worker thread and calls host.Backend.RunMainLoop(ct) on the main thread to pump the OS event loop until ct fires. wacs run --windowed does this automatically.

Surface events (resize / frame / pointer / key) reach the guest through wasi:io/poll.pollable resources — the backend's event pump calls ManualResetPollable.Signal() and the guest's pollable.block() wakes. The wgpu adapter / device / queue / pipeline / queue.submit / surface.configure / get-current-texture / present calls are internally thread-safe and run from the worker; the lone exception is SDL_Metal_CreateView (NSView creation, macOS), which the GPU connect path dispatches through MainThreadDispatcher automatically.

Pinning

WIT files vendored verbatim from WebAssembly/wasi-gfx. See wit/deps.lock for the exact commit and replay commands.

Status

Feature-complete across CPU and GPU paths. Both the interpreter component path (--wasi-gfx) and the transpiler direct-link path (--wasip2 --wasi-gfx) render the parity fixtures end-to-end.

Parity fixtures under Spec.Test/components/fixtures/:

Fixture Path Shape
wasi-gfx-rectangle / wasi-gfx-triangle wasi:frame-buffer CPU pixel blit (RGBA8)
wasi-webgpu-hello-compute wasi:webgpu compute pipeline + map-async readback
wasi-webgpu-hello-render wasi:webgpu render pipeline + copy-texture-to-buffer (offscreen)
wasi-webgpu-game-of-life wasi:webgpu bind-group ping-pong + multi-pass compute
wasi-webgpu-game-of-life-windowed full family surface + graphics-context + webgpu swap-chain (windowed demo)

See docs/WASI_GFX_USAGE.md for the full usage guide and docs/COMPONENT_CHAINING.md for the multi-host chaining details.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on WACS.WASI.GFX:

Package Downloads
WACS.WASI.GFX.DependencyInjection

Microsoft.Extensions.DependencyInjection extension methods for WACS.WASI.GFX. Registers the WasiGfxBundle that the transpiler's HostPackageResolver will direct-link wasi-gfx imports against — symmetric with WACS.WASI.NN.DependencyInjection and WACS.WASI.Preview2.DependencyInjection. Preview: tracks the wasi-gfx proposal at WASI Phase 2 — the WIT surface may change as the proposal evolves.

WACS.WASI.GFX.Silk

Silk.NET/SDL + wgpu-native backend for WACS.WASI.GFX. Implements IBackend for wasi:graphics-context, wasi:surface, wasi:frame-buffer, and wasi:webgpu on top of SDL2 + wgpu-native via Silk.NET. Ships as a sibling NuGet so consumers wiring a different backend don't pull SDL's or wgpu-native's binaries. Preview: tracks the wasi-gfx proposal at WASI Phase 2 — the WIT surface may change as the proposal evolves.

WACS.WASI.GFX.Webgpu

WASI-GFX `wasi:webgpu@0.0.1` host bindings for WACS — the fourth wasi-gfx WIT package, mirroring the browser WebGPU spec. Contract assembly; backend lives in WACS.WASI.GFX.Silk. Preview: tracks the wasi-gfx proposal at WASI Phase 2 — the WIT surface may change as the proposal evolves.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0-preview 68 5/28/2026
0.2.0-preview 78 5/16/2026