pipeline: RenderPipeline::mesh_info and MeshPipelineMetalInfo go

A mesh render pipeline's answers to Metal's mesh queries (maxTotalThreadsPerObjectThreadgroup,
maxTotalThreadsPerMeshThreadgroup, the two execution widths, maxTotalThreadgroupsPerMeshGrid)
were computed at every compile_mesh_pipeline and read by nothing outside the translator's own
test of them. The runtime compiles no mesh pipeline: its rendering stays on vertex functions,
and the conformance suite's rt side answers mesh_pipeline_limits Unavailable. The consumer reads
none of it.

Deleted: the field, the struct and its re-export, Device::mesh_info (the private compile of the
answers) with METAL_MESH_GRID_THREADGROUPS, its only reader, the codec rows, the content
digest's row, and the test a_mesh_pipeline_answers_metals_mesh_queries_within_the_device. The
mesh descriptor's thread and grid maxima stay: Metal's refusals of the thread maxima
(MeshPipelineProblem) read them, and their docs no longer point at the answers. Metal refuses no
grid maximum, so after this nothing but the descriptor and artifact keys reads
max_total_threadgroups_per_mesh_grid.

ARTIFACT_FORMAT_VERSION 566 -> 567: RenderPipeline's encoding loses a field. Every render
pipeline's content digest changes (one row fewer); module words do not, so the golden hashes
and SEMANTICS_VERSION do not move.

