Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
1c90d19
Initial commit
inner-daemons Aug 14, 2025
8c3e550
Other initial changes
inner-daemons Aug 14, 2025
85bbc5a
Updated shader snapshots
inner-daemons Aug 14, 2025
ccf8467
Added new HLSL limitation
inner-daemons Aug 17, 2025
e55c02f
Moved error to global variable error
inner-daemons Aug 17, 2025
f3a31a4
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Aug 17, 2025
0f6da75
Added docs to per_primitive
inner-daemons Aug 20, 2025
3017214
Added a little bit more docs here and there in IR
inner-daemons Aug 20, 2025
19b55b5
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Aug 20, 2025
198437b
Adding validation to ensure that task shaders have a task payload
inner-daemons Aug 20, 2025
64000e4
Updated spec to reflect the change to payload variables
inner-daemons Aug 20, 2025
0575e98
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Aug 22, 2025
b572ec7
Updated the mesh shading spec because it was goofy
inner-daemons Aug 24, 2025
34d0411
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Aug 24, 2025
02664e4
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Aug 24, 2025
7bec4dd
some doc tweaks
jimblandy Aug 25, 2025
2fcb853
Tried to clarify docs a little
inner-daemons Aug 25, 2025
3009b5a
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Aug 25, 2025
8bfe106
Tried to update spec
inner-daemons Aug 25, 2025
6ccaeec
Removed a warning
inner-daemons Aug 25, 2025
5b7ba11
Addressed comment about docs mistake
inner-daemons Aug 25, 2025
29c6972
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Aug 30, 2025
63fa8b5
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Sep 1, 2025
26c8681
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Sep 4, 2025
d9cac9c
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Sep 5, 2025
c112cb4
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Sep 8, 2025
e1ff67d
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Sep 11, 2025
64644f7
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Sep 15, 2025
739948b
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Sep 22, 2025
7ca25a4
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Sep 24, 2025
09ddbec
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Oct 1, 2025
2d6a647
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Oct 2, 2025
4657646
Review in progress
jimblandy Sep 2, 2025
41b654c
mesh_shading.md: more tweaks
jimblandy Oct 2, 2025
33ed0a6
Ran cargo fmt
inner-daemons Oct 2, 2025
53ecb39
Small tweaks
inner-daemons Oct 2, 2025
0ead329
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Oct 11, 2025
07bfb1f
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Oct 13, 2025
ba51fa2
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Oct 15, 2025
c4e3eef
[naga] Move definition of `ShaderStage::compute_like` to `proc`.
jimblandy Oct 15, 2025
8c9287d
Replace TODO comment with followup issue.
jimblandy Oct 16, 2025
8f04d4f
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Oct 16, 2025
3a8399d
Update analyzer.rs
inner-daemons Oct 16, 2025
879b79b
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Oct 16, 2025
d92fe67
Removed stuff in accordance with Jim's recommendation
inner-daemons Oct 16, 2025
2dc4090
minor changes for readability
jimblandy Oct 16, 2025
1ec734b
Pull mesh shader output type validation out into its own function.
jimblandy Oct 16, 2025
9ef0ed5
doc fixes
jimblandy Oct 16, 2025
1173b0f
remove duplicated task payload validation
jimblandy Oct 16, 2025
258e7e6
Quick little changes
inner-daemons Oct 16, 2025
8885c5d
Another quick fix
inner-daemons Oct 16, 2025
1cc3e85
Quick fix
inner-daemons Oct 16, 2025
3be2c25
Removed unnecessary TODO statement
inner-daemons Oct 16, 2025
21d3cc7
A
inner-daemons Oct 16, 2025
d5c11d3
Tried to be more expressive
inner-daemons Oct 16, 2025
82ec9c2
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons Oct 16, 2025
e7faff6
Made functions only work in mesh shader entry points
inner-daemons Oct 17, 2025
385535a
Various validation fix attempts
inner-daemons Oct 17, 2025
c3f9acd
Undid capabilities resize
inner-daemons Oct 17, 2025
d15ba19
WGSL PR is up :)
inner-daemons Oct 17, 2025
f14e0f0
Update naga/src/ir/mod.rs
inner-daemons Oct 17, 2025
7e12d30
Update naga/src/front/wgsl/error.rs
inner-daemons Oct 17, 2025
ce517bb
Update naga/src/ir/mod.rs
inner-daemons Oct 17, 2025
083959e
Other Erich suggestion
inner-daemons Oct 17, 2025
16aa7d0
Updated docs & validation for some builtins
inner-daemons Oct 17, 2025
76bfca0
Added some docs & removed contentious "// TODO"
inner-daemons Oct 17, 2025
e68d0d2
Merge branch 'trunk' into mesh-shading/wgsl-parse
inner-daemons Oct 22, 2025
0fd0fdd
Merge remote-tracking branch 'upstream/trunk' into mesh-shading/wgsl-…
inner-daemons Oct 30, 2025
e100034
Fixed bad validation, formatted mesh shader wgsl
inner-daemons Oct 30, 2025
edea07e
Rewrote the IR and parser significantly
inner-daemons Oct 31, 2025
3905ae8
Improved validation slightly, remvoed obselete crap, fixed bug in com…
inner-daemons Oct 31, 2025
8f6332d
Merge remote-tracking branch 'upstream/trunk' into mesh-shading/wgsl-…
inner-daemons Oct 31, 2025
f557cad
Some initial changes to adapt to new system
inner-daemons Oct 31, 2025
f18a32a
Undid stupid change to writer that I have no idea how it occured
inner-daemons Nov 1, 2025
d20ee08
Added changelog entry
inner-daemons Nov 1, 2025
64798dd
Added changelog entry
inner-daemons Nov 1, 2025
c85ad3f
Made tests & example use WGSL input for vulkan
inner-daemons Nov 1, 2025
cdcd600
Tried to fix capabiiities stuff
inner-daemons Nov 1, 2025
6e85c6d
Cleaned up some edge cases on mesh shader capabilities
inner-daemons Nov 1, 2025
9fc6dcb
Added mesh shader example test
inner-daemons Nov 3, 2025
1856416
Corrected bug in spirv writer
inner-daemons Nov 3, 2025
4b7a911
Merge branch 'trunk' into mesh-shading/spv-write
inner-daemons Nov 3, 2025
c8dccd3
Merge branch 'trunk' into mesh-shading/wgsl-parse
inner-daemons Nov 3, 2025
d638d42
FIxed MESH_DISABLED test
inner-daemons Nov 3, 2025
62e456c
Removed mesh disabled test cus its stupid
inner-daemons Nov 3, 2025
50ca382
Updated shader to try to make it pass tests
inner-daemons Nov 3, 2025
bd923cd
Made parser respect enable extension
inner-daemons Nov 3, 2025
d95070a
Updated mesh shader spec
inner-daemons Nov 3, 2025
55dc67a
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons Nov 3, 2025
ace7e17
Cleaned up the mesh shader analyzer function
inner-daemons Nov 3, 2025
f55dbd9
Merge branch 'trunk' into mesh-shading/wgsl-parse
inner-daemons Nov 5, 2025
3e1c6f9
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons Nov 5, 2025
f0d2cca
Merge branch 'trunk' into mesh-shading/spv-write
inner-daemons Nov 5, 2025
3b2bd30
Slight refactor & changed stuff to use "Word"
inner-daemons Nov 6, 2025
a061ee7
Made mesh shader builtins require mesh shader capability
inner-daemons Nov 6, 2025
bd965a7
Merge branch 'trunk' into mesh-shading/wgsl-parse
inner-daemons Nov 6, 2025
7be0aa4
Merge branch 'trunk' into mesh-shading/spv-write
inner-daemons Nov 6, 2025
a5d28e6
Improved some stuff
inner-daemons Nov 6, 2025
d6b6ce2
Added comments, cleaned stuff up
inner-daemons Nov 6, 2025
19213fb
A few more comments
inner-daemons Nov 6, 2025
46fbc37
Merge branch 'trunk' into mesh-shading/spv-write
inner-daemons Nov 7, 2025
c0278f3
Updated changelog
inner-daemons Nov 7, 2025
970be05
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons Nov 7, 2025
ab69a74
Merge branch 'trunk' into mesh-shading/wgsl-parse
inner-daemons Nov 7, 2025
e7dc9e5
Updated validation from spv-write
inner-daemons Nov 7, 2025
592ac16
Slight tweaks
inner-daemons Nov 7, 2025
f3daf23
Fix little typo
inner-daemons Nov 7, 2025
4398171
Added capabilitiy thing blah blah blah
inner-daemons Nov 7, 2025
b88fab5
Updated comment slightly to clarify something
inner-daemons Nov 8, 2025
ffa9219
Removed thing from mesh shader test
inner-daemons Nov 8, 2025
1f071a6
Fixed compaction & clean stuff up
inner-daemons Nov 8, 2025
7f744cf
Fixed compaction and such pt 2
inner-daemons Nov 8, 2025
9978847
Merge branch 'trunk' into mesh-shading/wgsl-parse
inner-daemons Nov 8, 2025
a031276
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons Nov 8, 2025
afb16fa
Updated code for the newly merged stuff
inner-daemons Nov 8, 2025
1d13726
Paved the way for primitive-index stuff
inner-daemons Nov 10, 2025
be308b9
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons Nov 10, 2025
942fe12
Added a single comment
inner-daemons Nov 10, 2025
25afe48
Little bit of cleanup
inner-daemons Nov 10, 2025
e4b9e23
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons Nov 10, 2025
d1f2e92
Updated snapshots
inner-daemons Nov 10, 2025
a15190b
Added a barrier thing
inner-daemons Nov 10, 2025
4f811ee
Made it clamp the number of vertices/primitives writte
inner-daemons Nov 10, 2025
453a150
Added new features/capabilities for point primitives and added snapsh…
inner-daemons Nov 10, 2025
2b96eb2
Updated spec to rename something
inner-daemons Nov 10, 2025
b3bfa73
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons Nov 10, 2025
4b7ba3a
Updated new snapshots with SPIR-V
inner-daemons Nov 10, 2025
f888b74
Fixed experimental features stuff
inner-daemons Nov 10, 2025
1fd690b
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons Nov 10, 2025
703bac7
Updated the spec
inner-daemons Nov 10, 2025
9de4741
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons Nov 10, 2025
6df4efa
Fixed new validation rule for task payload size
inner-daemons Nov 10, 2025
c13f7dd
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons Nov 10, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ By @SupaMaggie70Incorporated in [#8206](https://github.com/gfx-rs/wgpu/pull/8206
- Removed three features from `wgpu-hal` which did nothing useful: `"cargo-clippy"`, `"gpu-allocator"`, and `"rustc-hash"`. By @kpreid in [#8357](https://github.com/gfx-rs/wgpu/pull/8357).
- `wgpu_types::PollError` now always implements the `Error` trait. By @kpreid in [#8384](https://github.com/gfx-rs/wgpu/pull/8384).
- The texture subresources used by the color attachments of a render pass are no longer allowed to overlap when accessed via different texture views. By @andyleiserson in [#8402](https://github.com/gfx-rs/wgpu/pull/8402).
- The `STORAGE_READ_ONLY` texture usage is now permitted to coexist with other read-only usages. By @andyleiserson in [#8490](https://github.com/gfx-rs/wgpu/pull/8490).
- Validate that buffers are unmapped in `write_buffer` calls. By @ErichDonGubler in [#8454](https://github.com/gfx-rs/wgpu/pull/8454).
- Add WGSL parsing for mesh shaders. By @inner-daemons in [#8370](https://github.com/gfx-rs/wgpu/pull/8370).

#### DX12

Expand All @@ -149,6 +149,7 @@ By @SupaMaggie70Incorporated in [#8206](https://github.com/gfx-rs/wgpu/pull/8206
#### Vulkan

- Fixed a validation error regarding atomic memory semantics. By @atlv24 in [#8391](https://github.com/gfx-rs/wgpu/pull/8391).
- Add mesh shader writer support, allowing WGSL shaders to be used on the vulkan backend. By @inner-daemons in [#8456](https://github.com/gfx-rs/wgpu/pull/8456).

#### WebGPU

Expand Down
148 changes: 75 additions & 73 deletions docs/api-specs/mesh_shading.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/features/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ fn all_tests() -> Vec<wgpu_test::GpuTestInitializer> {
cube::TEST,
cube::TEST_LINES,
hello_synchronization::tests::SYNC,
mesh_shader::TEST,
mipmap::TEST,
mipmap::TEST_QUERY,
msaa_line::TEST,
Expand Down
90 changes: 44 additions & 46 deletions examples/features/src/mesh_shader/mod.rs
Original file line number Diff line number Diff line change
@@ -1,32 +1,9 @@
use std::process::Stdio;

// Same as in mesh shader tests
fn compile_glsl(device: &wgpu::Device, shader_stage: &'static str) -> wgpu::ShaderModule {
let cmd = std::process::Command::new("glslc")
.args([
&format!(
"{}/src/mesh_shader/shader.{shader_stage}",
env!("CARGO_MANIFEST_DIR")
),
"-o",
"-",
"--target-env=vulkan1.2",
"--target-spv=spv1.4",
])
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.spawn()
.expect("Failed to call glslc");
let output = cmd.wait_with_output().expect("Error waiting for glslc");
assert!(output.status.success());
unsafe {
device.create_shader_module_passthrough(wgpu::ShaderModuleDescriptorPassthrough {
entry_point: "main".into(),
label: None,
spirv: Some(wgpu::util::make_spirv_raw(&output.stdout)),
..Default::default()
})
}
fn compile_wgsl(device: &wgpu::Device) -> wgpu::ShaderModule {
device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: None,
source: wgpu::ShaderSource::Wgsl(include_str!("shader.wgsl").into()),
})
}
fn compile_hlsl(device: &wgpu::Device, entry: &str, stage_str: &str) -> wgpu::ShaderModule {
let out_path = format!(
Expand Down Expand Up @@ -71,21 +48,22 @@ impl crate::framework::Example for Example {
device: &wgpu::Device,
_queue: &wgpu::Queue,
) -> Self {
let (ts, ms, fs) = if adapter.get_info().backend == wgpu::Backend::Vulkan {
(
compile_glsl(device, "task"),
compile_glsl(device, "mesh"),
compile_glsl(device, "frag"),
)
} else if adapter.get_info().backend == wgpu::Backend::Dx12 {
(
compile_hlsl(device, "Task", "as"),
compile_hlsl(device, "Mesh", "ms"),
compile_hlsl(device, "Frag", "ps"),
)
} else {
panic!("Example can only run on vulkan or dx12");
};
let (ts, ms, fs, ts_name, ms_name, fs_name) =
if adapter.get_info().backend == wgpu::Backend::Vulkan {
let s = compile_wgsl(device);
(s.clone(), s.clone(), s, "ts_main", "ms_main", "fs_main")
} else if adapter.get_info().backend == wgpu::Backend::Dx12 {
(
compile_hlsl(device, "Task", "as"),
compile_hlsl(device, "Mesh", "ms"),
compile_hlsl(device, "Frag", "ps"),
"main",
"main",
"main",
)
} else {
panic!("Example can only run on vulkan or dx12");
};
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: None,
bind_group_layouts: &[],
Expand All @@ -96,17 +74,17 @@ impl crate::framework::Example for Example {
layout: Some(&pipeline_layout),
task: Some(wgpu::TaskState {
module: &ts,
entry_point: Some("main"),
entry_point: Some(ts_name),
compilation_options: Default::default(),
}),
mesh: wgpu::MeshState {
module: &ms,
entry_point: Some("main"),
entry_point: Some(ms_name),
compilation_options: Default::default(),
},
fragment: Some(wgpu::FragmentState {
module: &fs,
entry_point: Some("main"),
entry_point: Some(fs_name),
compilation_options: Default::default(),
targets: &[Some(config.view_formats[0].into())],
}),
Expand Down Expand Up @@ -179,3 +157,23 @@ impl crate::framework::Example for Example {
pub fn main() {
crate::framework::run::<Example>("mesh_shader");
}

#[cfg(test)]
#[wgpu_test::gpu_test]
pub static TEST: crate::framework::ExampleTestParams<Example> =
crate::framework::ExampleTestParams {
name: "mesh_shader",
// Generated on 1080ti on Vk/Windows
image_path: "/examples/features/src/mesh_shader/screenshot.png",
width: 1024,
height: 768,
optional_features: wgpu::Features::default(),
base_test_parameters: wgpu_test::TestParameters::default()
.features(
wgpu::Features::EXPERIMENTAL_MESH_SHADER
| wgpu::Features::EXPERIMENTAL_PASSTHROUGH_SHADERS,
)
.limits(wgpu::Limits::defaults().using_recommended_minimum_mesh_shader_values()),
comparisons: &[wgpu_test::ComparisonType::Mean(0.005)],
_phantom: std::marker::PhantomData::<Example>,
};
74 changes: 74 additions & 0 deletions examples/features/src/mesh_shader/shader.wgsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
enable mesh_shading;

const positions = array(
vec4(0., 1., 0., 1.),
vec4(-1., -1., 0., 1.),
vec4(1., -1., 0., 1.)
);
const colors = array(
vec4(0., 1., 0., 1.),
vec4(0., 0., 1., 1.),
vec4(1., 0., 0., 1.)
);
struct TaskPayload {
colorMask: vec4<f32>,
visible: bool,
}
var<task_payload> taskPayload: TaskPayload;
var<workgroup> workgroupData: f32;
struct VertexOutput {
@builtin(position) position: vec4<f32>,
@location(0) color: vec4<f32>,
}
struct PrimitiveOutput {
@builtin(triangle_indices) index: vec3<u32>,
@builtin(cull_primitive) cull: bool,
@per_primitive @location(1) colorMask: vec4<f32>,
}
struct PrimitiveInput {
@per_primitive @location(1) colorMask: vec4<f32>,
}

@task
@payload(taskPayload)
@workgroup_size(1)
fn ts_main() -> @builtin(mesh_task_size) vec3<u32> {
workgroupData = 1.0;
taskPayload.colorMask = vec4(1.0, 1.0, 0.0, 1.0);
taskPayload.visible = true;
return vec3(3, 1, 1);
}

struct MeshOutput {
@builtin(vertices) vertices: array<VertexOutput, 3>,
@builtin(primitives) primitives: array<PrimitiveOutput, 1>,
@builtin(vertex_count) vertex_count: u32,
@builtin(primitive_count) primitive_count: u32,
}

var<workgroup> mesh_output: MeshOutput;
@mesh(mesh_output)
@payload(taskPayload)
@workgroup_size(1)
fn ms_main(@builtin(local_invocation_index) index: u32, @builtin(global_invocation_id) id: vec3<u32>) {
mesh_output.vertex_count = 3;
mesh_output.primitive_count = 1;
workgroupData = 2.0;

mesh_output.vertices[0].position = positions[0];
mesh_output.vertices[0].color = colors[0] * taskPayload.colorMask;

mesh_output.vertices[1].position = positions[1];
mesh_output.vertices[1].color = colors[1] * taskPayload.colorMask;

mesh_output.vertices[2].position = positions[2];
mesh_output.vertices[2].color = colors[2] * taskPayload.colorMask;

mesh_output.primitives[0].index = vec3<u32>(0, 1, 2);
mesh_output.primitives[0].cull = !taskPayload.visible;
mesh_output.primitives[0].colorMask = vec4<f32>(1.0, 0.0, 1.0, 1.0);
}
@fragment
fn fs_main(vertex: VertexOutput, primitive: PrimitiveInput) -> @location(0) vec4<f32> {
return vertex.color * primitive.colorMask;
}
19 changes: 0 additions & 19 deletions naga/src/back/dot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,25 +307,6 @@ impl StatementGraph {
crate::RayQueryFunction::Terminate => "RayQueryTerminate",
}
}
S::MeshFunction(crate::MeshFunction::SetMeshOutputs {
vertex_count,
primitive_count,
}) => {
self.dependencies.push((id, vertex_count, "vertex_count"));
self.dependencies
.push((id, primitive_count, "primitive_count"));
"SetMeshOutputs"
}
S::MeshFunction(crate::MeshFunction::SetVertex { index, value }) => {
self.dependencies.push((id, index, "index"));
self.dependencies.push((id, value, "value"));
"SetVertex"
}
S::MeshFunction(crate::MeshFunction::SetPrimitive { index, value }) => {
self.dependencies.push((id, index, "index"));
self.dependencies.push((id, value, "value"));
"SetPrimitive"
}
S::SubgroupBallot { result, predicate } => {
if let Some(predicate) = predicate {
self.dependencies.push((id, predicate, "predicate"));
Expand Down
11 changes: 5 additions & 6 deletions naga/src/back/glsl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2675,11 +2675,6 @@ impl<'a, W: Write> Writer<'a, W> {
self.write_image_atomic(ctx, image, coordinate, array_index, fun, value)?
}
Statement::RayQuery { .. } => unreachable!(),
Statement::MeshFunction(
crate::MeshFunction::SetMeshOutputs { .. }
| crate::MeshFunction::SetVertex { .. }
| crate::MeshFunction::SetPrimitive { .. },
) => unreachable!(),
Statement::SubgroupBallot { result, predicate } => {
write!(self.out, "{level}")?;
let res_name = Baked(result).to_string();
Expand Down Expand Up @@ -5270,7 +5265,11 @@ const fn glsl_built_in(built_in: crate::BuiltIn, options: VaryingOptions) -> &'s
| Bi::PointIndex
| Bi::LineIndices
| Bi::TriangleIndices
| Bi::MeshTaskSize => {
| Bi::MeshTaskSize
| Bi::VertexCount
| Bi::PrimitiveCount
| Bi::Vertices
| Bi::Primitives => {
unimplemented!()
}
}
Expand Down
6 changes: 5 additions & 1 deletion naga/src/back/hlsl/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ impl crate::BuiltIn {
}
Self::CullPrimitive => "SV_CullPrimitive",
Self::PointIndex | Self::LineIndices | Self::TriangleIndices => unimplemented!(),
Self::MeshTaskSize => unreachable!(),
Self::MeshTaskSize
| Self::VertexCount
| Self::PrimitiveCount
| Self::Vertices
| Self::Primitives => unreachable!(),
})
}
}
Expand Down
13 changes: 0 additions & 13 deletions naga/src/back/hlsl/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2608,19 +2608,6 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> {
writeln!(self.out, ".Abort();")?;
}
},
Statement::MeshFunction(crate::MeshFunction::SetMeshOutputs {
vertex_count,
primitive_count,
}) => {
write!(self.out, "{level}SetMeshOutputCounts(")?;
self.write_expr(module, vertex_count, func_ctx)?;
write!(self.out, ", ")?;
self.write_expr(module, primitive_count, func_ctx)?;
write!(self.out, ");")?;
}
Statement::MeshFunction(
crate::MeshFunction::SetVertex { .. } | crate::MeshFunction::SetPrimitive { .. },
) => unimplemented!(),
Statement::SubgroupBallot { result, predicate } => {
write!(self.out, "{level}")?;
let name = Baked(result).to_string();
Expand Down
6 changes: 5 additions & 1 deletion naga/src/back/msl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,11 @@ impl ResolvedBinding {
Bi::CullPrimitive => "primitive_culled",
// TODO: figure out how to make this written as a function call
Bi::PointIndex | Bi::LineIndices | Bi::TriangleIndices => unimplemented!(),
Bi::MeshTaskSize => unreachable!(),
Bi::MeshTaskSize
| Bi::VertexCount
| Bi::PrimitiveCount
| Bi::Vertices
| Bi::Primitives => unreachable!(),
};
write!(out, "{name}")?;
}
Expand Down
8 changes: 0 additions & 8 deletions naga/src/back/msl/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4063,14 +4063,6 @@ impl<W: Write> Writer<W> {
}
}
}
// TODO: write emitters for these
crate::Statement::MeshFunction(crate::MeshFunction::SetMeshOutputs { .. }) => {
unimplemented!()
}
crate::Statement::MeshFunction(
crate::MeshFunction::SetVertex { .. }
| crate::MeshFunction::SetPrimitive { .. },
) => unimplemented!(),
crate::Statement::SubgroupBallot { result, predicate } => {
write!(self.out, "{level}")?;
let name = self.namer.call("");
Expand Down
20 changes: 0 additions & 20 deletions naga/src/back/pipeline_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -860,26 +860,6 @@ fn adjust_stmt(new_pos: &HandleVec<Expression, Handle<Expression>>, stmt: &mut S
crate::RayQueryFunction::Terminate => {}
}
}
Statement::MeshFunction(crate::MeshFunction::SetMeshOutputs {
ref mut vertex_count,
ref mut primitive_count,
}) => {
adjust(vertex_count);
adjust(primitive_count);
}
Statement::MeshFunction(
crate::MeshFunction::SetVertex {
ref mut index,
ref mut value,
}
| crate::MeshFunction::SetPrimitive {
ref mut index,
ref mut value,
},
) => {
adjust(index);
adjust(value);
}
Statement::Break
| Statement::Continue
| Statement::Kill
Expand Down
Loading
Loading