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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ Bottom level categories:
#### Metal

- Unconditionally enable `Features::CLIP_DISTANCES`. By @ErichDonGubler in [#9270](https://github.com/gfx-rs/wgpu/pull/9270).
- Added full support for mesh shaders, including in WGSL shaders. By @inner-daemons in [#8739](https://github.com/gfx-rs/wgpu/pull/8739).

### Changes

#### General

- `Features::CLIP_DISTANCE`, `naga::Capabilities::CLIP_DISTANCE`, and `naga::BuiltIn::ClipDistance` have been renamed to `CLIP_DISTANCES` and `ClipDistances` (viz., pluralized) as appropriate, to match the WebGPU spec. By @ErichDonGubler in [#9267](https://github.com/gfx-rs/wgpu/pull/9267).
- Added more granular limits for mesh shaders. By @inner-daemons in [#8739](https://github.com/gfx-rs/wgpu/pull/8739).

#### Validation

Expand Down
24 changes: 1 addition & 23 deletions examples/features/src/mesh_shader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,6 @@ fn compile_hlsl(device: &wgpu::Device, entry: &str, stage_str: &str) -> wgpu::Sh
}
}

fn compile_msl(device: &wgpu::Device) -> wgpu::ShaderModule {
unsafe {
device.create_shader_module_passthrough(wgpu::ShaderModuleDescriptorPassthrough {
label: None,
msl: Some(std::borrow::Cow::Borrowed(include_str!("shader.metal"))),
num_workgroups: (1, 1, 1),
..Default::default()
})
}
}

struct Shaders {
ts: wgpu::ShaderModule,
ms: wgpu::ShaderModule,
Expand All @@ -67,7 +56,7 @@ fn get_shaders(device: &wgpu::Device, backend: wgpu::Backend) -> Shaders {
// In the case that the platform does support mesh shaders, the dummy
// shader is used to avoid requiring PASSTHROUGH_SHADERS.
match backend {
wgpu::Backend::Vulkan => {
wgpu::Backend::Vulkan | wgpu::Backend::Metal => {
let compiled = compile_wgsl(device);
Shaders {
ts: compiled.clone(),
Expand All @@ -86,17 +75,6 @@ fn get_shaders(device: &wgpu::Device, backend: wgpu::Backend) -> Shaders {
ms_name: "main",
fs_name: "main",
},
wgpu::Backend::Metal => {
let compiled = compile_msl(device);
Shaders {
ts: compiled.clone(),
ms: compiled.clone(),
fs: compiled.clone(),
ts_name: "taskShader",
ms_name: "meshShader",
fs_name: "fragShader",
}
}
_ => unreachable!(),
}
}
Expand Down
77 changes: 0 additions & 77 deletions examples/features/src/mesh_shader/shader.metal

This file was deleted.

2 changes: 2 additions & 0 deletions naga-cli/src/bin/naga.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ fn run() -> anyhow::Result<()> {

params.spv_out.mesh_shader_primitive_indices_clamp = args.validate_mesh_output;
params.spv_out.task_dispatch_limits = args.task_limits.0;
params.msl.mesh_shader_primitive_indices_clamp = args.validate_mesh_output;
params.msl.task_dispatch_limits = args.task_limits.0;

if args.bulk_validate {
return bulk_validate(&args, &params);
Expand Down
2 changes: 1 addition & 1 deletion naga/src/back/msl/keywords.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ const RESERVED: &[&str] = &[
// Naga utilities
"DefaultConstructible",
// Naga builtin names
"__local_invocation_id",
"__local_invocation_index",
super::writer::FREXP_FUNCTION,
super::writer::MODF_FUNCTION,
super::writer::ABS_FUNCTION,
Expand Down
Loading
Loading