Skip to content

Commit

Permalink
render: Disable wgpu unused shader output check when possible
Browse files Browse the repository at this point in the history
Since wgpu hasn't yet released a version with this feature, I manually
backported it to the 0.17 branch.
This doesn't work on Windows (HLSL), but works on all other platforms.
  • Loading branch information
Aaron1011 committed Sep 30, 2023
1 parent bdc0985 commit 2dcd783
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
18 changes: 7 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,10 @@ inherits = "release"

[profile.web-wasm-extensions]
inherits = "release"

# FIXME - remove this when wgpu v0.18 is released
[patch.crates-io]
wgpu = { git = "https://github.com/ruffle-rs/wgpu", branch = "backport-shader-unconsumed" }

[patch.'https://github.com/gfx-rs/naga']
naga = { version = "0.13.0" }
7 changes: 7 additions & 0 deletions render/wgpu/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,13 @@ async fn request_device(
features |= wgpu::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES;
}

if adapter
.features()
.contains(wgpu::Features::SHADER_UNUSED_VERTEX_OUTPUT)
{
features |= wgpu::Features::SHADER_UNUSED_VERTEX_OUTPUT;
}

adapter
.request_device(
&wgpu::DeviceDescriptor {
Expand Down

0 comments on commit 2dcd783

Please sign in to comment.