Skip to content

Commit 7b44e4e

Browse files
authored
Merge branch 'trunk' into metal-icb-multi-draw-indirect
2 parents 5e21ea7 + 83b9fa1 commit 7b44e4e

23 files changed

Lines changed: 887 additions & 517 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,10 @@ jobs:
844844
rustup override set ${{ env.REPO_MSRV }}
845845
cargo -V
846846
847+
# NOTE: Keep this above the others, because this will fail if there are _any_ changes to
848+
# files, even ones this step doesn't modify.
847849
- name: "Format `**/*.{md,js,html,yml}` files"
848-
run: npx --yes prettier@3.8.1 --check .
850+
run: "npx --yes prettier@3.8.1 --check --write . && git diff --exit-code"
849851

850852
- name: Run `cargo fmt`
851853
run: |

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,23 @@ Bottom level categories:
9696

9797
#### Vulkan
9898

99+
- Add OpenHarmony surface support via `VK_OHOS_surface`. Previously the Vulkan backend could not create a surface on OpenHarmony, leaving GLES as the only usable backend. By @ozongzi in [#9908](https://github.com/gfx-rs/wgpu/pull/9908).
99100
- Stop passing an un-waited fence to `vkAcquireNextImageKHR` on non-Windows platforms, which triggered `VUID-vkAcquireNextImageKHR-fence-10066` validation errors every frame since v30.0.0. By @ErichDonGubler in [#9855](https://github.com/gfx-rs/wgpu/issues/9855).
100101

101102
#### GLES
102103

103104
- Fixed signed integer `%` (and `%=`) returning the wrong result for negative operands in the GLSL (OpenGL/GLES) backend, e.g. `-1 % 768` yielding `255` instead of `-1`. GLSL's `%` is undefined when either operand is negative, so signed remainder is now lowered as `a - b * (a / b)`, matching the SPIR-V, HLSL, and Metal backends. By @mstampfli in [#9687](https://github.com/gfx-rs/wgpu/pull/9687).
104105

106+
#### WebGPU
107+
108+
- Recognize `GPUInternalError` when converting a WebGPU error, mapping it to `Error::Internal` instead of panicking with "Unexpected error". By @evilpies in [#9919](https://github.com/gfx-rs/wgpu/pull/9919).
109+
110+
### Documentation
111+
112+
#### General
113+
114+
- Fix the `BlasAabbGeometry` docs to refer to the `stride` field instead of a nonexistent `size.stride`, and document the packed AABB buffer layout (each primitive a minimum then a maximum corner, two consecutive `vec3<f32>`). By @mstampfli in [#9934](https://github.com/gfx-rs/wgpu/pull/9934).
115+
105116
### Dependency Updates
106117

107118
#### General
@@ -376,6 +387,7 @@ By @inner-daemons in [#9434](https://github.com/gfx-rs/wgpu/pull/9434).
376387

377388
#### Vulkan
378389

390+
- Use the imported queue family's supported shader stages when building buffer, texture, and acceleration structure barriers for raw Vulkan devices. By @ruihe774 in [#9594](https://github.com/gfx-rs/wgpu/pull/9594).
379391
- Fixed `SHADER_I16` not enabling `storage_buffer16_bit_access` or `storage_input_output16`, causing Vulkan validation errors when using 16-bit integers in buffers. By @JMS55 in [#9412](https://github.com/gfx-rs/wgpu/pull/9412).
380392
- Fixed validation errors when frames take longer than the specified swapchain acquire timeout. By @atlv24 in [#9405](https://github.com/gfx-rs/wgpu/pull/9405).
381393
- Fixed limits on Mesa's Honeykrisp / Asahi Linux. By @im-0 in [#9393](https://github.com/gfx-rs/wgpu/pull/9393).

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@ Contributors are welcome! See [CONTRIBUTING.md][contrib] for more information.
6565

6666
## Supported Platforms
6767

68-
| API | Windows | Linux/Android | macOS/iOS | Web (wasm) |
69-
| ------ | ------------ | --------------- | --------- | ----------- |
70-
| Vulkan ||| 🌋 | |
71-
| Metal | | || |
72-
| DX12 || | | |
73-
| OpenGL | 🆗 (GL 3.3+) | 🆗 (GL ES 3.0+) | 📐 | 🆗 (WebGL2) |
74-
| WebGPU | | | ||
68+
| API | Windows | Linux/Android | macOS/iOS | Web (wasm) |
69+
| ------ | ------------------- | --------------- | --------- | ----------- |
70+
| Vulkan | || 🌋 | |
71+
| Metal | | || |
72+
| DX12 | | | | |
73+
| OpenGL | 🆗 (GL 3.3+), or 📐 | 🆗 (GL ES 3.0+) | 📐 | 🆗 (WebGL2) |
74+
| WebGPU | | | ||
7575

7676
✅ = First Class Support
7777
🆗 = Downlevel/Best Effort Support
78-
📐 = Requires the [ANGLE](https://github.com/gfx-rs/wgpu/wiki/Running-on-ANGLE) translation layer (GL ES 3.0 only). Use the `angle` feature on macOS/iOS. On Windows, `gles` uses WGL by default; build with `cfg(windows_angle)` to use ANGLE instead.
78+
📐 = Requires the [ANGLE](https://github.com/gfx-rs/wgpu/wiki/Running-on-ANGLE) translation layer (GL ES 3.0 only). On macOS/iOS, use the `angle` feature. On Windows, `gles` uses WGL by default; build with `cfg(windows_angle)` to use ANGLE instead.
7979
🌋 = Requires the [MoltenVK](https://vulkan.lunarg.com/sdk/home#mac) translation layer
8080
🛠️ = Unsupported, though open to contributions
8181

player/src/bin/play.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ fn main() {
6868
#[cfg(feature = "winit")]
6969
let instance_desc =
7070
instance_desc.with_display_handle(Box::new(event_loop.owned_display_handle()));
71-
let instance_flags = instance_desc.flags;
7271
let instance = wgc::instance::Instance::new("player", instance_desc, None);
7372

7473
let (backends, device_desc) =
@@ -96,9 +95,7 @@ fn main() {
9695
let info = adapter.get_info();
9796
log::info!("Using '{}'", info.name);
9897

99-
let (device, queue) = adapter
100-
.request_device(&device_desc, instance_flags)
101-
.unwrap();
98+
let (device, queue) = adapter.request_device(&device_desc).unwrap();
10299

103100
let mut player = Player::default();
104101

@@ -151,7 +148,7 @@ fn main() {
151148
}
152149
.unwrap();
153150
self.window = Some(window);
154-
self.surface = Some(Arc::new(surface));
151+
self.surface = Some(surface);
155152
}
156153

157154
fn exiting(&mut self, _event_loop: &ActiveEventLoop) {

player/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl Player {
140140
}
141141
Action::CreateTextureView { id, parent, desc } => {
142142
let parent_texture = self.resolve_texture_id(parent);
143-
let (texture_view, _error) = device.create_texture_view(&parent_texture, &desc);
143+
let (texture_view, _error) = parent_texture.create_view(&desc);
144144
self.texture_views.insert(id, texture_view);
145145
}
146146
Action::DropTextureView(id) => {

player/tests/player/main.rs

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -74,24 +74,16 @@ impl Test<'_> {
7474
ron::de::from_str(&string).unwrap_or_else(|e| panic!("{path:?}:{} {}", e.span, e.code))
7575
}
7676

77-
fn run(
78-
self,
79-
dir: &Path,
80-
instance_flags: wgt::InstanceFlags,
81-
adapter: Arc<wgc::instance::Adapter>,
82-
) {
77+
fn run(self, dir: &Path, adapter: Arc<wgc::instance::Adapter>) {
8378
let (device, queue) = adapter
84-
.request_device(
85-
&wgt::DeviceDescriptor {
86-
label: None,
87-
required_features: self.features,
88-
required_limits: wgt::Limits::default(),
89-
experimental_features: unsafe { wgt::ExperimentalFeatures::enabled() },
90-
memory_hints: wgt::MemoryHints::default(),
91-
trace: wgt::Trace::Off,
92-
},
93-
instance_flags,
94-
)
79+
.request_device(&wgt::DeviceDescriptor {
80+
label: None,
81+
required_features: self.features,
82+
required_limits: wgt::Limits::default(),
83+
experimental_features: unsafe { wgt::ExperimentalFeatures::enabled() },
84+
memory_hints: wgt::MemoryHints::default(),
85+
trace: wgt::Trace::Off,
86+
})
9587
.unwrap();
9688

9789
let mut player = Player::default();
@@ -182,7 +174,6 @@ impl Corpus {
182174
println!("\t\tTest '{test_path:?}'");
183175

184176
let instance_desc = wgt::InstanceDescriptor::new_without_display_handle_from_env();
185-
let instance_flags = instance_desc.flags;
186177
let instance = wgc::instance::Instance::new("test", instance_desc, None);
187178
let adapter = match instance.request_adapter(
188179
&wgt::RequestAdapterOptions::default(),
@@ -211,7 +202,7 @@ impl Corpus {
211202
println!("\t\tSkipped due to missing compute shader capability");
212203
continue;
213204
}
214-
test.run(dir, instance_flags, adapter);
205+
test.run(dir, adapter);
215206
}
216207
}
217208
}

tests/wasm/runner/package-lock.json

Lines changed: 44 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wgpu-core/src/device/global.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,8 @@ impl Global {
332332
let fid = hub.texture_views.prepare(id_in);
333333

334334
let texture = hub.textures.get(texture_id);
335-
let device = &texture.device;
336335

337-
let (view, error) = device.create_texture_view(&texture, desc);
336+
let (view, error) = texture.create_view(desc);
338337

339338
let id = fid.assign(view);
340339

0 commit comments

Comments
 (0)