Skip to content

Commit

Permalink
Merge branch 'trunk' into update-deno
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats authored Sep 21, 2023
2 parents afe8a76 + 855fefc commit c9a1355
Show file tree
Hide file tree
Showing 50 changed files with 766 additions and 171 deletions.
7 changes: 7 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[alias]
xtask = "run --manifest-path xtask/Cargo.toml --"

[build]
rustflags = [
"--cfg=web_sys_unstable_apis"
]
1 change: 1 addition & 0 deletions .deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ allow = [
[sources]
allow-git = [
"https://github.com/grovesNL/glow",
"https://github.com/gfx-rs/metal-rs",
]
unknown-registry = "deny"
unknown-git = "deny"
Expand Down
6 changes: 4 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/cts_runner/ @crowlKats
/deno_webgpu/ @crowlKats
* @gfx-rs/wgpu

/cts_runner/ @gfx-rs/deno @gfx-rs/wgpu
/deno_webgpu/ @gfx-rs/deno @gfx-rs/wgpu
34 changes: 32 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,28 @@ let render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {

By @Valaphee in [#3402](https://github.com/gfx-rs/wgpu/pull/3402)


#### Render pass store operation is now an enum

`wgpu::Operations::store` used to be an underdocumented boolean value,
causing misunderstandings of the effect of setting it to `false`.

The API now more closely resembles WebGPU which distinguishes between `store` and `discard`,
see [WebGPU spec on GPUStoreOp](https://gpuweb.github.io/gpuweb/#enumdef-gpustoreop).

```diff
// ...
depth_ops: Some(wgpu::Operations {
load: wgpu::LoadOp::Clear(1.0),
- store: false,
+ store: wgpu::StoreOp::Discard,
}),
// ...
```

By @wumpf in [#4147](https://github.com/gfx-rs/wgpu/pull/4147)


### Added/New Features

- Add `gles_minor_version` field to `wgpu::InstanceDescriptor`. By @PJB3005 in [#3998](https://github.com/gfx-rs/wgpu/pull/3998)
Expand All @@ -72,11 +94,13 @@ By @Valaphee in [#3402](https://github.com/gfx-rs/wgpu/pull/3402)

#### General

- Update Naga to df8107b7 (2023-9-15). By @jimblandy in [#4149](https://github.com/gfx-rs/wgpu/pull/4149)
- Omit texture store bound checks since they are no-ops if out of bounds on all APIs. By @teoxoy in [#3975](https://github.com/gfx-rs/wgpu/pull/3975)
- Validate `DownlevelFlags::READ_ONLY_DEPTH_STENCIL`. By @teoxoy in [#4031](https://github.com/gfx-rs/wgpu/pull/4031)
- Add validation in accordance with WebGPU `setViewport` valid usage for `x`, `y` and `this.[[attachment_size]]`. By @James2022-rgb in [#4058](https://github.com/gfx-rs/wgpu/pull/4058)
- `wgpu::CreateSurfaceError` now gives details of the failure, but no longer implements `PartialEq`. By @kpreid in [#4066](https://github.com/gfx-rs/wgpu/pull/4066)
- `wgpu::CreateSurfaceError` and `wgpu::RequestDeviceError` now give details of the failure, but no longer implement `PartialEq` and cannot be constructed. By @kpreid in [#4066](https://github.com/gfx-rs/wgpu/pull/4066) and [#4145](https://github.com/gfx-rs/wgpu/pull/4145)
- Make `WGPU_POWER_PREF=none` a valid value. By @fornwall in [4076](https://github.com/gfx-rs/wgpu/pull/4076)
- Support dual source blending in OpenGL ES, Metal, Vulkan & DX12. By @freqmod in [4022](https://github.com/gfx-rs/wgpu/pull/4022)

#### Vulkan

Expand All @@ -86,7 +110,12 @@ By @Valaphee in [#3402](https://github.com/gfx-rs/wgpu/pull/3402)


### Documentation
- Use WGSL for VertexFormat example types. By @ScanMountGoat in [#4305](https://github.com/gfx-rs/wgpu/pull/4035)
- Use WGSL for VertexFormat example types. By @ScanMountGoat in [#4035](https://github.com/gfx-rs/wgpu/pull/4035)
- Fix description of `Features::TEXTURE_COMPRESSION_ASTC_HDR` in [#4157](https://github.com/gfx-rs/wgpu/pull/4157)

#### Metal

- Support for timestamp queries on encoders and passes. By @wumpf in [#4008](https://github.com/gfx-rs/wgpu/pull/4008)

### Bug Fixes

Expand All @@ -95,6 +124,7 @@ By @Valaphee in [#3402](https://github.com/gfx-rs/wgpu/pull/3402)
- Derive storage bindings via `naga::StorageAccess` instead of `naga::GlobalUse`. By @teoxoy in [#3985](https://github.com/gfx-rs/wgpu/pull/3985).
- `Queue::on_submitted_work_done` callbacks will now always be called after all previous `BufferSlice::map_async` callbacks, even when there are no active submissions. By @cwfitzgerald in [#4036](https://github.com/gfx-rs/wgpu/pull/4036).
- Fix `clear` texture views being leaked when `wgpu::SurfaceTexture` is dropped before it is presented. By @rajveermalviya in [#4057](https://github.com/gfx-rs/wgpu/pull/4057).
- Add `Feature::SHADER_UNUSED_VERTEX_OUTPUT` to allow unused vertex shader outputs. By @Aaron1011 in [#4116](https://github.com/gfx-rs/wgpu/pull/4116).

#### Vulkan
- Fix enabling `wgpu::Features::PARTIALLY_BOUND_BINDING_ARRAY` not being actually enabled in vulkan backend. By @39ali in[#3772](https://github.com/gfx-rs/wgpu/pull/3772).
Expand Down
17 changes: 8 additions & 9 deletions Cargo.lock

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

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ version = "0.17"

[workspace.dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "cc87b8f9eb30bb55d0735b89d3df3e099e1a6e7c"
rev = "df8107b7"
version = "0.13.0"

[workspace.dependencies]
Expand Down Expand Up @@ -142,7 +142,7 @@ deno_web = "0.150.0"
deno_webidl = "0.119.0"
deno_webgpu = { path = "./deno_webgpu" }
tokio = "1.32.0"
termcolor = "1.2.0"
termcolor = "1.3.0"

[patch."https://github.com/gfx-rs/naga"]
#naga = { path = "../naga" }
Expand All @@ -158,6 +158,8 @@ termcolor = "1.2.0"
#glow = { path = "../glow" }
#d3d12 = { path = "../d3d12-rs" }
#metal = { path = "../metal-rs" }
#metal = { path = "../metal-rs" }
metal = { git = "https://github.com/gfx-rs/metal-rs/", rev = "d24f1a4" } # More timer support via https://github.com/gfx-rs/metal-rs/pull/280
#web-sys = { path = "../wasm-bindgen/crates/web-sys" }
#js-sys = { path = "../wasm-bindgen/crates/js-sys" }
#wasm-bindgen = { path = "../wasm-bindgen" }
Expand Down
7 changes: 7 additions & 0 deletions deno_webgpu/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ fn deserialize_features(features: &wgpu_types::Features) -> Vec<&'static str> {
if features.contains(wgpu_types::Features::SHADER_EARLY_DEPTH_TEST) {
return_features.push("shader-early-depth-test");
}
if features.contains(wgpu_types::Features::SHADER_UNUSED_VERTEX_OUTPUT) {
return_features.push("shader-unused-vertex-output");
}

return_features
}
Expand Down Expand Up @@ -621,6 +624,10 @@ impl From<GpuRequiredFeatures> for wgpu_types::Features {
wgpu_types::Features::SHADER_EARLY_DEPTH_TEST,
required_features.0.contains("shader-early-depth-test"),
);
features.set(
wgpu_types::Features::SHADER_UNUSED_VERTEX_OUTPUT,
required_features.0.contains("shader-unused-vertex-output"),
);

features
}
Expand Down
2 changes: 1 addition & 1 deletion examples/boids/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ impl wgpu_example::framework::Example for Example {
// Not clearing here in order to test wgpu's zero texture initialization on a surface texture.
// Users should avoid loading uninitialized memory since this can cause additional overhead.
load: wgpu::LoadOp::Load,
store: true,
store: wgpu::StoreOp::Store,
},
})];
let render_pass_descriptor = wgpu::RenderPassDescriptor {
Expand Down
2 changes: 1 addition & 1 deletion examples/bunnymark/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ impl wgpu_example::framework::Example for Example {
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(clear_color),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: None,
Expand Down
2 changes: 1 addition & 1 deletion examples/capture/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async fn create_red_image_with_dimensions(
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(wgpu::Color::RED),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: None,
Expand Down
4 changes: 2 additions & 2 deletions examples/conservative-raster/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ impl wgpu_example::framework::Example for Example {
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(wgpu::Color::BLACK),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: None,
Expand All @@ -290,7 +290,7 @@ impl wgpu_example::framework::Example for Example {
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(wgpu::Color::BLACK),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: None,
Expand Down
2 changes: 1 addition & 1 deletion examples/cube/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ impl wgpu_example::framework::Example for Example {
b: 0.3,
a: 1.0,
}),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: None,
Expand Down
2 changes: 1 addition & 1 deletion examples/hello-triangle/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(wgpu::Color::GREEN),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: None,
Expand Down
2 changes: 1 addition & 1 deletion examples/hello-windows/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async fn run(event_loop: EventLoop<()>, viewports: Vec<(Window, wgpu::Color)>) {
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(viewport.desc.background),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: None,
Expand Down
4 changes: 2 additions & 2 deletions examples/mipmap/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl Example {
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(wgpu::Color::WHITE),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: None,
Expand Down Expand Up @@ -490,7 +490,7 @@ impl wgpu_example::framework::Example for Example {
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(clear_color),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: None,
Expand Down
4 changes: 2 additions & 2 deletions examples/msaa-line/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ impl wgpu_example::framework::Example for Example {
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(wgpu::Color::BLACK),
store: true,
store: wgpu::StoreOp::Store,
},
}
} else {
Expand All @@ -293,7 +293,7 @@ impl wgpu_example::framework::Example for Example {
load: wgpu::LoadOp::Clear(wgpu::Color::BLACK),
// Storing pre-resolve MSAA data is unnecessary if it isn't used later.
// On tile-based GPU, avoid store can reduce your app's memory footprint.
store: false,
store: wgpu::StoreOp::Discard,
},
}
};
Expand Down
6 changes: 3 additions & 3 deletions examples/shadow/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ impl wgpu_example::framework::Example for Example {
view: &light.target_view,
depth_ops: Some(wgpu::Operations {
load: wgpu::LoadOp::Clear(1.0),
store: true,
store: wgpu::StoreOp::Store,
}),
stencil_ops: None,
}),
Expand Down Expand Up @@ -810,14 +810,14 @@ impl wgpu_example::framework::Example for Example {
b: 0.3,
a: 1.0,
}),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: Some(wgpu::RenderPassDepthStencilAttachment {
view: &self.forward_depth,
depth_ops: Some(wgpu::Operations {
load: wgpu::LoadOp::Clear(1.0),
store: false,
store: wgpu::StoreOp::Discard,
}),
stencil_ops: None,
}),
Expand Down
4 changes: 2 additions & 2 deletions examples/skybox/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,14 @@ impl wgpu_example::framework::Example for Skybox {
b: 0.3,
a: 1.0,
}),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: Some(wgpu::RenderPassDepthStencilAttachment {
view: &self.depth_view,
depth_ops: Some(wgpu::Operations {
load: wgpu::LoadOp::Clear(1.0),
store: false,
store: wgpu::StoreOp::Discard,
}),
stencil_ops: None,
}),
Expand Down
4 changes: 2 additions & 2 deletions examples/stencil-triangles/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,15 @@ impl wgpu_example::framework::Example for Triangles {
b: 0.3,
a: 1.0,
}),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: Some(wgpu::RenderPassDepthStencilAttachment {
view: &depth_view,
depth_ops: None,
stencil_ops: Some(wgpu::Operations {
load: wgpu::LoadOp::Clear(0),
store: true,
store: wgpu::StoreOp::Store,
}),
}),
timestamp_writes: None,
Expand Down
2 changes: 1 addition & 1 deletion examples/texture-arrays/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ impl wgpu_example::framework::Example for Example {
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(wgpu::Color::BLACK),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: None,
Expand Down
Loading

0 comments on commit c9a1355

Please sign in to comment.