Tests: a mesh render pipeline compiles under the identity domains (red)

What: engine_mesh.rs, on every committed profile whose device lists VK_EXT_mesh_shader with
taskShader, meshShader, multiDrawIndirect and drawIndirectCount: the owned fixture mesh_draws'
mesh render pipeline, with and without its object function and with its fragment function
writing two RGBA32Uint colors, must compile, and each of its stages must pass L3 (spirv-val and
requirements within the profile).

Why: the mesh build makes the identity domains lower object and mesh functions. Today every
profile refuses them as Unsupported{IdentityDomains} of cause ObjectOrMeshStage, so this test
fails at this commit.

Verified: see the job named below.
This commit is contained in:
Anees Iqbal committed 2026-12-03 17:05:40 -08:00
1 parent b662250e62
commit fbf7edb539
1 file changed
+57
@@ -256,3 +256,60 @@ fn without_any_one_mesh_feature_mesh_stages_are_refused_naming_it() {
}
}
}
/// On every committed profile whose device lists `VK_EXT_mesh_shader` with all of
/// [`MESH_FEATURES`], mesh_draws' mesh render pipeline compiles under the identity domains, with
/// and without its object function, rasterizing into two `RGBA32Uint` colors, and each of its
/// stages passes L3 (`spirv-val` and requirements within the profile).
#[test]
fn a_mesh_pipeline_compiles_under_the_identity_domains() {
use crate::budget::Budget;
use crate::library::Library;
use crate::pipeline::descriptor::{
ColorAttachmentDescriptor, FunctionDescriptor, MeshPipelineDescriptor, StageSource,
};
use crate::spirv::testing::check_words_valid;
let Some(draws) = fixture("mesh_draws") else {
return;
};
let library = Library::from_air(&draws).expect("library");
let stage = |name: &str| {
StageSource::Function(FunctionDescriptor::new(
library.function(name).expect("function"),
))
};
let stems: Vec<String> = threadgroup_profiles()
.expect("committed profiles")
.into_iter()
.map(|(stem, _)| stem)
.filter(|stem| lists_mesh_shader(stem))
.collect();
assert!(
!stems.is_empty(),
"no committed profile lists the extension"
);
for stem in &stems {
let dev = device(stem);
for object in [None, Some("mesh_draws_object")] {
let what = format!("{stem} object {object:?}");
let mut d = MeshPipelineDescriptor::new(stage(match object {
Some(_) => "mesh_draws_mesh",
None => "mesh_draws_grid",
}));
d.object = object.map(stage);
d.fragment = Some(stage("mesh_draws_fragment"));
for slot in d.color_attachments.iter_mut().take(2) {
*slot = Some(ColorAttachmentDescriptor::new(
crate::metal::PixelFormat::RGBA32Uint,
));
}
let p = dev
.compile_mesh_pipeline(&d, &Budget::standard())
.unwrap_or_else(|e| panic!("{what}: {e}"));
for m in &p.stages {
check_words_valid(&m.spirv, &p.requirements, dev.profile())
.unwrap_or_else(|e| panic!("{what} {:?}: L3: {e}", m.stage));
}
}
}
}