Skip to content
Open
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
7 changes: 4 additions & 3 deletions renderer/premake5_pls_renderer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ newoption({
description = 'compile in support for wagyu webgpu extensions',
})
if _OPTIONS['with_wagyu'] then
if _OPTIONS['webgpu-version'] < '2' then
error('\nWagyu does not support webgpu-version < 2\n ')
end
defines({ 'RIVE_WAGYU' })
RIVE_WAGYU_PORT = '--use-port='
.. RIVE_RUNTIME_DIR
.. '/renderer/src/webgpu/wagyu-port/'
.. (_OPTIONS['webgpu-version'] == '2' and 'new' or 'old')
.. '/webgpu-port.py:wagyu=true'
.. '/renderer/src/webgpu/wagyu-port/webgpu-port.py:wagyu=true'
end

newoption({
Expand Down
5 changes: 5 additions & 0 deletions renderer/src/webgpu/render_context_webgpu_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ static wgpu::ShaderModule compile_shader_module_spirv(wgpu::Device device,
const uint32_t* code,
uint32_t codeSize)
{
#if RIVE_WEBGPU == 1
wgpu::ShaderModuleSPIRVDescriptor spirvDesc;
#else
wgpu::ShaderSourceSPIRV spirvDesc;
#endif
spirvDesc.code = code;
spirvDesc.codeSize = codeSize;
wgpu::ShaderModuleDescriptor descriptor;
Expand Down Expand Up @@ -1043,6 +1047,7 @@ RenderContextWebGPUImpl::RenderContextWebGPUImpl(
// if the hardware doesn't support this.
m_capabilities.polyfillVertexStorageBuffers = true;
}
wgpuWagyuStringArrayFreeMembers(extensions);
#endif
}

Expand Down
3 changes: 0 additions & 3 deletions renderer/src/webgpu/wagyu-port/.clang-format-ignore

This file was deleted.

11 changes: 6 additions & 5 deletions renderer/src/webgpu/wagyu-port/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

This is an implementation of WebGPU bindings for Emscripten.

This package provides the legacy (old) webgpu.h header used by Emscripten, and
a copy of the current standard (new) webgpu.h provided by emdawnwgpu.
This package provides webgpu.h header provided by emdawnwgpu.

This package optionally provides Wagyu extensions to the WebGPU API, which
are available from the webgpu_wagyu.h header. These extensions are not part of
Expand All @@ -17,13 +16,15 @@ port indirectly.

To use the remote port file, pass it as an option like this to your
emscripten build commands:
```

```bash
--use-port=[your_path]/webgpu-remoteport.py
```

You can also directly use the local port file `webgpu-port.py` from the
webgpu-port repository (or a copy of it).
```

```bash
--use-port=[your_path]/webgpu-port.py
```

Expand All @@ -34,7 +35,7 @@ pairs delimited by colons.

For example:

```
```bash
--use-port=webgpu-remoteport.py:wagyu=true
```

Expand Down
Loading