Consumer search (~/.cache/m2v-orch/consumer-uses.sh, the consumer's development a48b3984af plus
its 66 steelbrain/* refs younger than a day):
- mesh_info: 0 hits (code)
- MeshPipelineMetalInfo: 0 hits (code)
- compile_mesh_pipeline: 0 hits (code)
- the five field names max_total_threads_per_object_threadgroup,
  max_total_threads_per_mesh_threadgroup, object_thread_execution_width,
  mesh_thread_execution_width and max_total_threadgroups_per_mesh_grid: hits, all the
  consumer's own names. They are its wire and decode records of the guest's descriptor, and
  rt_platform/render_pipeline.rs's state methods, which answer 0 ("no object stage" / "no mesh
  stage"). None reads this struct, and the struct and the field that holds it have 0 hits.

api_signatures blessed (scripts/api-signatures/signatures.py --bless): 7 records removed, the
struct, its five fields and RenderPipeline.mesh_info. api_surface loses the struct's row.
This commit is contained in:
Anees Iqbal committed 2026-11-20 16:37:26 -08:00
1 parent 4535dd7e0d
commit 453eec0373
12 files changed
+24 -291

No files matched your search

+1 -3
View File
@@ -143,7 +143,7 @@ impl RenderPipeline {
/// The pipeline's content digest: [`ComputePipeline::content_digest`]'s definition over a
/// render pipeline. It covers every field but `key` and `profile`: each stage's module, the
/// layout, the vertex input, the fixed-function state, the runtime dependencies, the interface,
/// the requirements, the variant bits and a mesh pipeline's answers. It is equal across builds whose pipelines for an
/// the requirements and the variant bits. It is equal across builds whose pipelines for an
/// input say the same thing, changes whenever covered content changes, and authenticates
/// nothing, as the compute pipeline's.
pub fn content_digest(&self) -> Hash256 {
@@ -158,7 +158,6 @@ impl RenderPipeline {
interface,
requirements,
variant_bits,
mesh_info,
} = self;
Node::fields(&mut [
("stages", stages.digest()),
@@ -169,7 +168,6 @@ impl RenderPipeline {
("interface", interface.digest()),
("requirements", requirements.digest()),
("variant_bits", variant_bits.digest()),
("mesh_info", mesh_info.digest()),
])
.root("render pipeline")
}
+4 -9
View File
@@ -33,9 +33,9 @@ use crate::metal;
use crate::metal::format::{ExtendedRange, WordAttachment, WordField};
use crate::metal::{CompareFunction, TextureWriteRoundingMode};
use crate::pipeline::artifact::{
ComputePipeline, ComputePipelineMetalInfo, MeshPipelineMetalInfo, ModuleStats, PrecisionNote,
Reconvergence, RenderPipeline, RuntimeDependency, SpecClause, SpecConstant, SpecTest,
SpecializationLayout, SpecializedNote, StageModule, StrategyCensus, StrategyUse,
ComputePipeline, ComputePipelineMetalInfo, ModuleStats, PrecisionNote, Reconvergence,
RenderPipeline, RuntimeDependency, SpecClause, SpecConstant, SpecTest, SpecializationLayout,
SpecializedNote, StageModule, StrategyCensus, StrategyUse,
};
use crate::pipeline::descriptor::TessellationDescriptor;
use crate::pipeline::facts::{Mechanism, RuntimeFact, UniformViewChoice};
@@ -1368,12 +1368,7 @@ codec_struct! {
}
RenderPipeline {
key, profile, stages, layout, vertex_input, graphics, dependencies, interface,
requirements, variant_bits, mesh_info,
}
MeshPipelineMetalInfo {
max_total_threads_per_object_threadgroup, max_total_threads_per_mesh_threadgroup,
object_thread_execution_width, mesh_thread_execution_width,
max_total_threadgroups_per_mesh_grid,
requirements, variant_bits,
}
StageModule {
stage, entry_point, spirv, specialization, required_subgroup_size, stage_flags,
+1 -1
View File
@@ -71,7 +71,7 @@ pub const SEMANTICS_VERSION: u32 = 2223;
/// re-typed in an encoded type, its `codec` body or its `envelope`. A variant removed while its tag
/// stays unused needs no bump: an entry holding it fails to decode, which is a miss. The commit that
/// bumps it says what changed; this comment keeps no history.
pub const ARTIFACT_FORMAT_VERSION: u32 = 566;
pub const ARTIFACT_FORMAT_VERSION: u32 = 567;
/// The version of what this crate's runtime does with a compiled pipeline: instantiating a binding
/// plan (`BindingPlan::instantiate_*`: descriptor ranges, push bytes, root, argument, and handle
+1 -3
View File
@@ -1831,9 +1831,7 @@ pub enum ComputePipelineProblem {
/// refuses, measured on an M3 Max under macOS 27.0.1 (`mesh_pipeline_limits.m`, plain and with
/// `MTL_DEBUG_LAYER=1`, which agree). Metal's creation fails over some, an error, and its
/// descriptor validation ends the process at the rest, with or without API validation; each
/// variant says which. The thread limit is Metal's 1024, not a lower one of this device's (the
/// compiled pipeline's [`MeshPipelineMetalInfo`](crate::pipeline::MeshPipelineMetalInfo)
/// answers that one).
/// variant says which. The thread limit is Metal's 1024, not a lower one of this device's.
#[non_exhaustive]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum MeshPipelineProblem {
+3 -3
View File
@@ -343,9 +343,9 @@ pub struct FunctionArtifact {
pub specialized: Vec<crate::pipeline::artifact::SpecializedNote>,
}
/// What a kernel's `ComputePipelineMetalInfo`, and an object or mesh function's
/// `MeshPipelineMetalInfo`, need from its compile. A vertex or fragment function has the default:
/// no attribute, not flattened, no threadgroup memory.
/// What a kernel's `ComputePipelineMetalInfo`, and an object or mesh function's checks against its
/// mesh descriptor, need from its compile. A vertex or fragment function has the default: no
/// attribute, not flattened, no threadgroup memory.
#[non_exhaustive]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct KernelFacts {
@@ -42,9 +42,6 @@ pub struct RenderPipeline {
pub requirements: Requirements,
/// Specialization and variant bits the pipeline can take.
pub variant_bits: u32,
/// A mesh render pipeline's answers to Metal's mesh queries (`Device::compile_mesh_pipeline`);
/// `None` for a render pipeline of a vertex function.
pub mesh_info: Option<MeshPipelineMetalInfo>,
}
impl RenderPipeline {
@@ -480,37 +477,6 @@ impl RuntimeDependency {
}
}
/// Answers to Metal's queries of a mesh render pipeline's state (`MTLRenderPipelineState`'s
/// mesh properties), as an M3 Max under macOS 27.0.1 answers them on a first compile of the
/// functions (`mesh_pipeline_limits.m`). Each thread limit is Metal's: the least of the
/// descriptor's maximum, the stage function's own `[[max_total_threads_per_threadgroup(n)]]`,
/// the threads of the stage's required threadgroup size and 1024 (Metal refuses a descriptor
/// maximum other than the function's or the required size's threads, and any of them above
/// 1024, [`MeshPipelineProblem`](crate::error::MeshPipelineProblem)), held to this device's
/// limit for the stage where that is lower: `maxTaskWorkGroupInvocations` and
/// `maxMeshWorkGroupInvocations`.
#[non_exhaustive]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct MeshPipelineMetalInfo {
/// `maxTotalThreadsPerObjectThreadgroup`: the object stage's thread limit (above); 0 for a
/// pipeline without an object function, where the M3 Max answers 3 (docs/API.md, accepted
/// differences).
pub max_total_threads_per_object_threadgroup: u32,
/// `maxTotalThreadsPerMeshThreadgroup`: the mesh stage's thread limit (above).
pub max_total_threads_per_mesh_threadgroup: u32,
/// `objectThreadExecutionWidth`: 32, the width of the simdgroups an object function runs
/// in, as a kernel's (`MetalDeviceProperties::thread_execution_width`); 0 for a pipeline
/// without an object function, where the M3 Max answers 32.
pub object_thread_execution_width: u32,
/// `meshThreadExecutionWidth`: 32, as [`object_thread_execution_width`](Self::object_thread_execution_width).
pub mesh_thread_execution_width: u32,
/// `maxTotalThreadgroupsPerMeshGrid`: the descriptor's maximum, else Metal's 2^20 (an object
/// function's `[[max_total_threadgroups_per_mesh_grid(n)]]` changes neither), held to the
/// device's `maxMeshWorkGroupTotalCount` where that is lower.
pub max_total_threadgroups_per_mesh_grid: u32,
}
/// Answers to Metal's per-pipeline compute queries.
#[non_exhaustive]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
@@ -34,8 +34,8 @@ use crate::library::{CompiledFunction, FunctionArtifact, FunctionCompileKey};
use crate::lower::select::LowerInputs;
use crate::lower::simd::workgroup::arena_bytes;
use crate::pipeline::artifact::{
ComputePipeline, ComputePipelineMetalInfo, MeshPipelineMetalInfo, PrecisionNote,
RenderPipeline, RuntimeDependency, StageModule,
ComputePipeline, ComputePipelineMetalInfo, PrecisionNote, RenderPipeline, RuntimeDependency,
StageModule,
};
use crate::pipeline::compile::key::{
function_key, mesh_descriptor_key, pipeline_key, queried_render_descriptor_key,
@@ -673,7 +673,6 @@ impl Device {
let dependencies = dependencies(&artifacts, self);
let (graphics, requirements) = graphics_requirements(requirements, &linked, &artifacts, p)?;
let profile = self.profile_fingerprint();
let mesh_info = self.mesh_info(d, object.as_ref(), &mesh);
Ok(RenderPipeline {
key: pipeline_key(
b"mesh",
@@ -690,69 +689,9 @@ impl Device {
interface: linked.interface,
requirements,
variant_bits: artifacts.iter().fold(0, |bits, a| bits | a.variant_bits),
mesh_info: Some(mesh_info),
})
}
/// Answers to Metal's queries of the mesh render pipeline of descriptor `d`, of object function
/// `object` (where it has one) and mesh function `mesh` ([`MeshPipelineMetalInfo`]).
fn mesh_info(
&self,
d: &MeshPipelineDescriptor,
object: Option<&CompiledFunction>,
mesh: &CompiledFunction,
) -> MeshPipelineMetalInfo {
let p = self.profile();
let limits = &p.fields().limits;
// Each stage's threadgroups run in the task and mesh stages.
let (object_limit, mesh_limit) = (
limits.mesh.max_task_work_group_invocations,
limits.mesh.max_mesh_work_group_invocations,
);
// Metal's on a first compile: the least of 1024, the function's own maximum, the
// descriptor's (Metal's 0 is none) and the threads of the stage's required size (Metal's
// all-zero size is none), within the device's.
let threads =
|f: &CompiledFunction, given: Option<u32>, required: Option<[u32; 3]>, device: u32| {
let required = required_size(required).map(|axes| {
let threads: u64 = axes.iter().map(|&axis| u64::from(axis)).product();
u32::try_from(threads).unwrap_or(u32::MAX)
});
[f.artifact().kernel.max_total_threads, given, required]
.into_iter()
.flatten()
.filter(|&n| n > 0)
.fold(METAL_MAX_THREADS.min(device), u32::min)
};
let width = self.metal_properties().thread_execution_width;
// The descriptor's, else Metal's: an object function's
// `[[max_total_threadgroups_per_mesh_grid(n)]]` changes nothing Metal answers.
let grid = d
.max_total_threadgroups_per_mesh_grid
.filter(|&n| n > 0)
.unwrap_or(METAL_MESH_GRID_THREADGROUPS);
let grid = grid.min(limits.mesh.max_mesh_work_group_total_count);
MeshPipelineMetalInfo {
max_total_threads_per_object_threadgroup: object.map_or(0, |o| {
threads(
o,
d.max_total_threads_per_object_threadgroup,
d.required_threads_per_object_threadgroup,
object_limit,
)
}),
max_total_threads_per_mesh_threadgroup: threads(
mesh,
d.max_total_threads_per_mesh_threadgroup,
d.required_threads_per_mesh_threadgroup,
mesh_limit,
),
object_thread_execution_width: object.map_or(0, |_| width),
mesh_thread_execution_width: width,
max_total_threadgroups_per_mesh_grid: grid,
}
}
/// A stage from its source: compiled now under `inputs`, or taken as compiled (link and
/// relocate only) when it was compiled for this device's profile.
/// [`Device::stage`] of a render pipeline's fragment stage `src`, reading a `Function`
@@ -1109,7 +1048,6 @@ impl Device {
interface: linked.interface,
requirements,
variant_bits: artifacts.iter().fold(0, |bits, a| bits | a.variant_bits),
mesh_info: None,
})
}
@@ -1463,11 +1401,6 @@ const TILE_MAX_THREADS: u32 = TILE_MAX_SIDE * TILE_MAX_SIDE;
/// Apple's GPUs' threads a threadgroup (a threadgroup of 2048 ran nothing on an M4).
const METAL_MAX_THREADS: u32 = 1024;
/// `maxTotalThreadgroupsPerMeshGrid` of a mesh render pipeline whose descriptor sets none, as an
/// M3 Max under macOS 27.0.1 answers it, whatever its object function's
/// `[[max_total_threadgroups_per_mesh_grid(n)]]`.
const METAL_MESH_GRID_THREADGROUPS: u32 = 1 << 20;
/// The most bytes of a mesh render pipeline's `payloadMemoryLength` Metal makes a pipeline of (an
/// M3 Max under macOS 27.0.1).
const METAL_MAX_PAYLOAD: u32 = 16384;
@@ -1917,8 +1850,8 @@ fn primitive_varyings_written(a: &FunctionArtifact) -> std::collections::BTreeSe
.collect()
}
/// The mesh descriptor fields the artifact depends on: its fixed-function state, as a render
/// pipeline's ([`render_fields`]), and the limits its `mesh_info` answers within.
/// The mesh descriptor fields the artifact's key holds: its fixed-function state, as a render
/// pipeline's ([`render_fields`]), and its thread and grid maxima.
fn mesh_fields(d: &MeshPipelineDescriptor) -> String {
format!(
"{:?} {:?} {:?} {:?}",
+6 -18
View File
@@ -740,29 +740,17 @@ pub struct MeshPipelineDescriptor {
/// `float` outputs to half-float color attachments round by it.
pub texture_write_rounding_mode: metal::TextureWriteRoundingMode,
/// `maxTotalThreadsPerObjectThreadgroup`: `None` for Metal's 0, the object function's
/// `[[max_total_threads_per_threadgroup(n)]]` or else Metal's 1024. The compiled pipeline's
/// [`MeshPipelineMetalInfo::max_total_threads_per_object_threadgroup`] answers it within the
/// device's limit. Refused as Metal refuses it
/// ([`MeshPipelineProblem`](crate::error::MeshPipelineProblem)): above 1024, or beside a
/// `[[max_total_threads_per_threadgroup(n)]]` or else Metal's 1024. Refused as Metal refuses
/// it ([`MeshPipelineProblem`](crate::error::MeshPipelineProblem)): above 1024, or beside a
/// function's maximum of other threads. A draw is not held to it.
///
/// [`MeshPipelineMetalInfo::max_total_threads_per_object_threadgroup`]: crate::pipeline::MeshPipelineMetalInfo::max_total_threads_per_object_threadgroup
pub max_total_threads_per_object_threadgroup: Option<u32>,
/// `maxTotalThreadsPerMeshThreadgroup`: as
/// [`max_total_threads_per_object_threadgroup`](Self::max_total_threads_per_object_threadgroup),
/// of the mesh stage, answered as
/// [`MeshPipelineMetalInfo::max_total_threads_per_mesh_threadgroup`]; also refused beside a
/// required mesh threadgroup size of other threads.
///
/// [`MeshPipelineMetalInfo::max_total_threads_per_mesh_threadgroup`]: crate::pipeline::MeshPipelineMetalInfo::max_total_threads_per_mesh_threadgroup
/// of the mesh stage; also refused beside a required mesh threadgroup size of other threads.
pub max_total_threads_per_mesh_threadgroup: Option<u32>,
/// `maxTotalThreadgroupsPerMeshGrid`: `None` for Metal's 0, which answers 2^20 whatever the
/// object function's `[[max_total_threadgroups_per_mesh_grid(n)]]`. The compiled pipeline's
/// [`MeshPipelineMetalInfo::max_total_threadgroups_per_mesh_grid`] answers it, within the
/// device's limit where it runs mesh functions natively; Metal takes any count, above the
/// object function's attribute too. An object function's grid is not held to it.
///
/// [`MeshPipelineMetalInfo::max_total_threadgroups_per_mesh_grid`]: crate::pipeline::MeshPipelineMetalInfo::max_total_threadgroups_per_mesh_grid
/// `maxTotalThreadgroupsPerMeshGrid`: `None` for Metal's 0. Metal takes any count, above the
/// object function's `[[max_total_threadgroups_per_mesh_grid(n)]]` too. An object function's
/// grid is not held to it.
pub max_total_threadgroups_per_mesh_grid: Option<u32>,
/// `objectThreadgroupSizeIsMultipleOfThreadExecutionWidth`: a promise to Metal's optimizer
/// that each draw's object threadgroup is a multiple of 32 threads. No compiled module
+4 -5
View File
@@ -19,8 +19,7 @@
//! - one [`PipelineLayout`]: dense descriptor set layouts and push-constant ranges, to create as
//! they are (no renumbering);
//! - a render pipeline's [`VertexInputState`] and [`GraphicsState`] (with a
//! [`TessellationState`] when it tessellates, and a mesh render pipeline's answers to Metal's
//! mesh queries, [`MeshPipelineMetalInfo`]), or a compute pipeline's answers to Metal's
//! [`TessellationState`] when it tessellates), or a compute pipeline's answers to Metal's
//! per-pipeline queries ([`ComputePipelineMetalInfo`]);
//! - the [`PipelineInterface`]: every statically used Metal argument slot ([`SlotRef`]), how the
//! shader accesses it, and each buffer's proven byte window;
@@ -105,9 +104,9 @@ pub(crate) mod tile_map;
pub(crate) mod vertex;
pub use artifact::{
ComputePipeline, ComputePipelineMetalInfo, EntryMath, MeshPipelineMetalInfo, ModuleStats,
PrecisionNote, Reconvergence, RenderPipeline, RuntimeDependency, SpecClause, SpecConstant,
SpecTest, SpecializationLayout, SpecializedNote, StageModule, StrategyCensus, StrategyUse,
ComputePipeline, ComputePipelineMetalInfo, EntryMath, ModuleStats, PrecisionNote,
Reconvergence, RenderPipeline, RuntimeDependency, SpecClause, SpecConstant, SpecTest,
SpecializationLayout, SpecializedNote, StageModule, StrategyCensus, StrategyUse,
};
pub use descriptor::{
ColorAttachmentDescriptor, ComputePipelineDescriptor, DynamicLibraries, FunctionDescriptor,
@@ -1339,142 +1339,6 @@ fn a_mesh_functions_buffer_writes_need_no_stage_store_feature() {
}
}
/// A mesh render pipeline's answers to Metal's mesh queries (`RenderPipeline::mesh_info`), on
/// every committed profile with `VK_EXT_mesh_shader`: each stage's thread limit is the least of the
/// descriptor's maximum, the function's `[[max_total_threads_per_threadgroup(n)]]`, the threads of
/// the stage's required size and 1024, within the device's limit for the stage (the task and mesh
/// stages' invocations); the widths are
/// 32; the mesh grid is the descriptor's maximum, else 2^20 whatever the object function's
/// `[[max_total_threadgroups_per_mesh_grid(n)]]`, within the device's `maxMeshWorkGroupTotalCount`.
/// Without an object function the object stage answers 0
/// and 0. Each as an M3 Max answers on a first compile (`mesh_pipeline_limits.m`).
#[test]
fn a_mesh_pipeline_answers_metals_mesh_queries_within_the_device() {
use crate::budget::Budget;
use crate::library::Library;
use crate::pipeline::descriptor::{FunctionDescriptor, MeshPipelineDescriptor, StageSource};
use crate::pipeline::MeshPipelineMetalInfo;
let (Some(draws), Some(outputs)) = (fixture("mesh_draws"), fixture("mesh_outputs")) else {
return;
};
let (draws, outputs) = (
Library::from_air(&draws).expect("library"),
Library::from_air(&outputs).expect("library"),
);
let stage = |lib: &Library, name: &str| {
StageSource::Function(FunctionDescriptor::new(
lib.function(name).expect("function"),
))
};
let budget = Budget::standard();
for (stem, p) in mesh_profiles() {
let dev = device(&stem);
let l = &p.fields().limits;
let (object, mesh, total) = (
l.mesh.max_task_work_group_invocations,
l.mesh.max_mesh_work_group_invocations,
l.mesh.max_mesh_work_group_total_count,
);
let info = |d: &MeshPipelineDescriptor| {
dev.compile_mesh_pipeline(d, &budget)
.unwrap_or_else(|e| panic!("{stem}: {e}"))
.mesh_info
.unwrap_or_else(|| panic!("{stem}: a mesh pipeline's answers"))
};
let mut d = MeshPipelineDescriptor::new(stage(&draws, "mesh_draws_mesh"));
d.object = Some(stage(&draws, "mesh_draws_object"));
d.rasterization_enabled = false;
let answers = |o: u32, m: u32, ow: u32, g: u32| MeshPipelineMetalInfo {
max_total_threads_per_object_threadgroup: o,
max_total_threads_per_mesh_threadgroup: m,
object_thread_execution_width: ow,
mesh_thread_execution_width: 32,
max_total_threadgroups_per_mesh_grid: g,
};
assert_eq!(
info(&d),
answers(object.min(1024), mesh.min(1024), 32, total.min(1 << 20)),
"{stem}"
);
// The descriptor's maxima, a grid past 2^20 among them, and a required size of the
// object maximum's threads.
let mut limited = d.clone();
limited.max_total_threads_per_object_threadgroup = Some(64);
limited.max_total_threads_per_mesh_threadgroup = Some(32);
limited.max_total_threadgroups_per_mesh_grid = Some(8);
assert_eq!(
info(&limited),
answers(object.min(64), mesh.min(32), 32, total.min(8)),
"{stem}"
);
limited.max_total_threadgroups_per_mesh_grid = Some(1 << 21);
limited.required_threads_per_object_threadgroup = Some([32, 2, 1]);
assert_eq!(
info(&limited),
answers(object.min(64), mesh.min(32), 32, total.min(1 << 21)),
"{stem}"
);
// A required size alone gives its stage its threads (an M3 Max's first compile answers 64
// for `required-object-32x2` and 32 for `required-mesh-16x2`).
let mut required = d.clone();
required.required_threads_per_object_threadgroup = Some([32, 2, 1]);
assert_eq!(
info(&required),
answers(object.min(64), mesh.min(1024), 32, total.min(1 << 20)),
"{stem}"
);
required.required_threads_per_object_threadgroup = None;
required.required_threads_per_mesh_threadgroup = Some([16, 2, 1]);
assert_eq!(
info(&required),
answers(object.min(1024), mesh.min(32), 32, total.min(1 << 20)),
"{stem}"
);
// The functions' own maxima (`mesh_outputs_object`'s 64 threads, `mesh_outputs_triangles`'
// 32 threads), and the descriptor's equal ones; the object function's 16 threadgroups
// change no grid.
let mut own = MeshPipelineDescriptor::new(stage(&outputs, "mesh_outputs_triangles"));
own.object = Some(stage(&outputs, "mesh_outputs_object"));
own.rasterization_enabled = false;
let theirs = answers(object.min(64), mesh.min(32), 32, total.min(1 << 20));
assert_eq!(info(&own), theirs, "{stem}");
own.max_total_threads_per_object_threadgroup = Some(64);
own.max_total_threads_per_mesh_threadgroup = Some(32);
assert_eq!(info(&own), theirs, "{stem}");
own.max_total_threadgroups_per_mesh_grid = Some(32);
assert_eq!(
info(&own).max_total_threadgroups_per_mesh_grid,
total.min(32),
"{stem}"
);
// A required size below the function's own maximum gives its stage its threads (an M3
// Max's first compile answers 32 for `required-object-32-attribute-64`).
own.max_total_threads_per_object_threadgroup = None;
own.max_total_threads_per_mesh_threadgroup = None;
own.max_total_threadgroups_per_mesh_grid = None;
own.required_threads_per_mesh_threadgroup = Some([16, 1, 1]);
assert_eq!(
info(&own),
answers(object.min(64), mesh.min(16), 32, total.min(1 << 20)),
"{stem}"
);
// Without an object function.
let mut alone = MeshPipelineDescriptor::new(stage(&draws, "mesh_draws_grid"));
alone.rasterization_enabled = false;
assert_eq!(
info(&alone),
answers(0, mesh.min(1024), 0, total.min(1 << 20)),
"{stem}"
);
alone.required_threads_per_mesh_threadgroup = Some([16, 2, 1]);
assert_eq!(
info(&alone),
answers(0, mesh.min(32), 0, total.min(1 << 20)),
"{stem}"
);
}
}
/// A mesh render pipeline descriptor Metal refuses is refused as Metal's rule
/// (`InvalidDescriptor(MeshPipeline)`, measured on an M3 Max, `mesh_pipeline_limits.m`), on every
/// committed profile with `VK_EXT_mesh_shader`, and the descriptors beside each are made: a required size with an axis of
@@ -3177,11 +3177,6 @@ field metal2vulkan::pipeline::MeshPipelineDescriptor.required_threads_per_object
field metal2vulkan::pipeline::MeshPipelineDescriptor.stencil_format pub stencil_format: Option<metal::PixelFormat>
field metal2vulkan::pipeline::MeshPipelineDescriptor.support_indirect_command_buffers pub support_indirect_command_buffers: bool
field metal2vulkan::pipeline::MeshPipelineDescriptor.texture_write_rounding_mode pub texture_write_rounding_mode: metal::TextureWriteRoundingMode
field metal2vulkan::pipeline::MeshPipelineMetalInfo.max_total_threadgroups_per_mesh_grid pub max_total_threadgroups_per_mesh_grid: u32
field metal2vulkan::pipeline::MeshPipelineMetalInfo.max_total_threads_per_mesh_threadgroup pub max_total_threads_per_mesh_threadgroup: u32
field metal2vulkan::pipeline::MeshPipelineMetalInfo.max_total_threads_per_object_threadgroup pub max_total_threads_per_object_threadgroup: u32
field metal2vulkan::pipeline::MeshPipelineMetalInfo.mesh_thread_execution_width pub mesh_thread_execution_width: u32
field metal2vulkan::pipeline::MeshPipelineMetalInfo.object_thread_execution_width pub object_thread_execution_width: u32
field metal2vulkan::pipeline::ModuleStats.blocks pub blocks: u32
field metal2vulkan::pipeline::ModuleStats.constructs pub constructs: u32
field metal2vulkan::pipeline::ModuleStats.functions pub functions: u32
@@ -3248,7 +3243,6 @@ field metal2vulkan::pipeline::RenderPipeline.graphics pub graphics: GraphicsStat
field metal2vulkan::pipeline::RenderPipeline.interface pub interface: PipelineInterface
field metal2vulkan::pipeline::RenderPipeline.key pub key: PipelineKey
field metal2vulkan::pipeline::RenderPipeline.layout pub layout: PipelineLayout
field metal2vulkan::pipeline::RenderPipeline.mesh_info pub mesh_info: Option<MeshPipelineMetalInfo>
field metal2vulkan::pipeline::RenderPipeline.profile pub profile: Hash256
field metal2vulkan::pipeline::RenderPipeline.requirements pub requirements: Requirements
field metal2vulkan::pipeline::RenderPipeline.stages pub stages: Vec<StageModule>
@@ -8041,7 +8035,6 @@ struct metal2vulkan::pipeline::LinkedFunctions #[derive(Clone, Debug, Default, P
struct metal2vulkan::pipeline::LinkedSource #[derive(Clone, Copy, Debug)] pub struct LinkedSource<'a>
struct metal2vulkan::pipeline::LoweringInputs #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] #[non_exhaustive] pub struct LoweringInputs
struct metal2vulkan::pipeline::MeshPipelineDescriptor #[derive(Clone, Debug, PartialEq, Eq)] #[non_exhaustive] pub struct MeshPipelineDescriptor
struct metal2vulkan::pipeline::MeshPipelineMetalInfo #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] #[non_exhaustive] pub struct MeshPipelineMetalInfo
struct metal2vulkan::pipeline::ModuleStats #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] #[non_exhaustive] pub struct ModuleStats
struct metal2vulkan::pipeline::PipelineInterface #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] #[non_exhaustive] pub struct PipelineInterface
struct metal2vulkan::pipeline::PipelineLayout #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] #[non_exhaustive] pub struct PipelineLayout
Can't render this file because it is too large.
-1
View File
@@ -320,7 +320,6 @@ surface! {
struct EntryPlan N;
enum EntryRef E;
struct LinkedSource O;
struct MeshPipelineMetalInfo N;
struct StageEntries O;
struct StandaloneModule N;
struct ModuleStats N;