Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 6 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,24 @@

## Introduction

WebGPU.NET is a lightweight, low-level wrapper built on top of the `wgpu-native` library from Firefox. Our aim is to facilitate swift development of an adapter for Evergine, allowing for rapid testing across Windows, Linux, and Mac platforms using DirectX, Vulkan, and Metal.
WebGPU.NET is a lightweight, low-level wrapper built on top of the Emscripten's [WebGPU header](https://github.com/emscripten-core/emscripten/blob/main/system/include/webgpu/webgpu.h). Our aim is to facilitate swift development of an adapter for Evergine, allowing for rapid testing across different browsers.

**NOTE:** On June 30th, 2025, we removed support for platforms different from browser, mainly because .NET SDK is highly coupled with a specific version of Emscripten (3.34 for .NET 8, for example). We would really like to bring them back in a future; however, we have not found an approach to support everything simultaneously.

[![CI](https://github.com/EvergineTeam/WebGPU.NET/actions/workflows/CI.yml/badge.svg)](https://github.com/EvergineTeam/WebGPU.NET/actions/workflows/CI.yml)
[![CD WebGPU](https://github.com/EvergineTeam/WebGPU.NET/actions/workflows/cd.yml/badge.svg)](https://github.com/EvergineTeam/WebGPU.NET/actions/workflows/cd.yml)
[![Nuget](https://img.shields.io/nuget/v/Evergine.Bindings.WebGPU?logo=nuget)](https://www.nuget.org/packages/Evergine.Bindings.WebGPU)

## Headers and dlls from
[https://github.com/webgpu-native/webgpu-headers/blob/main/webgpu.h](https://github.com/gfx-rs/wgpu-native/releases/tag/v22.1.0.5)

## Features

- **Low-level Access**: Get closer to the metal with our streamlined API that wraps `wgpu-native`.

- **Cross-Platform Support**: Test and deploy your applications seamlessly on Windows, Linux, and Mac.

- **Multiple Graphics API Compatibility**: Designed with DirectX, Vulkan, and Metal in mind.

## Prerequisites

List any dependencies, required libraries, or external factors here.

## Installation

1. Clone the repository: `git clone https://github.com/EvergineTeam/WebGPU.NET.git`
2. Navigate to the project directory.
3. Run the HelloTriangle test project.

### Usage

To include `Evergine.Bindings.WebGPU` in your project, install the NuGet package:

Install-Package Evergine.Bindings.WebGPU
`Install-Package Evergine.Bindings.WebGPU`

Or if you use the .NET CLI:

dotnet add package Evergine.Bindings.WebGPU
`dotnet add package Evergine.Bindings.WebGPU`

## License

This project is licensed under the MIT License - see the [LICENSE.md](link_to_license.md) file for details.

## Acknowledgments

- Thanks to the Firefox team for the `wgpu-native` library. Check out the original library on [gfx-rs/wgpu-native](https://github.com/gfx-rs/wgpu-native).
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
</PropertyGroup>

<ItemGroup>
<Content Include="runtimes\**" PackagePath="runtimes" Pack="true" />
<Content Include="buildtransitive\**" PackagePath="build" Visible="true" />
<Content Include="runtimes\**" PackagePath="runtimes" Pack="true" />
</ItemGroup>

<ItemGroup>
Expand Down
156 changes: 57 additions & 99 deletions WebGPUGen/Evergine.Bindings.WebGPU/Generated/Commands.cs

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions WebGPUGen/Evergine.Bindings.WebGPU/Generated/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ public static partial class WebGPUNative
{
public const ulong WGPU_ARRAY_LAYER_COUNT_UNDEFINED = 0xffffffffUL;
public const ulong WGPU_COPY_STRIDE_UNDEFINED = 0xffffffffUL;
public const ulong WGPU_DEPTH_SLICE_UNDEFINED = 0xffffffffUL;
public const ulong WGPU_LIMIT_U32_UNDEFINED = 0xffffffffUL;
public const ulong WGPU_LIMIT_U64_UNDEFINED = 0xffffffffffffffffUL;
public const ulong WGPU_MIP_LEVEL_COUNT_UNDEFINED = 0xffffffffUL;
public const ulong WGPU_QUERY_SET_INDEX_UNDEFINED = 0xffffffffUL;
public static readonly nuint WGPU_WHOLE_MAP_SIZE = nuint.MaxValue;
public const ulong WGPU_WHOLE_SIZE = 0xffffffffffffffffUL;
}
Expand Down
53 changes: 24 additions & 29 deletions WebGPUGen/Evergine.Bindings.WebGPU/Generated/Delegates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,52 @@

namespace Evergine.Bindings.WebGPU
{
public unsafe delegate void WGPUProc();

public unsafe delegate void WGPUDeviceLostCallback(
WGPUDeviceLostReason reason,
char* message,
void* userdata);

public unsafe delegate void WGPUErrorCallback(
WGPUErrorType type,
char* message,
void* userdata);

public unsafe delegate void WGPUAdapterRequestDeviceCallback(
WGPURequestDeviceStatus status,
WGPUDevice device,
char* message,
public unsafe delegate void WGPUBufferMapCallback(
WGPUBufferMapAsyncStatus status,
void* userdata);

public unsafe delegate void WGPUBufferMapAsyncCallback(
WGPUBufferMapAsyncStatus status,
public unsafe delegate void WGPUCompilationInfoCallback(
WGPUCompilationInfoRequestStatus status,
WGPUCompilationInfo* compilationInfo,
void* userdata);

public unsafe delegate void WGPUDeviceCreateComputePipelineAsyncCallback(
public unsafe delegate void WGPUCreateComputePipelineAsyncCallback(
WGPUCreatePipelineAsyncStatus status,
WGPUComputePipeline pipeline,
char* message,
void* userdata);

public unsafe delegate void WGPUDeviceCreateRenderPipelineAsyncCallback(
public unsafe delegate void WGPUCreateRenderPipelineAsyncCallback(
WGPUCreatePipelineAsyncStatus status,
WGPURenderPipeline pipeline,
char* message,
void* userdata);

public unsafe delegate void WGPUInstanceRequestAdapterCallback(
WGPURequestAdapterStatus status,
WGPUAdapter adapter,
public unsafe delegate void WGPUDeviceLostCallback(
WGPUDeviceLostReason reason,
char* message,
void* userdata);

public unsafe delegate void WGPUErrorCallback(
WGPUErrorType type,
char* message,
void* userdata);

public unsafe delegate void WGPUQueueOnSubmittedWorkDoneCallback(
public unsafe delegate void WGPUProc();

public unsafe delegate void WGPUQueueWorkDoneCallback(
WGPUQueueWorkDoneStatus status,
void* userdata);

public unsafe delegate void WGPUShaderModuleGetCompilationInfoCallback(
WGPUCompilationInfoRequestStatus status,
WGPUCompilationInfo* compilationInfo,
public unsafe delegate void WGPURequestAdapterCallback(
WGPURequestAdapterStatus status,
WGPUAdapter adapter,
char* message,
void* userdata);

public unsafe delegate void WGPULogCallback(
WGPULogLevel level,
public unsafe delegate void WGPURequestDeviceCallback(
WGPURequestDeviceStatus status,
WGPUDevice device,
char* message,
void* userdata);

Expand Down
Loading
Loading