Ahjo.Wgpu.Native
0.1.0
See the version list below for details.
dotnet add package Ahjo.Wgpu.Native --version 0.1.0
NuGet\Install-Package Ahjo.Wgpu.Native -Version 0.1.0
<PackageReference Include="Ahjo.Wgpu.Native" Version="0.1.0" />
<PackageVersion Include="Ahjo.Wgpu.Native" Version="0.1.0" />
<PackageReference Include="Ahjo.Wgpu.Native" />
paket add Ahjo.Wgpu.Native --version 0.1.0
#r "nuget: Ahjo.Wgpu.Native, 0.1.0"
#:package Ahjo.Wgpu.Native@0.1.0
#addin nuget:?package=Ahjo.Wgpu.Native&version=0.1.0
#tool nuget:?package=Ahjo.Wgpu.Native&version=0.1.0
WgpuSharp
.NET bindings and a low-allocation C# wrapper for wgpu-native.
Status: early. Raw bindings + smoke tests + two samples are in place. The idiomatic wrapper (
WgpuSharp) is being built iteratively.
Layout
src/WgpuSharp.Native— ClangSharp-generated P/Invokes againstwgpu.h/webgpu.h. Regenerated viadotnet build -t:Regenerate.src/WgpuSharp.Utilities— dep-free helpers usable from samples and tests (e.g. a hand-written PNG encoder).src/WgpuSharp(planned) — idiomatic wrapper.samples/HelloTriangle— SDL3 window, renders a triangle.samples/HeadlessTriangle— renders the same triangle totriangle.png, no window.tests/WgpuSharp.Native.Tests— xUnit smoke suite covering instance → adapter → device → queue → command buffer.
Design principles
Aimed at games. Low allocation, raw-pointer friendly, minimal ceremony.
Typical .NET safety (SafeHandle, Task-based async, defensive null checks) is
not a goal — perf and zero per-frame allocations take precedence. Full
guidelines and rationale live in CLAUDE.md.
Getting started
dotnet tool restore
dotnet build -t:Regenerate # downloads wgpu-native headers + generates bindings
dotnet test # runs the smoke suite
dotnet run --project samples/HeadlessTriangle # produces triangle.png
dotnet run --project samples/HelloTriangle # opens an SDL3 window (Windows only for now)
Requires a .NET 11 preview SDK (see global.json).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Ahjo.Wgpu.Native:
| Package | Downloads |
|---|---|
|
Ahjo.Wgpu
Idiomatic C# wrapper over wgpu-native: ref-struct encoders, struct handles, polled futures, zero-per-frame allocations. |
GitHub repositories
This package is not used by any popular GitHub repositories.