Skip to content

Commit 33cda95

Browse files
authored
Merge pull request #20 from EvergineTeam/feature/wasm
add support for browser-wasm runtime
2 parents b336257 + c3a8fee commit 33cda95

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1964
-3020
lines changed

README.md

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,24 @@
22

33
## Introduction
44

5-
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.
5+
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.
6+
7+
**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.
68

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

11-
## Headers and dlls from
12-
[https://github.com/webgpu-native/webgpu-headers/blob/main/webgpu.h](https://github.com/gfx-rs/wgpu-native/releases/tag/v22.1.0.5)
13-
14-
## Features
15-
16-
- **Low-level Access**: Get closer to the metal with our streamlined API that wraps `wgpu-native`.
17-
18-
- **Cross-Platform Support**: Test and deploy your applications seamlessly on Windows, Linux, and Mac.
19-
20-
- **Multiple Graphics API Compatibility**: Designed with DirectX, Vulkan, and Metal in mind.
21-
22-
## Prerequisites
23-
24-
List any dependencies, required libraries, or external factors here.
25-
2613
## Installation
2714

28-
1. Clone the repository: `git clone https://github.com/EvergineTeam/WebGPU.NET.git`
29-
2. Navigate to the project directory.
30-
3. Run the HelloTriangle test project.
31-
32-
### Usage
33-
3415
To include `Evergine.Bindings.WebGPU` in your project, install the NuGet package:
3516

36-
Install-Package Evergine.Bindings.WebGPU
17+
`Install-Package Evergine.Bindings.WebGPU`
3718

3819
Or if you use the .NET CLI:
3920

40-
dotnet add package Evergine.Bindings.WebGPU
21+
`dotnet add package Evergine.Bindings.WebGPU`
4122

4223
## License
4324

44-
This project is licensed under the MIT License - see the [LICENSE.md](link_to_license.md) file for details.
45-
46-
## Acknowledgments
47-
48-
- 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).
25+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

WebGPUGen/Evergine.Bindings.WebGPU/Evergine.Bindings.WebGPU.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
</PropertyGroup>
2020

2121
<ItemGroup>
22-
<Content Include="runtimes\**" PackagePath="runtimes" Pack="true" />
22+
<Content Include="buildtransitive\**" PackagePath="build" Visible="true" />
23+
<Content Include="runtimes\**" PackagePath="runtimes" Pack="true" />
2324
</ItemGroup>
2425

2526
<ItemGroup>

WebGPUGen/Evergine.Bindings.WebGPU/Generated/Commands.cs

Lines changed: 57 additions & 99 deletions
Large diffs are not rendered by default.

WebGPUGen/Evergine.Bindings.WebGPU/Generated/Constants.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ public static partial class WebGPUNative
44
{
55
public const ulong WGPU_ARRAY_LAYER_COUNT_UNDEFINED = 0xffffffffUL;
66
public const ulong WGPU_COPY_STRIDE_UNDEFINED = 0xffffffffUL;
7-
public const ulong WGPU_DEPTH_SLICE_UNDEFINED = 0xffffffffUL;
87
public const ulong WGPU_LIMIT_U32_UNDEFINED = 0xffffffffUL;
98
public const ulong WGPU_LIMIT_U64_UNDEFINED = 0xffffffffffffffffUL;
109
public const ulong WGPU_MIP_LEVEL_COUNT_UNDEFINED = 0xffffffffUL;
11-
public const ulong WGPU_QUERY_SET_INDEX_UNDEFINED = 0xffffffffUL;
1210
public static readonly nuint WGPU_WHOLE_MAP_SIZE = nuint.MaxValue;
1311
public const ulong WGPU_WHOLE_SIZE = 0xffffffffffffffffUL;
1412
}

WebGPUGen/Evergine.Bindings.WebGPU/Generated/Delegates.cs

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,52 @@
22

33
namespace Evergine.Bindings.WebGPU
44
{
5-
public unsafe delegate void WGPUProc();
6-
7-
public unsafe delegate void WGPUDeviceLostCallback(
8-
WGPUDeviceLostReason reason,
9-
char* message,
10-
void* userdata);
11-
12-
public unsafe delegate void WGPUErrorCallback(
13-
WGPUErrorType type,
14-
char* message,
15-
void* userdata);
16-
17-
public unsafe delegate void WGPUAdapterRequestDeviceCallback(
18-
WGPURequestDeviceStatus status,
19-
WGPUDevice device,
20-
char* message,
5+
public unsafe delegate void WGPUBufferMapCallback(
6+
WGPUBufferMapAsyncStatus status,
217
void* userdata);
228

23-
public unsafe delegate void WGPUBufferMapAsyncCallback(
24-
WGPUBufferMapAsyncStatus status,
9+
public unsafe delegate void WGPUCompilationInfoCallback(
10+
WGPUCompilationInfoRequestStatus status,
11+
WGPUCompilationInfo* compilationInfo,
2512
void* userdata);
2613

27-
public unsafe delegate void WGPUDeviceCreateComputePipelineAsyncCallback(
14+
public unsafe delegate void WGPUCreateComputePipelineAsyncCallback(
2815
WGPUCreatePipelineAsyncStatus status,
2916
WGPUComputePipeline pipeline,
3017
char* message,
3118
void* userdata);
3219

33-
public unsafe delegate void WGPUDeviceCreateRenderPipelineAsyncCallback(
20+
public unsafe delegate void WGPUCreateRenderPipelineAsyncCallback(
3421
WGPUCreatePipelineAsyncStatus status,
3522
WGPURenderPipeline pipeline,
3623
char* message,
3724
void* userdata);
3825

39-
public unsafe delegate void WGPUInstanceRequestAdapterCallback(
40-
WGPURequestAdapterStatus status,
41-
WGPUAdapter adapter,
26+
public unsafe delegate void WGPUDeviceLostCallback(
27+
WGPUDeviceLostReason reason,
28+
char* message,
29+
void* userdata);
30+
31+
public unsafe delegate void WGPUErrorCallback(
32+
WGPUErrorType type,
4233
char* message,
4334
void* userdata);
4435

45-
public unsafe delegate void WGPUQueueOnSubmittedWorkDoneCallback(
36+
public unsafe delegate void WGPUProc();
37+
38+
public unsafe delegate void WGPUQueueWorkDoneCallback(
4639
WGPUQueueWorkDoneStatus status,
4740
void* userdata);
4841

49-
public unsafe delegate void WGPUShaderModuleGetCompilationInfoCallback(
50-
WGPUCompilationInfoRequestStatus status,
51-
WGPUCompilationInfo* compilationInfo,
42+
public unsafe delegate void WGPURequestAdapterCallback(
43+
WGPURequestAdapterStatus status,
44+
WGPUAdapter adapter,
45+
char* message,
5246
void* userdata);
5347

54-
public unsafe delegate void WGPULogCallback(
55-
WGPULogLevel level,
48+
public unsafe delegate void WGPURequestDeviceCallback(
49+
WGPURequestDeviceStatus status,
50+
WGPUDevice device,
5651
char* message,
5752
void* userdata);
5853

0 commit comments

Comments
 (0)