diff --git a/Directory.Build.props b/Directory.Build.props index 94c94a9..2a7f776 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -13,6 +13,8 @@ $(XdlVersion.Split('-')[0]) $([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'artifacts', 'xdl', '$(XdlVersion)')) $(XdlReleaseDirectory)include/ + + $(XdlReleaseDirectory)runtimes/browser-wasm/native/ diff --git a/Directory.Build.targets b/Directory.Build.targets index 7a00fdf..284d619 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,7 +1,6 @@ $(XdlReleaseDirectory)runtimes/$(NETCoreSdkPortableRuntimeIdentifier)/native/ - $(XdlReleaseDirectory)runtimes/browser-wasm/native/ headers;$(NETCoreSdkPortableRuntimeIdentifier);browser-wasm-net11 diff --git a/README.md b/README.md index f7afb28..d0faf0c 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Pointer window = SDL_CreateWindow("Title"u8, 640, 480, SDL_WindowFla - `XdlSharp` holds the bindings. It is the same for every platform and holds no native library. - `XdlSharp.Native.` holds XDL's runtime for one platform, from the XDL release: `linux-x64`, `linux-arm64`, `osx-x64`, `osx-arm64`, `win-x64`, `win-arm64` or `browser-wasm`. An app references the packages of the platforms it runs on. -- `XdlSharp.Native.browser-wasm` links its archives into `dotnet.native.wasm` and adds `--use-port=emdawnwebgpu` to the link. The link builds that Emscripten port into the Emscripten cache. The workload's own cache is read-only, so set `WasmCachePath` to a writable directory. +- `XdlSharp.Native.browser-wasm` links its archives into `dotnet.native.wasm`, with emdawnwebgpu, the WebGPU binding that XDL calls, which XDL ships prebuilt. The link needs the `wasm-tools` workload and no writable Emscripten cache. To create a GPU device from the page, as the .NET runtime requires, also export `WebGPU` with `EmccExportedRuntimeMethod` and `_wgpuCreateInstance` with `EmccExportedFunction`. The version is the SDL version and a release number, such as `3.4.20.1`. The package description names the XDL release, such as `3.4.20-4`. diff --git a/XDL_VERSION b/XDL_VERSION index edb0958..76001f6 100644 --- a/XDL_VERSION +++ b/XDL_VERSION @@ -1 +1 @@ -3.4.20-4 +3.4.20-9 diff --git a/packaging/XdlSharp.Native/buildTransitive/XdlSharp.Native.browser-wasm.targets b/packaging/XdlSharp.Native/buildTransitive/XdlSharp.Native.browser-wasm.targets index eee05d4..25b2572 100644 --- a/packaging/XdlSharp.Native/buildTransitive/XdlSharp.Native.browser-wasm.targets +++ b/packaging/XdlSharp.Native/buildTransitive/XdlSharp.Native.browser-wasm.targets @@ -1,14 +1,16 @@ - + + - $(EmccExtraLDFlags) --use-port=emdawnwebgpu + $(EmccExtraLDFlags) --js-library "$(MSBuildThisFileDirectory)native/library_webgpu_enum_tables.js" --js-library "$(MSBuildThisFileDirectory)native/library_webgpu_generated_struct_info.js" --js-library "$(MSBuildThisFileDirectory)native/library_webgpu_generated_sig_info.js" --js-library "$(MSBuildThisFileDirectory)native/library_webgpu.js" diff --git a/tests/XdlSharp.Browser.Tests/XdlSharp.Browser.Tests.csproj b/tests/XdlSharp.Browser.Tests/XdlSharp.Browser.Tests.csproj index ceeaac5..46ed4f3 100644 --- a/tests/XdlSharp.Browser.Tests/XdlSharp.Browser.Tests.csproj +++ b/tests/XdlSharp.Browser.Tests/XdlSharp.Browser.Tests.csproj @@ -9,9 +9,8 @@ false false true - - $([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', '..', '..', 'artifacts', 'em-cache')) - $(EmccExtraLDFlags) --use-port=emdawnwebgpu + + $(EmccExtraLDFlags) --js-library "$(XdlBrowserDirectory)library_webgpu_enum_tables.js" --js-library "$(XdlBrowserDirectory)library_webgpu_generated_struct_info.js" --js-library "$(XdlBrowserDirectory)library_webgpu_generated_sig_info.js" --js-library "$(XdlBrowserDirectory)library_webgpu.js" @@ -20,6 +19,7 @@ + diff --git a/tests/XdlSharp.Package.Browser.Tests/XdlSharp.Package.Browser.Tests.csproj b/tests/XdlSharp.Package.Browser.Tests/XdlSharp.Package.Browser.Tests.csproj index 1141fc6..d5c7b0f 100644 --- a/tests/XdlSharp.Package.Browser.Tests/XdlSharp.Package.Browser.Tests.csproj +++ b/tests/XdlSharp.Package.Browser.Tests/XdlSharp.Package.Browser.Tests.csproj @@ -10,7 +10,6 @@ false false false - $([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', '..', '..', 'artifacts', 'em-cache'))