Ahjo.Wgpu.Native 0.1.0

There is a newer version of this package available.
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
                    
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="Ahjo.Wgpu.Native" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ahjo.Wgpu.Native" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Ahjo.Wgpu.Native" />
                    
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 Ahjo.Wgpu.Native --version 0.1.0
                    
#r "nuget: Ahjo.Wgpu.Native, 0.1.0"
                    
#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 Ahjo.Wgpu.Native@0.1.0
                    
#: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=Ahjo.Wgpu.Native&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Ahjo.Wgpu.Native&version=0.1.0
                    
Install as a Cake Tool

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 against wgpu.h / webgpu.h. Regenerated via dotnet 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 to triangle.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 Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.

Version Downloads Last Updated
0.6.0 122 4/26/2026
0.5.0 108 4/25/2026
0.4.0 106 4/25/2026
0.3.1 107 4/22/2026
0.3.0 103 4/21/2026
0.2.0 110 4/21/2026
0.1.1 101 4/21/2026
0.1.0 96 4/21/2026